Add documentation and changelog for route53_zone_association
This commit is contained in:
parent
766aead4a5
commit
b784908491
|
@ -9,6 +9,7 @@ IMPROVEMENTS:
|
|||
|
||||
* **New config function: `formatlist`** - Format lists in a similar way to `format`.
|
||||
Useful for creating URLs from a list of IPs. [GH-1829]
|
||||
* **New resource: `aws_route53_zone_association`**
|
||||
* provider/aws: `aws_autoscaling_group` can wait for capacity in ELB
|
||||
via `min_elb_capacity` [GH-1970]
|
||||
* provider/aws: `aws_db_instances` supports `license_model` [GH-1966]
|
||||
|
|
|
@ -121,7 +121,7 @@ func resourceAwsRoute53ZoneRead(d *schema.ResourceData, meta interface{}) error
|
|||
return err
|
||||
}
|
||||
|
||||
if ! *zone.HostedZone.Config.PrivateZone {
|
||||
if !*zone.HostedZone.Config.PrivateZone {
|
||||
ns := make([]string, len(zone.DelegationSet.NameServers))
|
||||
for i := range zone.DelegationSet.NameServers {
|
||||
ns[i] = *zone.DelegationSet.NameServers[i]
|
||||
|
@ -131,10 +131,10 @@ func resourceAwsRoute53ZoneRead(d *schema.ResourceData, meta interface{}) error
|
|||
return fmt.Errorf("[DEBUG] Error setting name servers for: %s, error: %#v", d.Id(), err)
|
||||
}
|
||||
} else {
|
||||
d.Set("name_servers", nil);
|
||||
d.Set("name_servers", nil)
|
||||
var associatedVPC *route53.VPC
|
||||
for _, vpc := range zone.VPCs {
|
||||
if (*vpc.VPCID == d.Get("vpc_id")) {
|
||||
if *vpc.VPCID == d.Get("vpc_id") {
|
||||
associatedVPC = vpc
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,6 @@ func resourceAwsRoute53ZoneAssociation() *schema.Resource {
|
|||
Optional: true,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,9 +45,9 @@ func TestAccRoute53ZoneAssociationWithRegion(t *testing.T) {
|
|||
}
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
ProviderFactories: providerFactories,
|
||||
CheckDestroy: testAccCheckRoute53ZoneAssociationDestroyWithProviders(&providers),
|
||||
CheckDestroy: testAccCheckRoute53ZoneAssociationDestroyWithProviders(&providers),
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: testAccRoute53ZoneAssociationRegionConfig,
|
||||
|
|
|
@ -119,9 +119,9 @@ func TestAccRoute53PrivateZoneWithRegion(t *testing.T) {
|
|||
}
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
ProviderFactories: providerFactories,
|
||||
CheckDestroy: testAccCheckRoute53ZoneDestroyWithProviders(&providers),
|
||||
CheckDestroy: testAccCheckRoute53ZoneDestroyWithProviders(&providers),
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: testAccRoute53PrivateZoneRegionConfig,
|
||||
|
@ -203,7 +203,7 @@ func testAccCheckRoute53ZoneExistsWithProvider(s *terraform.State, n string, zon
|
|||
return fmt.Errorf("Hosted zone err: %v", err)
|
||||
}
|
||||
|
||||
if ! *resp.HostedZone.Config.PrivateZone {
|
||||
if !*resp.HostedZone.Config.PrivateZone {
|
||||
sorted_ns := make([]string, len(resp.DelegationSet.NameServers))
|
||||
for i, ns := range resp.DelegationSet.NameServers {
|
||||
sorted_ns[i] = *ns
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
---
|
||||
layout: "aws"
|
||||
page_title: "AWS: aws_route53_zone_association"
|
||||
sidebar_current: "docs-aws-resource-route53-zone-association"
|
||||
description: |-
|
||||
Provides a Route53 private Hosted Zone to VPC association resource.
|
||||
---
|
||||
|
||||
# aws\_route53\_zone\_association
|
||||
|
||||
Provides a Route53 private Hosted Zone to VPC association resource.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
resource "aws_vpc" "primary" {
|
||||
cidr_block = "10.6.0.0/16"
|
||||
enable_dns_hostnames = true
|
||||
enable_dns_support = true
|
||||
}
|
||||
|
||||
resource "aws_vpc" "secondary" {
|
||||
cidr_block = "10.7.0.0/16"
|
||||
enable_dns_hostnames = true
|
||||
enable_dns_support = true
|
||||
}
|
||||
|
||||
resource "aws_route53_zone" "example" {
|
||||
name = "example.com"
|
||||
vpc_id = "${aws_vpc.primary.id}"
|
||||
}
|
||||
|
||||
resource "aws_route53_zone_assocation" "secondary" {
|
||||
zone_id = "${aws_route53_zone.example.id}"
|
||||
vpc_id = "${aws_vpc.secondary.id}"
|
||||
}
|
||||
```
|
||||
|
||||
## Argument Reference
|
||||
|
||||
The following arguments are supported:
|
||||
|
||||
* `zone_id` - (Required) The private hosted zone to associate.
|
||||
* `vpc_id` - (Required) The VPC to associate with the private hosted zone.
|
||||
* `vpc_region` - (Optional) The VPC's region. Defaults to the region of the AWS provider.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
|
||||
* `id` - The calculated unique identifier for the association.
|
||||
* `zone_id` - The ID of the hosted zone for the association.
|
||||
* `vpc_id` - The ID of the VPC for the association.
|
||||
* `vpc_region` - The region in which the VPC identified by `vpc_id` was created.
|
Loading…
Reference in New Issue