diff --git a/docs/resources/postgresflex_instance.md b/docs/resources/postgresflex_instance.md index e8786c8ca..c96e6dcb7 100644 --- a/docs/resources/postgresflex_instance.md +++ b/docs/resources/postgresflex_instance.md @@ -45,10 +45,10 @@ resource "stackit_postgresflex_instance" "example" { - `acl` (List of String, Deprecated) The Access Control List (ACL) for the PostgresFlex instance. - `encryption` (Attributes) (see [below for nested schema](#nestedatt--encryption)) -- `flavor` (Attributes) (see [below for nested schema](#nestedatt--flavor)) +- `flavor` (Attributes, Deprecated) (see [below for nested schema](#nestedatt--flavor)) - `flavor_id` (String) The flavor ID of the PostgreSQL Flex instance. Can only be set when `flavor` and `replicas` are not set. You can list available storage classes using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli): ```bash -stackit postgresflex options --flavors +stackit curl https://postgres-flex-service.api.stackit.cloud/v3/projects/{project_id}/regions/{region}/flavors\?size=100 ``` - `network` (Attributes) The network configuration of the instance. Will be required after February 2027. Set a value to prevent breaking changes. (see [below for nested schema](#nestedatt--network)) - `region` (String) The resource region. If not defined, the provider region is used. diff --git a/docs/resources/sqlserverflex_instance.md b/docs/resources/sqlserverflex_instance.md index 06bfdac1b..cb9502e83 100644 --- a/docs/resources/sqlserverflex_instance.md +++ b/docs/resources/sqlserverflex_instance.md @@ -43,8 +43,11 @@ resource "stackit_sqlserverflex_instance" "example" { - `acl` (List of String, Deprecated) The Access Control List (ACL) for the SQLServer Flex instance. - `backup_schedule` (String) The backup schedule. Should follow the cron scheduling system format (e.g. "0 0 * * *") Will be required in the future. Set a value to prevent breaking changes. - `encryption` (Attributes) Parameter to define which key to use for storage encryption. (see [below for nested schema](#nestedatt--encryption)) -- `flavor` (Attributes) (see [below for nested schema](#nestedatt--flavor)) -- `flavor_id` (String) The flavor ID of the SQLServer Flex instance. +- `flavor` (Attributes, Deprecated) (see [below for nested schema](#nestedatt--flavor)) +- `flavor_id` (String) The flavor ID of the sqlserver Flex instance. Can only be set when `flavor` and `replicas` are not set. You can list available storage classes using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli): +```bash +stackit curl https://mssql-flex-service.api.stackit.cloud/v3/projects/{project_id}/regions/{region}/flavors\?size=100 +``` - `network` (Attributes) The network configuration of the instance. Will be required in the future. Set a value to prevent breaking changes. (see [below for nested schema](#nestedatt--network)) - `options` (Attributes, Deprecated) (see [below for nested schema](#nestedatt--options)) - `region` (String) The resource region. If not defined, the provider region is used. diff --git a/stackit/internal/services/postgresflex/instance/resource.go b/stackit/internal/services/postgresflex/instance/resource.go index be2f3a92a..dd94dd2a5 100644 --- a/stackit/internal/services/postgresflex/instance/resource.go +++ b/stackit/internal/services/postgresflex/instance/resource.go @@ -28,7 +28,6 @@ import ( postgresflexUtils "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/postgresflex/utils" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils/planmodifiers/listplanmodifier" - stringplanmodifier2 "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils/planmodifiers/stringplanmodifier" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" "github.com/hashicorp/terraform-plugin-framework/resource" @@ -261,7 +260,7 @@ func (r *instanceResource) Schema(_ context.Context, req resource.SchemaRequest, "connection_info.write.host": "The host of the instance.", "connection_info.write.port": "The port of the instance.", "replicas": "How many replicas the instance should have. Valid values are 1 for single mode or 3 for replication. Can only be set together with `flavor`", - "flavor_id": "The flavor ID of the PostgreSQL Flex instance. Can only be set when `flavor` and `replicas` are not set. You can list available storage classes using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli):\n```bash\nstackit postgresflex options --flavors\n```", + "flavor_id": "The flavor ID of the PostgreSQL Flex instance. Can only be set when `flavor` and `replicas` are not set. You can list available storage classes using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli):\n```bash\nstackit curl https://postgres-flex-service.api.stackit.cloud/v3/projects/{project_id}/regions/{region}/flavors\\?size=100\n```", "encryption.kek_key_id": "The ID of the Key within the STACKIT-KMS to use for the encryption.", "encryption.kek_keyring_id": "The ID of the keyring where the key is located within the STACKTI-KMS.", "encryption.kek_key_version": "Version of the key within the STACKIT-KMS to use for the encryption.", @@ -386,22 +385,15 @@ func (r *instanceResource) Schema(_ context.Context, req resource.SchemaRequest, }, }, "flavor": schema.SingleNestedAttribute{ - Optional: true, - Computed: true, + Optional: true, + Computed: true, + DeprecationMessage: "flavor is deprecated and will be removed after February 2027. Use instead `flavor_id`. You can get the available flavors using the STACKIT-CLI using `stackit curl https://postgres-flex-service.api.stackit.cloud/v3/projects/{project_id}/regions/{region}/flavors\\?size=100`.", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, - PlanModifiers: []planmodifier.String{ - UseStateForUnknownIfFlavorUnchanged(req), - stringplanmodifier2.UseStateForUnknownIf(stringplanmodifier2.StringUnchanged(path.Root("flavor_id")), "sets `UseStateForUnknown` if `flavor_id` remains unchanged"), - }, }, "description": schema.StringAttribute{ Computed: true, - PlanModifiers: []planmodifier.String{ - UseStateForUnknownIfFlavorUnchanged(req), - stringplanmodifier2.UseStateForUnknownIf(stringplanmodifier2.StringUnchanged(path.Root("flavor_id")), "sets `UseStateForUnknown` if `flavor_id` remains unchanged"), - }, }, "cpu": schema.Int64Attribute{ Required: true, @@ -411,10 +403,6 @@ func (r *instanceResource) Schema(_ context.Context, req resource.SchemaRequest, }, "node_type": schema.StringAttribute{ Computed: true, - PlanModifiers: []planmodifier.String{ - UseStateForUnknownIfFlavorUnchanged(req), - stringplanmodifier2.UseStateForUnknownIf(stringplanmodifier2.StringUnchanged(path.Root("flavor_id")), "sets `UseStateForUnknown` if `flavor_id` remains unchanged"), - }, }, }, Validators: []validator.Object{ diff --git a/stackit/internal/services/sqlserverflex/instance/resource.go b/stackit/internal/services/sqlserverflex/instance/resource.go index 210b75a39..2b1ade3f2 100644 --- a/stackit/internal/services/sqlserverflex/instance/resource.go +++ b/stackit/internal/services/sqlserverflex/instance/resource.go @@ -327,7 +327,7 @@ func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, r "kek_key_version": "Version of the key within the STACKIT-KMS to use for the encryption.", "service_account": "Service-Account linked to the Key within the STACKIT-KMS.", "options": "Custom parameters for the SQLServer Flex instance.", - "flavor_id": "The flavor ID of the SQLServer Flex instance.", + "flavor_id": "The flavor ID of the sqlserver Flex instance. Can only be set when `flavor` and `replicas` are not set. You can list available storage classes using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli):\n```bash\nstackit curl https://mssql-flex-service.api.stackit.cloud/v3/projects/{project_id}/regions/{region}/flavors\\?size=100\n```", "network": "The network configuration of the instance." + willBeRequired, "network.access_scope": "The network access scope of the instance. This feature is in private preview. Supplying this object is only permitted for enabled accounts. If your account does not have access, the request will be rejected.", "network.acl": "List of IPV4 cidr." + willBeRequired, @@ -455,20 +455,15 @@ func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, r }, }, "flavor": schema.SingleNestedAttribute{ - Computed: true, - Optional: true, + Computed: true, + Optional: true, + DeprecationMessage: "flavor is deprecated and will be removed after February 2027. Use instead `flavor_id`. You can get the available flavors using the STACKIT-CLI using `stackit curl https://mssql-flex-service.api.stackit.cloud/v3/projects/{project_id}/regions/{region}/flavors\\?size=100`.", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - }, }, "description": schema.StringAttribute{ Computed: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - }, }, "cpu": schema.Int64Attribute{ Required: true,