Skip to content

Commit b16cfc4

Browse files
authored
fix(postgresflex): remove the role validation for postgresflex user (#1116)
relates to #1105
1 parent f590525 commit b16cfc4

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

docs/resources/postgresflex_user.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {
3434

3535
- `instance_id` (String) ID of the PostgresFlex instance.
3636
- `project_id` (String) STACKIT project ID to which the instance is associated.
37-
- `roles` (Set of String) Database access levels for the user. Possible values are: `login`, `createdb`.
37+
- `roles` (Set of String) Database access levels for the user.
3838
- `username` (String)
3939

4040
### Optional

stackit/internal/services/postgresflex/user/resource.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import (
88

99
postgresflexUtils "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/postgresflex/utils"
1010

11-
"github.com/hashicorp/terraform-plugin-framework-validators/setvalidator"
12-
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
1311
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
1412
"github.com/hashicorp/terraform-plugin-log/tflog"
1513
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion"
@@ -115,15 +113,13 @@ func (r *userResource) Configure(ctx context.Context, req resource.ConfigureRequ
115113

116114
// Schema defines the schema for the resource.
117115
func (r *userResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
118-
rolesOptions := []string{"login", "createdb"}
119-
120116
descriptions := map[string]string{
121117
"main": "Postgres Flex user resource schema. Must have a `region` specified in the provider configuration.",
122118
"id": "Terraform's internal resource ID. It is structured as \"`project_id`,`region`,`instance_id`,`user_id`\".",
123119
"user_id": "User ID.",
124120
"instance_id": "ID of the PostgresFlex instance.",
125121
"project_id": "STACKIT project ID to which the instance is associated.",
126-
"roles": "Database access levels for the user. " + utils.FormatPossibleValues(rolesOptions...),
122+
"roles": "Database access levels for the user.",
127123
"region": "The resource region. If not defined, the provider region is used.",
128124
}
129125

@@ -181,11 +177,6 @@ func (r *userResource) Schema(_ context.Context, _ resource.SchemaRequest, resp
181177
Description: descriptions["roles"],
182178
ElementType: types.StringType,
183179
Required: true,
184-
Validators: []validator.Set{
185-
setvalidator.ValueStringsAre(
186-
stringvalidator.OneOf("login", "createdb"),
187-
),
188-
},
189180
},
190181
"password": schema.StringAttribute{
191182
Computed: true,

0 commit comments

Comments
 (0)