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/data-sources/postgresflex_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ data "stackit_postgresflex_instance" "example" {
- `backup_schedule` (String) The schedule for on what time and how often the database backup will be created. Must be a valid cron expression using numeric minute and hour values, e.g: '0 2 * * *'.
- `connection_info` (Attributes) The connection info for the PostgresFlex instance. (see [below for nested schema](#nestedatt--connection_info))
- `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)
- `id` (String) Terraform's internal data source. ID. It is structured as "`project_id`,`region`,`instance_id`".
- `name` (String) Instance name.
- `network` (Attributes) (see [below for nested schema](#nestedatt--network))
- `replicas` (Number)
- `replicas` (Number, Deprecated)
- `retention_days` (Number)
- `storage` (Attributes) (see [below for nested schema](#nestedatt--storage))
- `version` (String)
Expand Down
9 changes: 3 additions & 6 deletions docs/resources/postgresflex_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,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, 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 curl https://postgres-flex-service.api.stackit.cloud/v3/projects/{project_id}/regions/{region}/flavors\?size=100
```
- `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 flavors using the datasource `stackit_postgresflex_flavors`
- `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.
- `replicas` (Number) 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`
- `replicas` (Number, Deprecated) 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`
- `retention_days` (Number) How long backups are retained. The value can only be between 32 and 90 days. Will be required after February 2027. Set a value to prevent breaking changes.

### Read-Only
Expand All @@ -68,7 +65,7 @@ Required:

- `class` (String) The storage class. You can list available storage classes using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli):
```bash
stackit postgresflex options --storages --flavor-id FLAVOR_ID
stackit postgresflex flavor describe FLAVOR_ID
```
- `size` (Number)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaReques
Computed: true,
},
"flavor": schema.SingleNestedAttribute{
Computed: true,
Computed: true,
DeprecationMessage: "flavor is deprecated and will be removed after February 2027. Use instead `flavor_id`. You can list available flavors using the datasource `stackit_postgresflex_flavors`..",
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Computed: true,
Expand Down Expand Up @@ -178,8 +179,9 @@ func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaReques
},
},
"replicas": schema.Int32Attribute{
Description: descriptions["replicas"],
Computed: true,
Description: descriptions["replicas"],
DeprecationMessage: "replicas is deprecated and will be removed after February 2027. Use instead `flavor_id` and choose a flavor with your wanted replica configuration. You can list available flavors using the datasource `stackit_postgresflex_flavors`.",
Computed: true,
Comment thread
marceljk marked this conversation as resolved.
},
"retention_days": schema.Int32Attribute{
Description: descriptions["retention_days"],
Expand Down
18 changes: 10 additions & 8 deletions stackit/internal/services/postgresflex/instance/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ type Model struct {
BackupSchedule types.String `tfsdk:"backup_schedule"`
ConnectionInfo types.Object `tfsdk:"connection_info"`
// Deprecated: Flavor is deprecated and will be removed after February 2027.
Flavor types.Object `tfsdk:"flavor"`
FlavorId types.String `tfsdk:"flavor_id"`
Flavor types.Object `tfsdk:"flavor"`
FlavorId types.String `tfsdk:"flavor_id"`
// Deprecated: Replicas is deprecated and will be removed after February 2027.
Replicas types.Int32 `tfsdk:"replicas"`
Storage types.Object `tfsdk:"storage"`
Encryption types.Object `tfsdk:"encryption"`
Expand Down Expand Up @@ -261,12 +262,12 @@ 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 curl https://postgres-flex-service.api.stackit.cloud/v3/projects/{project_id}/regions/{region}/flavors\\?size=100\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 flavors using the datasource `stackit_postgresflex_flavors`",
"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.",
"encryption.service_account": "Service-Account linked to the Key within the STACKIT-KMS.",
"storage_class": "The storage class. You can list available storage classes using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli):\n```bash\nstackit postgresflex options --storages --flavor-id FLAVOR_ID\n```",
"storage_class": "The storage class. You can list available storage classes using the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli):\n```bash\nstackit postgresflex flavor describe FLAVOR_ID\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. " + utils.FormatPossibleValues(sdkUtils.EnumSliceToStringSlice(postgresflex.AllowedInstanceNetworkAccessScopeEnumValues)...),
"network.acl": "List of IPV4 cidr." + willBeRequired,
Expand Down Expand Up @@ -388,7 +389,7 @@ func (r *instanceResource) Schema(_ context.Context, req resource.SchemaRequest,
"flavor": schema.SingleNestedAttribute{
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`.",
DeprecationMessage: "flavor is deprecated and will be removed after February 2027. Use instead `flavor_id`. You can list available flavors using the datasource `stackit_postgresflex_flavors`.",
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Computed: true,
Expand Down Expand Up @@ -451,9 +452,10 @@ func (r *instanceResource) Schema(_ context.Context, req resource.SchemaRequest,
},
},
"replicas": schema.Int32Attribute{
Description: descriptions["replicas"],
Optional: true,
Computed: true,
Description: descriptions["replicas"],
DeprecationMessage: "replicas is deprecated and will be removed after February 2027. Use instead `flavor_id` and choose a flavor with your wanted replica configuration. You can list available flavors using the datasource `stackit_postgresflex_flavors`.",
Optional: true,
Computed: true,
Validators: []validator.Int32{
int32validator.OneOf(1, 3),
int32validator.AlsoRequires(path.Root("flavor").Expression()),
Expand Down
Loading