-
Couldn't load subscription status.
- Fork 9.8k
Rework of aws_lambda_layer_version_permission resource. #44668
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
base: main
Are you sure you want to change the base?
Rework of aws_lambda_layer_version_permission resource. #44668
Conversation
|
✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible. |
Community GuidelinesThis comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀 Voting for Prioritization
Pull Request Authors
|
|
Hi guys, is this targeted against the correct branch? Cheers. |
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
No Changes
Description
Support for multiple
aws_lambda_layer_version_permissionresources attached to the same lambda layer version is currently non functional. Eachaws_lambda_layer_version_permissioncurrently assumes it is the only such resource and reads the first statement within the policy. This creates some very strange issues where you can create multiple permissions, but on the next state refresh each one will assume the attributes of the first statement created.I believe this is partly due to the very unique nature of the lambda layer permission endpoints. They are asymmetrical in their CRUD structure. This can be represented as follows:
In this PR, each permission resource still has its own state tracking of the overall policy and revision ID. This means these attributes can fall out of sync as sequential permissions are created until the next state refresh. This is not a new problem and was already present. I predict 4 options that I would like to put forward to reviewers:
policyattribute, the full policy looks to have always been intended to be present in the state of each individual permission.My initial inclination would be the first option, which this PR represents. I believe this provides the best balance of improved function, work overhead and breaking changes. I believe the only breaking change in this PR is the import identification for the permission resource.
Relations
Closes most of the issues hinted upon within #21917
References
Documented ideal capabilities with support of multiple permission resources: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_layer_version_permission
Output from Acceptance Testing