Skip to content
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

provider/aws: Fix issue in updating Route 53 records on refresh/read. #1430

Merged
merged 3 commits into from
Apr 9, 2015

Conversation

catsby
Copy link
Contributor

@catsby catsby commented Apr 8, 2015

Route 53 records were silently erroring out when saving the records returned
from AWS, because they weren't being presented as an array of strings like we
expected.

This PR Introduces flattenResourceRecords to structure.go, used to flatten []route53.ResourceRecord into an array of strings and correctly update the local state of records. We also no longer silently ignore this error.

This basically fixes #1413, in such that the local state is updated, and subsequent applying of destroy will actually destroy the record.

Route 53 records were silently erroring out when saving the records returned
from AWS, because they weren't being presented as an array of strings like we
expected.
d.Set("records", record.ResourceRecords)
err := d.Set("records", flattenResourceRecords(record.ResourceRecords))
if err != nil {
log.Printf("[DEBUG] Error setting records for: %s, error: %#v", en, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we return this error instead of just logging it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally wasn't sure on what to do there. I'm cool with bubbling up the error

@catsby
Copy link
Contributor Author

catsby commented Apr 8, 2015

I've broken an acceptance test with TXT records here, fixing...

@catsby
Copy link
Contributor Author

catsby commented Apr 8, 2015

Updated to fix regression with TXT records. @phinze take a gander when you get a minute

@mitchellh
Copy link
Contributor

Route53 API still sad, but LGTM

@phinze
Copy link
Contributor

phinze commented Apr 9, 2015

👍

catsby added a commit that referenced this pull request Apr 9, 2015
provider/aws: Fix issue in updating Route 53 records on refresh/read.
@catsby catsby merged commit 02c81c4 into master Apr 9, 2015
@catsby catsby deleted the b-aws-route53-record-update branch April 9, 2015 16:54
@ghost
Copy link

ghost commented May 3, 2020

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.

@ghost ghost locked and limited conversation to collaborators May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamically updated Route53 records are not destroyed
3 participants