-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
resource/cloudfront_distribution: re-introduce changes from #10013 to update active_trusted_signers attribute #14339
Conversation
…tribute for Terraform 0.12 Reference: #8902 This attribute implemented a legacy Terraform library (`flatmap`), which does not work with Terraform 0.12's data types and whose only usage was on this single attribute. This was missed during the Terraform 0.12 upgrade since there were no covering acceptance tests and the CloudFront setup itself is fairly esoteric (requires root AWS account login to manage CloudFront Keys). The attribute now correctly implements (in the closest approximation) the standard Terraform Provider SDK types and methodology for saved nested object data to the Terraform state. The `items` subattribute list is now accessible again in Terraform 0.12. It does, however, unavoidably switch the root `active_trusted_signers` attribute to `TypeList` instead of `TypeMap` (which does not support map elements of different types in the current Terraform Provider SDK), so any potential references to nested attributes will need to be changed in user configurations, e.g. Previously: ``` aws_cloudfront_distribution.example.active_trusted_signers.enabled ``` Now: ``` aws_cloudfront_distribution.example.active_trusted_signers.0.enabled ``` Output from acceptance testing: ``` --- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_TrustedSigners (611.33s) ``` (cherry picked from commit ebdc976)
…fixes (cherry picked from commit cad90e6)
…ctive_trusted_signers", ...) error Output from acceptance testing: ``` --- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_TrustedSigners ``` (cherry picked from commit 1c2b6f4)
Does Terraform 0.12 not have the state reading issue after upgrade? We originally pulled this out (#10093) because it appeared to require a state migration due the SDK difference handlers, even for configurations not using the actual attribute. An easier option to state migration (especially because the schema is huge for this resource), would be to remove the broken attribute and introduce a new one. |
Ready for re-review with re-named sub-field Output of tests:
|
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.
Thanks for the update, @anGie44. I think this is on the right track -- just need to adjust the top level attribute name so core/SDK ignores the existing attribute state or deal with an awful state migration.
4faef14
to
d452680
Compare
…form-providers/terraform-provider-aws into td-cloudfront-distribution-flatmap
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.
Minor documentation suggestions, otherwise looks good to me once the acceptance testing passes. 👍
Output of acceptance tests:
|
This has been released in version 3.0.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Closes #8902
Release note for CHANGELOG:
Output from acceptance testing: