Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/resources/postgresflex_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 1 addition & 10 deletions stackit/internal/services/postgresflex/user/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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.",
}

Expand Down Expand Up @@ -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,
Expand Down
Loading