diff --git a/docs/resources/postgresflex_user.md b/docs/resources/postgresflex_user.md index 763e1e192..6ec390135 100644 --- a/docs/resources/postgresflex_user.md +++ b/docs/resources/postgresflex_user.md @@ -34,7 +34,7 @@ import { - `instance_id` (String) ID of the PostgresFlex instance. - `project_id` (String) STACKIT project ID to which the instance is associated. -- `roles` (Set of String) Database access levels for the user. Possible values are: `login`, `createdb`. +- `roles` (Set of String) Database access levels for the user. - `username` (String) ### Optional diff --git a/stackit/internal/services/postgresflex/user/resource.go b/stackit/internal/services/postgresflex/user/resource.go index 2b1416e3b..4d5e9ffc1 100644 --- a/stackit/internal/services/postgresflex/user/resource.go +++ b/stackit/internal/services/postgresflex/user/resource.go @@ -8,8 +8,6 @@ import ( postgresflexUtils "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/postgresflex/utils" - "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" - "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion" @@ -115,15 +113,13 @@ func (r *userResource) Configure(ctx context.Context, req resource.ConfigureRequ // Schema defines the schema for the resource. func (r *userResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { - rolesOptions := []string{"login", "createdb"} - descriptions := map[string]string{ "main": "Postgres Flex user resource schema. Must have a `region` specified in the provider configuration.", "id": "Terraform's internal resource ID. It is structured as \"`project_id`,`region`,`instance_id`,`user_id`\".", "user_id": "User ID.", "instance_id": "ID of the PostgresFlex instance.", "project_id": "STACKIT project ID to which the instance is associated.", - "roles": "Database access levels for the user. " + utils.FormatPossibleValues(rolesOptions...), + "roles": "Database access levels for the user.", "region": "The resource region. If not defined, the provider region is used.", } @@ -181,11 +177,6 @@ func (r *userResource) Schema(_ context.Context, _ resource.SchemaRequest, resp Description: descriptions["roles"], ElementType: types.StringType, Required: true, - Validators: []validator.Set{ - setvalidator.ValueStringsAre( - stringvalidator.OneOf("login", "createdb"), - ), - }, }, "password": schema.StringAttribute{ Computed: true,