-
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
better AWS policy layering #5047
Comments
I'd like to see this. |
This would be a very useful feature for my org. I'd like to start supplying a centralized repository of IAM Policy documents for other teams to consume. |
@tvald @skang0601 @lorengordon Have a look at PR #6052 to see if this will help with the overall solution. |
@YakDriver commented in #6052:
Sure, the approach sounds fine to me and solves this issue. |
I'm not sure if we need to create a separate data source just for accepting lists of sources/overrides -- adding new I mention attributes plurally because it enables this scenario if something like
|
Sure, that approach also solves this issue. I have no preference between a new data source or a new attribute. The slightly different semantics of |
any updates on this? |
Just bumping this issue, as the associated PR seems to have gone stale for some reason. It still seems very useful, and has seen other interest (besides myself) in the last few hours, despite being almost a year old: #12055 (comment). |
We have merged #12055 in to the Terraform AWS Provider. With this, |
This has been released in version 3.28.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
Description
#2890 resolved #2672 with a
source_json
andoverride_json
field which enables layering of AWS policies. We leverage this mechanism to merge S3 bucket policies from a library of policies, since a bucket can only have one policy (cf #409).Unfortunately, only two policies can be combined at a time (one each as
source_json
andoverride_json
), leading to multi-step merges with temporary intermediate policies. You also have to know the name of a statement in theoverride_json
policy in order to insert a dummystatement
field, since thestatement
field is required even if you're combining other policies.I propose:
statement
field optionalsource_json
andoverride_json
to accept arrays, where priority for duplicate statements is given to later elements in the arrayThis makes it easy to merge any number of policies.
Affected Resource
Potential Terraform Configuration
Current:
Proposed:
References
The text was updated successfully, but these errors were encountered: