-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose Route53 zone nameservers for parent zone NS record #1525
Changes from 2 commits
8f1acaf
a4e4ffb
eb43822
b763294
46d3ab5
f8b05fa
c3f9c12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,12 @@ func resourceAwsRoute53Zone() *schema.Resource { | |
Computed: true, | ||
}, | ||
|
||
"delegation_set_name_servers": &schema.Schema{ | ||
Type: schema.TypeList, | ||
Elem: &schema.Schema{Type: schema.TypeString}, | ||
Computed: true, | ||
}, | ||
|
||
"tags": tagsSchema(), | ||
}, | ||
} | ||
|
@@ -80,7 +86,7 @@ func resourceAwsRoute53ZoneCreate(d *schema.ResourceData, meta interface{}) erro | |
|
||
func resourceAwsRoute53ZoneRead(d *schema.ResourceData, meta interface{}) error { | ||
r53 := meta.(*AWSClient).r53conn | ||
_, err := r53.GetHostedZone(&route53.GetHostedZoneRequest{ID: aws.String(d.Id())}) | ||
zone, err := r53.GetHostedZone(&route53.GetHostedZoneRequest{ID: aws.String(d.Id())}) | ||
if err != nil { | ||
// Handle a deleted zone | ||
if r53err, ok := err.(aws.APIError); ok && r53err.Code == "NoSuchHostedZone" { | ||
|
@@ -90,6 +96,8 @@ func resourceAwsRoute53ZoneRead(d *schema.ResourceData, meta interface{}) error | |
return err | ||
} | ||
|
||
d.Set("delegation_set_name_servers", zone.DelegationSet.NameServers) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
or similar, like in https://github.com/hashicorp/terraform/blob/master/builtin/providers/aws/resource_aws_route53_record.go#L199 |
||
|
||
// get tags | ||
req := &route53.ListTagsForResourceRequest{ | ||
ResourceID: aws.String(d.Id()), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would just
nameservers
be a bad choice here? Not required for changing, just curious on your thoughts 😄There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally had it as
nameservers
, but decided it might be better just to be clear where it's actually coming from in the AWS API.