Skip to content

Commit

Permalink
resource/aws_route53_zone: Add length validations for `delegation_set…
Browse files Browse the repository at this point in the history
…_id` and `name` arguments (#12340)

Output from acceptance testing:

```
--- PASS: TestAccAWSRoute53Zone_basic (68.77s)
--- PASS: TestAccAWSRoute53Zone_Comment (81.81s)
--- PASS: TestAccAWSRoute53Zone_DelegationSetID (70.15s)
--- PASS: TestAccAWSRoute53Zone_disappears (60.90s)
--- PASS: TestAccAWSRoute53Zone_ForceDestroy (189.58s)
--- PASS: TestAccAWSRoute53Zone_ForceDestroy_TrailingPeriod (189.64s)
--- PASS: TestAccAWSRoute53Zone_multiple (68.79s)
--- PASS: TestAccAWSRoute53Zone_Tags (114.64s)
--- PASS: TestAccAWSRoute53Zone_VPC_Multiple (182.20s)
--- PASS: TestAccAWSRoute53Zone_VPC_Single (111.32s)
--- PASS: TestAccAWSRoute53Zone_VPC_Updates (233.79s)

--- PASS: TestAccAWSRoute53ZoneDataSource_id (79.59s)
--- PASS: TestAccAWSRoute53ZoneDataSource_name (70.23s)
--- PASS: TestAccAWSRoute53ZoneDataSource_serviceDiscovery (124.80s)
--- PASS: TestAccAWSRoute53ZoneDataSource_tags (119.05s)
--- PASS: TestAccAWSRoute53ZoneDataSource_vpc (133.88s)
```
  • Loading branch information
FrancisLfg authored Jan 6, 2021
1 parent f96188d commit 948f5e1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions aws/resource_aws_route53_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ func resourceAwsRoute53Zone() *schema.Resource {
// returned from API, no longer requiring custom DiffSuppressFunc;
// instead a StateFunc allows input to be provided
// with or without the trailing period
Type: schema.TypeString,
Required: true,
ForceNew: true,
StateFunc: trimTrailingPeriod,
Type: schema.TypeString,
Required: true,
ForceNew: true,
StateFunc: trimTrailingPeriod,
ValidateFunc: validation.StringLenBetween(1, 1024),
},

"comment": {
Expand Down Expand Up @@ -77,6 +78,7 @@ func resourceAwsRoute53Zone() *schema.Resource {
Optional: true,
ForceNew: true,
ConflictsWith: []string{"vpc"},
ValidateFunc: validation.StringLenBetween(0, 32),
},

"name_servers": {
Expand Down

0 comments on commit 948f5e1

Please sign in to comment.