From a58236e56a4ba861cd5dd10ed4e09ed774f44a0e Mon Sep 17 00:00:00 2001 From: Melanija Cvetic Date: Tue, 22 Oct 2024 15:59:49 +0100 Subject: [PATCH] Changing type of tags in schema --- .../service/flexcluster/data_source_schema.go | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/internal/service/flexcluster/data_source_schema.go b/internal/service/flexcluster/data_source_schema.go index d305322c3e..50d8741eec 100644 --- a/internal/service/flexcluster/data_source_schema.go +++ b/internal/service/flexcluster/data_source_schema.go @@ -4,6 +4,7 @@ import ( "context" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" ) func DataSourceSchema(ctx context.Context) schema.Schema { @@ -46,6 +47,11 @@ func dataSourceSchema(isPlural bool) map[string]schema.Attribute { Computed: true, MarkdownDescription: "Group of cloud provider settings that configure the provisioned MongoDB flex cluster.", }, + "tags": schema.MapAttribute{ + ElementType: types.StringType, + Computed: true, + MarkdownDescription: "Map that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the instance.", + }, "backup_settings": schema.SingleNestedAttribute{ Attributes: map[string]schema.Attribute{ "enabled": schema.BoolAttribute{ @@ -90,22 +96,6 @@ func dataSourceSchema(isPlural bool) map[string]schema.Attribute { Computed: true, MarkdownDescription: "Human-readable label that indicates the current operating condition of this instance.", }, - "tags": schema.ListNestedAttribute{ - NestedObject: schema.NestedAttributeObject{ - Attributes: map[string]schema.Attribute{ - "key": schema.StringAttribute{ - Computed: true, - MarkdownDescription: "Constant that defines the set of the tag. For example, `environment` in the `environment : production` tag.", - }, - "value": schema.StringAttribute{ - Computed: true, - MarkdownDescription: "Variable that belongs to the set of the tag. For example, `production` in the `environment : production` tag.", - }, - }, - }, - Computed: true, - MarkdownDescription: "List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the instance.", - }, "termination_protection_enabled": schema.BoolAttribute{ Computed: true, MarkdownDescription: "Flag that indicates whether termination protection is enabled on the cluster. If set to `true`, MongoDB Cloud won't delete the cluster. If set to `false`, MongoDB Cloud will delete the cluster.",