-
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
provider/aws: Fix issue in updating Route 53 records on refresh/read. #1430
Conversation
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) |
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.
Should we return this error instead of just logging it?
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.
Totally wasn't sure on what to do there. I'm cool with bubbling up the error
I've broken an acceptance test with TXT records here, fixing... |
Updated to fix regression with TXT records. @phinze take a gander when you get a minute |
Route53 API still sad, but LGTM |
👍 |
provider/aws: Fix issue in updating Route 53 records on refresh/read.
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. |
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
tostructure.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.