Skip to content
Open
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 @@ -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)

Expand Down
22 changes: 13 additions & 9 deletions stackit/internal/services/postgresflex/instance/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down