Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/resources/postgresflex_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 5 additions & 2 deletions docs/resources/sqlserverflex_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
20 changes: 4 additions & 16 deletions stackit/internal/services/postgresflex/instance/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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.",
Expand Down Expand Up @@ -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,
Expand All @@ -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{
Expand Down
13 changes: 4 additions & 9 deletions stackit/internal/services/sqlserverflex/instance/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Loading