-
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
Conversation
👍 lgtm |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
d.Set
can return an error, can you check to make sure it's nil
? We've seen bugs go by silently by not checking for errors when setting a non-primitive type.
if err := d.Set("delegation_set_name_servers", zone.DelegationSet.NameServers); err != nil{
or similar, like in https://github.com/hashicorp/terraform/blob/master/builtin/providers/aws/resource_aws_route53_record.go#L199
@@ -90,6 +97,11 @@ func resourceAwsRoute53ZoneRead(d *schema.ResourceData, meta interface{}) error | |||
return err | |||
} | |||
|
|||
ns := zone.DelegationSet.NameServers |
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.
We should sort this. Or, use a set.
I just closed #1525 |
All changes have been made. cc @catsby @mitchellh @pmoust
|
hold off on this. there's one more change i think i need to make. |
The problem I'm running into is dealing with the computed attribute. I want to modify another record with the name servers (basically an NS record on the "parent" zone). But I can't for the life of me figure out how to get it to resolve right. So I have this configuration (simplified a bit):
I've also tried it with just an echo in a null_resource like:
But I keep getting: I then tried to see if I gave the name_servers more structure if they'd work. I changed the schema to: "name_servers": &schema.Schema{
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Type: schema.TypeString,
},
},
},
Set: func(v interface{}) int {
m := v.(map[string]interface{})
return hashcode.String(m["name"].(string))
},
}, and set the resource data correctly with map's instead. I then changed the configuration to:
Still no dice: Any ideas on how I can make this work? |
…3-zone-nameservers
LGTM. @rubbish That's not currently possible, though I think this should work: |
providers/aws: Expose Route53 zone nameservers for parent zone NS record
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
No description provided.