feat: add new sql-server roles (#699)

* feat: add new sql-server roles

* feat: remove role validation
This commit is contained in:
Mauritz Uphoff 2025-03-03 12:18:44 +01:00 committed by GitHub
parent 380ff8c6d8
commit fda9622cbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 11 deletions

View file

@ -34,5 +34,5 @@ data "stackit_sqlserverflex_user" "example" {
- `host` (String)
- `id` (String) Terraform's internal data source. ID. It is structured as "`project_id`,`instance_id`,`user_id`".
- `port` (Number)
- `roles` (Set of String) Database access levels for the user. Possible values: [`##STACKIT_LoginManager##`, `##STACKIT_DatabaseManager##`]
- `roles` (Set of String) Database access levels for the user.
- `username` (String) Username of the SQLServer Flex instance.

View file

@ -32,7 +32,7 @@ resource "stackit_sqlserverflex_user" "example" {
### Optional
- `roles` (Set of String) Database access levels for the user. Possible values: [`##STACKIT_LoginManager##`, `##STACKIT_DatabaseManager##`]
- `roles` (Set of String) Database access levels for the user.
### Read-Only

View file

@ -96,7 +96,7 @@ func (r *userDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, r
"instance_id": "ID of the SQLServer Flex instance.",
"project_id": "STACKIT project ID to which the instance is associated.",
"username": "Username of the SQLServer Flex instance.",
"roles": "Database access levels for the user. Possible values: [`##STACKIT_LoginManager##`, `##STACKIT_DatabaseManager##`]",
"roles": "Database access levels for the user.",
"password": "Password of the user account.",
}

View file

@ -6,14 +6,12 @@ import (
"net/http"
"strings"
"github.com/hashicorp/terraform-plugin-framework-validators/setvalidator"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion"
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate"
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/resource"
@ -106,7 +104,7 @@ func (r *userResource) Schema(_ context.Context, _ resource.SchemaRequest, resp
"instance_id": "ID of the SQLServer Flex instance.",
"project_id": "STACKIT project ID to which the instance is associated.",
"username": "Username of the SQLServer Flex instance.",
"roles": "Database access levels for the user. Possible values: [`##STACKIT_LoginManager##`, `##STACKIT_DatabaseManager##`]",
"roles": "Database access levels for the user.",
"password": "Password of the user account.",
}
@ -169,11 +167,6 @@ func (r *userResource) Schema(_ context.Context, _ resource.SchemaRequest, resp
PlanModifiers: []planmodifier.Set{
setplanmodifier.RequiresReplace(),
},
Validators: []validator.Set{
setvalidator.ValueStringsAre(
stringvalidator.OneOf("##STACKIT_LoginManager##", "##STACKIT_DatabaseManager##"),
),
},
},
"password": schema.StringAttribute{
Description: descriptions["password"],