From 57f57ba6faf69fdbc0c14024a5f9c7e9a89da47b Mon Sep 17 00:00:00 2001 From: Ruben Aleman Date: Fri, 30 Jan 2026 08:51:49 +0100 Subject: [PATCH] chore(postgresflex): add more descriptions --- docs/resources/postgresflex_instance.md | 4 ++-- .../postgresflex/instance/resource.go | 22 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/docs/resources/postgresflex_instance.md b/docs/resources/postgresflex_instance.md index 46dfdbc35..12b4df8f1 100644 --- a/docs/resources/postgresflex_instance.md +++ b/docs/resources/postgresflex_instance.md @@ -43,11 +43,11 @@ import { ### Required - `acl` (List of String) The Access Control List (ACL) for the PostgresFlex instance. -- `backup_schedule` (String) +- `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 * * *'. - `flavor` (Attributes) (see [below for nested schema](#nestedatt--flavor)) - `name` (String) Instance name. - `project_id` (String) STACKIT project ID to which the instance is associated. -- `replicas` (Number) +- `replicas` (Number) How many replicas the instance should have. Valid values are 1 for single mode or 3 for replication. - `storage` (Attributes) (see [below for nested schema](#nestedatt--storage)) - `version` (String) diff --git a/stackit/internal/services/postgresflex/instance/resource.go b/stackit/internal/services/postgresflex/instance/resource.go index df1f1093c..e8dc66827 100644 --- a/stackit/internal/services/postgresflex/instance/resource.go +++ b/stackit/internal/services/postgresflex/instance/resource.go @@ -147,13 +147,15 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure // Schema defines the schema for the resource. func (r *instanceResource) Schema(_ context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { descriptions := map[string]string{ - "main": "Postgres Flex instance resource schema. Must have a `region` specified in the provider configuration.", - "id": "Terraform's internal resource ID. It is structured as \"`project_id`,`region`,`instance_id`\".", - "instance_id": "ID of the PostgresFlex instance.", - "project_id": "STACKIT project ID to which the instance is associated.", - "name": "Instance name.", - "acl": "The Access Control List (ACL) for the PostgresFlex instance.", - "region": "The resource region. If not defined, the provider region is used.", + "main": "Postgres Flex instance resource schema. Must have a `region` specified in the provider configuration.", + "id": "Terraform's internal resource ID. It is structured as \"`project_id`,`region`,`instance_id`\".", + "instance_id": "ID of the PostgresFlex instance.", + "project_id": "STACKIT project ID to which the instance is associated.", + "name": "Instance name.", + "acl": "The Access Control List (ACL) for the PostgresFlex instance.", + "region": "The resource region. If not defined, the provider region is used.", + "backup_schedule": "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 * * *'.", + "replicas": "How many replicas the instance should have. Valid values are 1 for single mode or 3 for replication.", } resp.Schema = schema.Schema{ @@ -206,7 +208,8 @@ func (r *instanceResource) Schema(_ context.Context, req resource.SchemaRequest, Required: true, }, "backup_schedule": schema.StringAttribute{ - Required: true, + Description: descriptions["backup_schedule"], + Required: true, }, "flavor": schema.SingleNestedAttribute{ Required: true, @@ -232,7 +235,8 @@ func (r *instanceResource) Schema(_ context.Context, req resource.SchemaRequest, }, }, "replicas": schema.Int64Attribute{ - Required: true, + Description: descriptions["replicas"], + Required: true, }, "storage": schema.SingleNestedAttribute{ Required: true,