Skip to content

Commit

Permalink
add validation.StringIsNotEmpty (#6753) (#12948)
Browse files Browse the repository at this point in the history
Co-authored-by: Edward Sun <sunedward@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
Co-authored-by: Edward Sun <sunedward@google.com>
  • Loading branch information
modular-magician and Edward Sun committed Nov 4, 2022
1 parent fc97fc0 commit 4f3c912
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .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`
```
10 changes: 6 additions & 4 deletions google/resource_dns_managed_zone.go
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4f3c912

Please sign in to comment.