From f0890f9ddf297e552129982c9031d6eecaabc36a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Palet?= Date: Mon, 4 Mar 2024 15:55:07 +0000 Subject: [PATCH] Add description for MongoDB Flex instance backup_schedule field (#282) --- docs/data-sources/mongodbflex_instance.md | 4 ++-- docs/index.md | 2 +- docs/resources/mongodbflex_instance.md | 2 +- .../mongodbflex/instance/datasource.go | 20 +++++++++++-------- .../services/mongodbflex/instance/resource.go | 3 ++- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/docs/data-sources/mongodbflex_instance.md b/docs/data-sources/mongodbflex_instance.md index 48aec906..6035684f 100644 --- a/docs/data-sources/mongodbflex_instance.md +++ b/docs/data-sources/mongodbflex_instance.md @@ -31,11 +31,11 @@ data "stackit_mongodbflex_instance" "example" { ### Read-Only - `acl` (List of String) The Access Control List (ACL) for the MongoDB Flex instance. -- `backup_schedule` (String) +- `backup_schedule` (String) The backup schedule. Should follow the cron scheduling system format (e.g. "0 0 * * *"). - `flavor` (Attributes) (see [below for nested schema](#nestedatt--flavor)) - `id` (String) Terraform's internal data source. ID. It is structured as "`project_id`,`instance_id`". - `name` (String) Instance name. -- `options` (Attributes) (see [below for nested schema](#nestedatt--options)) +- `options` (Attributes) Custom parameters for the MongoDB Flex instance. (see [below for nested schema](#nestedatt--options)) - `replicas` (Number) - `storage` (Attributes) (see [below for nested schema](#nestedatt--storage)) - `version` (String) diff --git a/docs/index.md b/docs/index.md index 51208252..488d6acb 100644 --- a/docs/index.md +++ b/docs/index.md @@ -143,7 +143,7 @@ Note: AWS specific checks must be skipped as they do not work on STACKIT. For de - `argus_custom_endpoint` (String) Custom endpoint for the Argus service - `credentials_path` (String) Path of JSON from where the credentials are read. Takes precedence over the env var `STACKIT_CREDENTIALS_PATH`. Default value is `~/.stackit/credentials.json`. - `dns_custom_endpoint` (String) Custom endpoint for the DNS service -- `jwks_custom_endpoint` (String) Custom endpoint for the jwks API, which is used to get the json web key sets (jwks) to validate tokens when using the key flow +- `jwks_custom_endpoint` (String, Deprecated) Custom endpoint for the jwks API, which is used to get the json web key sets (jwks) to validate tokens when using the key flow - `loadbalancer_custom_endpoint` (String) Custom endpoint for the Load Balancer service - `logme_custom_endpoint` (String) Custom endpoint for the LogMe service - `mariadb_custom_endpoint` (String) Custom endpoint for the MariaDB service diff --git a/docs/resources/mongodbflex_instance.md b/docs/resources/mongodbflex_instance.md index 75aa2950..0c7438ae 100644 --- a/docs/resources/mongodbflex_instance.md +++ b/docs/resources/mongodbflex_instance.md @@ -40,7 +40,7 @@ resource "stackit_mongodbflex_instance" "example" { ### Required - `acl` (List of String) The Access Control List (ACL) for the MongoDB Flex instance. -- `backup_schedule` (String) +- `backup_schedule` (String) The backup schedule. Should follow the cron scheduling system format (e.g. "0 0 * * *"). - `flavor` (Attributes) (see [below for nested schema](#nestedatt--flavor)) - `name` (String) Instance name. - `options` (Attributes) (see [below for nested schema](#nestedatt--options)) diff --git a/stackit/internal/services/mongodbflex/instance/datasource.go b/stackit/internal/services/mongodbflex/instance/datasource.go index f4efe9ec..65bcff8e 100644 --- a/stackit/internal/services/mongodbflex/instance/datasource.go +++ b/stackit/internal/services/mongodbflex/instance/datasource.go @@ -76,12 +76,14 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi // Schema defines the schema for the data source. func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { descriptions := map[string]string{ - "main": "MongoDB Flex instance data source schema. Must have a `region` specified in the provider configuration.", - "id": "Terraform's internal data source. ID. It is structured as \"`project_id`,`instance_id`\".", - "instance_id": "ID of the MongoDB Flex instance.", - "project_id": "STACKIT project ID to which the instance is associated.", - "name": "Instance name.", - "acl": "The Access Control List (ACL) for the MongoDB Flex instance.", + "main": "MongoDB Flex instance data source schema. Must have a `region` specified in the provider configuration.", + "id": "Terraform's internal data source. ID. It is structured as \"`project_id`,`instance_id`\".", + "instance_id": "ID of the MongoDB Flex instance.", + "project_id": "STACKIT project ID to which the instance is associated.", + "name": "Instance name.", + "acl": "The Access Control List (ACL) for the MongoDB Flex instance.", + "backup_schedule": `The backup schedule. Should follow the cron scheduling system format (e.g. "0 0 * * *").`, + "options": "Custom parameters for the MongoDB Flex instance.", } resp.Schema = schema.Schema{ @@ -117,7 +119,8 @@ func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaReques Computed: true, }, "backup_schedule": schema.StringAttribute{ - Computed: true, + Description: descriptions["backup_schedule"], + Computed: true, }, "flavor": schema.SingleNestedAttribute{ Computed: true, @@ -154,7 +157,8 @@ func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaReques Computed: true, }, "options": schema.SingleNestedAttribute{ - Computed: true, + Description: descriptions["options"], + Computed: true, Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ Computed: true, diff --git a/stackit/internal/services/mongodbflex/instance/resource.go b/stackit/internal/services/mongodbflex/instance/resource.go index 017a4a92..6eacbe43 100644 --- a/stackit/internal/services/mongodbflex/instance/resource.go +++ b/stackit/internal/services/mongodbflex/instance/resource.go @@ -204,7 +204,8 @@ func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, r Required: true, }, "backup_schedule": schema.StringAttribute{ - Required: true, + Description: descriptions["backup_schedule"], + Required: true, }, "flavor": schema.SingleNestedAttribute{ Required: true,