-
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: CloudFront post-merge review updates #6196
provider/aws: CloudFront post-merge review updates #6196
Conversation
@@ -940,3 +974,28 @@ func flattenActiveTrustedSigners(ats *cloudfront.ActiveTrustedSigners) flatmap.M | |||
m["items"] = s | |||
return flatmap.Flatten(m) | |||
} | |||
|
|||
// fullOK does a proper type-switch on an interface value and returns true | |||
// if the underlying type contains a zero value. float is ommitted as it is |
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.
and returns true if the underlying type contains a zero value
It looks like it's returning false
for default values
Looks good! One question on the |
Ah, looks like
--> if *dist.DistributionConfig.Enabled != false {
return fmt.Errorf("CloudFront distribution should be disabled")
} |
@catsby, checking and fixing now. I'll just remove |
Adding necessary type assertion to values on the viewer_certificate hash function to ensure that certain fields are indeed not zero string values, versus simply zero interface{} values (aka nil, as is such for a map[string]interface{}).
Handle errors better on calls to d.Set() in the aws_cloudfront_distribution, namely in flattenDistributionConfig(). Also caught a bug in the setting of the origin attribute, was incorrectly attempting to set origins.
Change a few d.Set() for primitives in aws_cloudfront_distribution and aws_cloudfront_origin_access_identity to use the pointer versus a dereference.
Ran each example thru terraform fmt to fix indentation.
To play better with Travis and not bloat the test account with disabled distributions. Disable-only functionality has been retained - one can enable it with the TF_TEST_CLOUDFRONT_RETAIN environment variable.
The call to resourceAwsCloudFrontDistributionWaitUntilDeployed() on deletion of CloudFront distributions was not trapping error messages, causing issues with waiter failure.
2739580
to
1a518d9
Compare
OK, all done. Also added a way to retain the disable-only functionality for tests via setting a Also, found one more bug while I was at it - the delete waiter was not trapping error messages properly, so I've fixed that now (looks like it's taking abnormally long to disable distributions today). |
Thanks! Looks good here and the acc tests are passing, gonna pull this in! |
Thanks @catsby! |
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. |
Hey guys,
Here are the updates to address the code review issues in #5221. Each commit has been pretty well annotated and each commit is kind of an issue in its own, but I can squash if need be.
The updates: