aws/route53_zone: Make delegation_set_id conflict w/ vpc_id (#7213)

- as per the API reference it is not possible to use delegation sets w/ private hosted zones
   - http://docs.aws.amazon.com/Route53/latest/APIReference/API-create-hosted-zone-private.html
   - http://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateHostedZone.html
 - if you specify both AWS returns confusing error "InvalidInput" with no further details so this should reduce potential confusions & improve UX
This commit is contained in:
Radek Simko 2016-06-17 12:35:49 +01:00 committed by GitHub
parent 27464fb3d1
commit 2cdb5a367e
2 changed files with 10 additions and 6 deletions

View File

@ -39,9 +39,10 @@ func resourceAwsRoute53Zone() *schema.Resource {
},
"vpc_id": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ConflictsWith: []string{"delegation_set_id"},
},
"vpc_region": &schema.Schema{
@ -57,9 +58,10 @@ func resourceAwsRoute53Zone() *schema.Resource {
},
"delegation_set_id": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ConflictsWith: []string{"vpc_id"},
},
"name_servers": &schema.Schema{

View File

@ -57,8 +57,10 @@ The following arguments are supported:
* `comment` - (Optional) A comment for the hosted zone. Defaults to 'Managed by Terraform'.
* `tags` - (Optional) A mapping of tags to assign to the zone.
* `vpc_id` - (Optional) The VPC to associate with a private hosted zone. Specifying `vpc_id` will create a private hosted zone.
Conflicts w/ `delegation_set_id` as delegation sets can only be used for public zones.
* `vpc_region` - (Optional) The VPC's region. Defaults to the region of the AWS provider.
* `delegation_set_id` - (Optional) The ID of the reusable delgation set whose NS records you want to assign to the hosted zone.
Conflicts w/ `vpc_id` as delegation sets can only be used for public zones.
## Attributes Reference