diff --git a/cmd/cmd/build/build.go b/cmd/cmd/build/build.go index 30fbf552..1226b876 100644 --- a/cmd/cmd/build/build.go +++ b/cmd/cmd/build/build.go @@ -678,7 +678,12 @@ func handleTfTagForDatasourceFile(filePath, service, resource string) error { } defer f.Close() - tmp, err := os.CreateTemp("", "replace-*") + root, err := getRoot() + if err != nil { + log.Fatal(err) + } + + tmp, err := os.CreateTemp(*root, "replace-*") if err != nil { return err } diff --git a/docs/data-sources/postgresflexalpha_database.md b/docs/data-sources/postgresflexalpha_database.md index 834d030c..95c115e3 100644 --- a/docs/data-sources/postgresflexalpha_database.md +++ b/docs/data-sources/postgresflexalpha_database.md @@ -3,12 +3,12 @@ page_title: "stackitprivatepreview_postgresflexalpha_database Data Source - stackitprivatepreview" subcategory: "" description: |- - Postgres Flex database resource schema. Must have a region specified in the provider configuration. + --- # stackitprivatepreview_postgresflexalpha_database (Data Source) -Postgres Flex database resource schema. Must have a `region` specified in the provider configuration. + ## Example Usage @@ -25,16 +25,14 @@ data "stackitprivatepreview_postgresflexalpha_database" "example" { ### Required -- `instance_id` (String) ID of the Postgres Flex instance. -- `project_id` (String) STACKIT project ID to which the instance is associated. - -### Optional - -- `database_id` (Number) Database ID. -- `name` (String) Database name. -- `region` (String) The resource region. If not defined, the provider region is used. +- `database_id` (Number) The ID of the database. +- `instance_id` (String) The ID of the instance. +- `project_id` (String) The STACKIT project ID. +- `region` (String) The region which should be addressed ### Read-Only -- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`instance_id`,`database_id`". -- `owner` (String) Username of the database owner. +- `id` (String) Terraform's internal resource ID. It is structured as \"`project_id`,`region`,`instance_id`,`database_id`\".", +- `name` (String) The name of the database. +- `owner` (String) The owner of the database. +- `tf_original_api_id` (Number) The id of the database. diff --git a/docs/data-sources/postgresflexalpha_user.md b/docs/data-sources/postgresflexalpha_user.md index 1cda4f62..c3553c7b 100644 --- a/docs/data-sources/postgresflexalpha_user.md +++ b/docs/data-sources/postgresflexalpha_user.md @@ -3,12 +3,12 @@ page_title: "stackitprivatepreview_postgresflexalpha_user Data Source - stackitprivatepreview" subcategory: "" description: |- - Postgres Flex user data source schema. Must have a region specified in the provider configuration. + --- # stackitprivatepreview_postgresflexalpha_user (Data Source) -Postgres Flex user data source schema. Must have a `region` specified in the provider configuration. + ## Example Usage @@ -25,20 +25,18 @@ data "stackitprivatepreview_postgresflexalpha_user" "example" { ### Required -- `instance_id` (String) ID of the PostgresFlex instance. -- `project_id` (String) STACKIT project ID to which the instance is associated. -- `user_id` (String) User ID. +- `instance_id` (String) The ID of the instance. +- `project_id` (String) The STACKIT project ID. +- `region` (String) The region which should be addressed +- `user_id` (Number) The ID of the user. ### Optional -- `region` (String) The resource region. If not defined, the provider region is used. +- `id` (String) Terraform's internal resource ID. It is structured as \"`project_id`,`region`,`instance_id`,`user_id`\".", ### Read-Only -- `connection_string` (String) The connection string for the user to the instance. -- `host` (String) The host address for the user to connect to the instance. -- `id` (String) Terraform's internal data source. ID. It is structured as "`project_id`,`region`,`instance_id`,`user_id`". -- `port` (Number) The port number for the user to connect to the instance. -- `roles` (Set of String) The roles assigned to the user. +- `name` (String) The name of the user. +- `roles` (List of String) A list of user roles. - `status` (String) The current status of the user. -- `username` (String) The name of the user. +- `tf_original_api_id` (Number) The ID of the user. diff --git a/docs/data-sources/sqlserverflexalpha_database.md b/docs/data-sources/sqlserverflexalpha_database.md index 5db648f4..20e8a653 100644 --- a/docs/data-sources/sqlserverflexalpha_database.md +++ b/docs/data-sources/sqlserverflexalpha_database.md @@ -26,6 +26,7 @@ description: |- - `collation_name` (String) The collation of the database. This database collation should match the *collation_name* of one of the collations given by the **Get database collation list** endpoint. - `compatibility_level` (Number) CompatibilityLevel of the Database. +- `id` (String) Terraform's internal resource ID. It is structured as \"`project_id`,`region`,`instance_id`,`database_id`\".", - `name` (String) The name of the database. - `owner` (String) The owner of the database. - `tf_original_api_id` (Number) The id of the database. diff --git a/docs/data-sources/sqlserverflexalpha_instance.md b/docs/data-sources/sqlserverflexalpha_instance.md index b05d7b8e..f209c424 100644 --- a/docs/data-sources/sqlserverflexalpha_instance.md +++ b/docs/data-sources/sqlserverflexalpha_instance.md @@ -34,6 +34,7 @@ data "stackitprivatepreview_sqlserverflexalpha_instance" "example" { - `edition` (String) Edition of the MSSQL server instance - `encryption` (Attributes) this defines which key to use for storage encryption (see [below for nested schema](#nestedatt--encryption)) - `flavor_id` (String) The id of the instance flavor. +- `id` (String) Terraform's internal resource ID. It is structured as \"`project_id`,`region`,`instance_id`\". - `is_deletable` (Boolean) Whether the instance can be deleted or not. - `name` (String) The name of the instance. - `network` (Attributes) The access configuration of the instance (see [below for nested schema](#nestedatt--network)) diff --git a/docs/resources/postgresflexalpha_database.md b/docs/resources/postgresflexalpha_database.md index 8fdceeb5..7834287e 100644 --- a/docs/resources/postgresflexalpha_database.md +++ b/docs/resources/postgresflexalpha_database.md @@ -3,12 +3,12 @@ page_title: "stackitprivatepreview_postgresflexalpha_database Resource - stackitprivatepreview" subcategory: "" description: |- - Postgres Flex database resource schema. Must have a region specified in the provider configuration. + --- # stackitprivatepreview_postgresflexalpha_database (Resource) -Postgres Flex database resource schema. Must have a `region` specified in the provider configuration. + ## Example Usage @@ -32,16 +32,16 @@ import { ### Required -- `instance_id` (String) ID of the Postgres Flex instance. -- `name` (String) Database name. -- `owner` (String) Username of the database owner. -- `project_id` (String) STACKIT project ID to which the instance is associated. +- `name` (String) The name of the database. ### Optional -- `region` (String) The resource region. If not defined, the provider region is used. +- `database_id` (Number) The ID of the database. +- `instance_id` (String) The ID of the instance. +- `owner` (String) The owner of the database. +- `project_id` (String) The STACKIT project ID. +- `region` (String) The region which should be addressed ### Read-Only -- `database_id` (Number) Database ID. -- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`instance_id`,`database_id`". +- `id` (Number) The id of the database. diff --git a/docs/resources/postgresflexalpha_user.md b/docs/resources/postgresflexalpha_user.md index d3b12f9d..2ebffe71 100644 --- a/docs/resources/postgresflexalpha_user.md +++ b/docs/resources/postgresflexalpha_user.md @@ -3,12 +3,12 @@ page_title: "stackitprivatepreview_postgresflexalpha_user Resource - stackitprivatepreview" subcategory: "" description: |- - Postgres Flex user resource schema. Must have a region specified in the provider configuration. + --- # stackitprivatepreview_postgresflexalpha_user (Resource) -Postgres Flex user resource schema. Must have a `region` specified in the provider configuration. + ## Example Usage @@ -32,21 +32,19 @@ import { ### Required -- `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`, `createrole`. -- `username` (String) The name of the user. +- `name` (String) The name of the user. ### Optional -- `region` (String) The resource region. If not defined, the provider region is used. +- `instance_id` (String) The ID of the instance. +- `project_id` (String) The STACKIT project ID. +- `region` (String) The region which should be addressed +- `roles` (List of String) A list containing the user roles for the instance. +- `user_id` (Number) The ID of the user. ### Read-Only - `connection_string` (String) The connection string for the user to the instance. -- `host` (String) The host of the Postgres Flex instance. -- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`instance_id`,`user_id`". -- `password` (String, Sensitive) The password for the user. This is only set upon creation. -- `port` (Number) The port of the Postgres Flex instance. +- `id` (Number) The ID of the user. +- `password` (String) The password for the user. - `status` (String) The current status of the user. -- `user_id` (Number) User ID. diff --git a/docs/resources/sqlserverflexalpha_user.md b/docs/resources/sqlserverflexalpha_user.md index 3f37556c..8c5f8702 100644 --- a/docs/resources/sqlserverflexalpha_user.md +++ b/docs/resources/sqlserverflexalpha_user.md @@ -3,12 +3,12 @@ page_title: "stackitprivatepreview_sqlserverflexalpha_user Resource - stackitprivatepreview" subcategory: "" description: |- - SQLServer Flex user resource schema. Must have a region specified in the provider configuration. + --- # stackitprivatepreview_sqlserverflexalpha_user (Resource) -SQLServer Flex user resource schema. Must have a `region` specified in the provider configuration. + ## Example Usage @@ -32,21 +32,22 @@ import { ### Required -- `instance_id` (String) ID of the SQLServer Flex instance. -- `project_id` (String) STACKIT project ID to which the instance is associated. -- `roles` (Set of String) Database access levels for the user. The values for the default roles are: `##STACKIT_DatabaseManager##`, `##STACKIT_LoginManager##`, `##STACKIT_ProcessManager##`, `##STACKIT_ServerManager##`, `##STACKIT_SQLAgentManager##`, `##STACKIT_SQLAgentUser##` -- `username` (String) Username of the SQLServer Flex instance. +- `roles` (List of String) A list containing the user roles for the instance. +- `username` (String) The name of the user. ### Optional -- `region` (String) +- `default_database` (String) The default database for a user of the instance. +- `instance_id` (String) The ID of the instance. +- `project_id` (String) The STACKIT project ID. +- `region` (String) The region which should be addressed +- `user_id` (Number) The ID of the user. ### Read-Only -- `default_database` (String) -- `host` (String) -- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`instance_id`,`user_id`". -- `password` (String, Sensitive) Password of the user account. -- `port` (Number) -- `status` (String) -- `user_id` (Number) User ID. +- `host` (String) The host of the instance in which the user belongs to. +- `id` (Number) The ID of the user. +- `password` (String) The password for the user. +- `port` (Number) The port of the instance in which the user belongs to. +- `status` (String) The current status of the user. +- `uri` (String) The connection string for the user to the instance. diff --git a/stackit/internal/services/postgresflexalpha/database/functions.go b/stackit/internal/services/postgresflexalpha/database/functions.go index 4496faa1..e67f4926 100644 --- a/stackit/internal/services/postgresflexalpha/database/functions.go +++ b/stackit/internal/services/postgresflexalpha/database/functions.go @@ -59,7 +59,7 @@ func getDatabase( for page := int32(1); ; page++ { res, err := client.ListDatabasesRequest(ctx, projectId, region, instanceId). - Page(page).Size(pageSize).Sort(postgresflex.DATABASESORT_INDEX_ASC).Execute() + Page(page).Size(pageSize).Sort(postgresflex.DATABASESORT_DATABASE_ID_ASC).Execute() if err != nil { return nil, fmt.Errorf("requesting database list (page %d): %w", page, err) } diff --git a/stackit/internal/services/postgresflexalpha/flavor/functions.go b/stackit/internal/services/postgresflexalpha/flavor/functions.go index 5a631bc7..67c7f9fa 100644 --- a/stackit/internal/services/postgresflexalpha/flavor/functions.go +++ b/stackit/internal/services/postgresflexalpha/flavor/functions.go @@ -44,7 +44,7 @@ func getFlavorsByFilter( for page := int32(1); ; page++ { res, err := client.GetFlavorsRequest(ctx, projectId, region). - Page(page).Size(pageSize).Sort(postgresflex.FLAVORSORT_INDEX_ASC).Execute() + Page(page).Size(pageSize).Sort(postgresflex.FLAVORSORT_ID_ASC).Execute() if err != nil { return nil, fmt.Errorf("requesting flavors list (page %d): %w", page, err) }