Skip to content

Commit 4f3c912

Browse files
modular-magicianEdward Sun
and
Edward Sun
authored
add validation.StringIsNotEmpty (#6753) (#12948)
Co-authored-by: Edward Sun <[email protected]> Signed-off-by: Modular Magician <[email protected]> Signed-off-by: Modular Magician <[email protected]> Co-authored-by: Edward Sun <[email protected]>
1 parent fc97fc0 commit 4f3c912

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.changelog/6753.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
dns: fixed apply failure when `description` is set to empty string on `google_dns_managed_zone`
3+
```

google/resource_dns_managed_zone.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"time"
2424

2525
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
26+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
2627
"google.golang.org/api/dns/v1"
2728
)
2829

@@ -74,10 +75,11 @@ Must be unique within the project.`,
7475
},
7576
},
7677
"description": {
77-
Type: schema.TypeString,
78-
Optional: true,
79-
Description: `A textual description field. Defaults to 'Managed by Terraform'.`,
80-
Default: "Managed by Terraform",
78+
Type: schema.TypeString,
79+
Optional: true,
80+
ValidateFunc: validation.StringIsNotEmpty,
81+
Description: `A textual description field. Defaults to 'Managed by Terraform'.`,
82+
Default: "Managed by Terraform",
8183
},
8284
"dnssec_config": {
8385
Type: schema.TypeList,

0 commit comments

Comments
 (0)