Make roles optional (#432)

* make roles optional

* check if roles is unknown

* add descriptions

* update docs

* change role condition handling

* Update stackit/internal/services/sqlserverflex/user/resource.go

Co-authored-by: João Palet <joao.palet@outlook.com>

* Update stackit/internal/services/sqlserverflex/user/datasource.go

Co-authored-by: João Palet <joao.palet@outlook.com>

* Update stackit/internal/services/sqlserverflex/user/datasource.go

Co-authored-by: João Palet <joao.palet@outlook.com>

* fix escapes

* adapt unit tests

* update docs

* Update stackit/internal/services/sqlserverflex/user/datasource.go

Co-authored-by: João Palet <joao.palet@outlook.com>

* Update stackit/internal/services/sqlserverflex/user/resource.go

Co-authored-by: João Palet <joao.palet@outlook.com>

* adapt unit tests

* update docs

---------

Co-authored-by: João Palet <joao.palet@outlook.com>
This commit is contained in:
GokceGK 2024-06-26 10:30:12 +02:00 committed by GitHub
parent 9f82c3262b
commit 7fbb13c0b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 32 additions and 16 deletions

View file

@ -95,6 +95,9 @@ func (r *userDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, r
"user_id": "User ID.",
"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##`]",
"password": "Password of the user account.",
}
resp.Schema = schema.Schema{
@ -128,9 +131,11 @@ func (r *userDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, r
},
},
"username": schema.StringAttribute{
Computed: true,
Description: descriptions["username"],
Computed: true,
},
"roles": schema.SetAttribute{
Description: descriptions["roles"],
ElementType: types.StringType,
Computed: true,
},