From 16db4cf5b45551d1942b19b5b2dcb137bd9a01a6 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Fri, 4 Nov 2022 14:50:30 +0000 Subject: [PATCH] add validation.StringIsNotEmpty (#6753) Co-authored-by: Edward Sun Signed-off-by: Modular Magician --- .changelog/6753.txt | 3 +++ google/resource_dns_managed_zone.go | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changelog/6753.txt diff --git a/.changelog/6753.txt b/.changelog/6753.txt new file mode 100644 index 00000000000..a6b1d671994 --- /dev/null +++ b/.changelog/6753.txt @@ -0,0 +1,3 @@ +```release-note:bug +dns: fixed apply failure when `description` is set to empty string on `google_dns_managed_zone` +``` diff --git a/google/resource_dns_managed_zone.go b/google/resource_dns_managed_zone.go index 8c256710870..b1c52a02a9f 100644 --- a/google/resource_dns_managed_zone.go +++ b/google/resource_dns_managed_zone.go @@ -23,6 +23,7 @@ import ( "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "google.golang.org/api/dns/v1" ) @@ -74,10 +75,11 @@ Must be unique within the project.`, }, }, "description": { - Type: schema.TypeString, - Optional: true, - Description: `A textual description field. Defaults to 'Managed by Terraform'.`, - Default: "Managed by Terraform", + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringIsNotEmpty, + Description: `A textual description field. Defaults to 'Managed by Terraform'.`, + Default: "Managed by Terraform", }, "dnssec_config": { Type: schema.TypeList,