Feat/alpa postgres user (#14)
* chore: add stackit_postgresflexalpha_user resource * chore: refactor postgresflex user resource to postgresflexalpha * chore: refactor wait handlers and update API client interfaces for postgresflexalpha * chore: add stackit_postgresflexalpha_user data source example * fix: refactor sqlserverflexalpha user resource and enhance schema with status and default_database --------- Co-authored-by: Andre Harms <andre.harms@stackit.cloud>
This commit is contained in:
parent
f0414ab3b9
commit
6aac685ed4
3 changed files with 30 additions and 22 deletions
|
|
@ -144,7 +144,8 @@ func TestCreateInstanceWaitHandler(t *testing.T) {
|
|||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.desc, func(t *testing.T) {
|
||||
t.Run(
|
||||
tt.desc, func(t *testing.T) {
|
||||
instanceId := "foo-bar"
|
||||
|
||||
apiClient := &apiClientInstanceMocked{
|
||||
|
|
@ -220,7 +221,8 @@ func TestUpdateInstanceWaitHandler(t *testing.T) {
|
|||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.desc, func(t *testing.T) {
|
||||
t.Run(
|
||||
tt.desc, func(t *testing.T) {
|
||||
instanceId := "foo-bar"
|
||||
|
||||
apiClient := &apiClientInstanceMocked{
|
||||
|
|
@ -376,7 +378,7 @@ func TestDeleteUserWaitHandler(t *testing.T) {
|
|||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.desc, func(t *testing.T) {
|
||||
userId := int64(1001)
|
||||
userId := "foo-bar"
|
||||
|
||||
apiClient := &apiClientUserMocked{
|
||||
getFails: tt.getFails,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
data "stackit_postgresflexalpha_user" "example" {
|
||||
project_id = stackitalpha_postgresflexalpha_instance.ptlsdbsrv.project_id
|
||||
instance_id = stackitalpha_postgresflexalpha_instance.ptlsdbsrv.id
|
||||
user_id = 1
|
||||
}
|
||||
|
||||
resource "stackit_sqlserverflexalpha_user" "ptlsdbuser" {
|
||||
project_id = stackitalpha_postgresflexalpha_instance.ptlsdbsrv.project_id
|
||||
instance_id = stackitalpha_postgresflexalpha_instance.ptlsdbsrv.id
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ func ConfigureClient(
|
|||
} else {
|
||||
apiClientConfigOptions = append(apiClientConfigOptions, config.WithRegion(providerData.GetRegion()))
|
||||
}
|
||||
apiClient, err := sqlserverflexalpha.NewAPIClient(apiClientConfigOptions...)
|
||||
apiClient, err := sqlserverflex.NewAPIClient(apiClientConfigOptions...)
|
||||
if err != nil {
|
||||
core.LogAndAddError(
|
||||
ctx,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue