Allow aws_iam_policy_document to merge on a per statement level #11942
Labels
enhancement
Requests to existing resources that expand the functionality or scope.
service/iam
Issues and PRs that pertain to the iam service.
Milestone
Community Note
Description
aws_iam_policy_document
allows you to combine policies with thesource_json
attribute and to replace statements with theoveride_json
attribute. One feature that could really open up the possibilities is the ability to merge together two statements with the samesid
. This would allow you to create a "template"aws_iam_policy_document
and then re-use that over and over again to create your IAM policies. A simple example is included below.New or Affected Resource(s)
Potential Terraform Configuration
The resulting json would have a
CloudWatch
statement that was the combination ofCloudWatch
statements from theaws_iam_policy_document.cloudwatch_logs
andaws_iam_policy_document.create_identity
. This would allow you to reuseaws_iam_policy_document.cloudwatch_logs
for any resource that needed access to create Cloudwatch logs.This is just a simple example, a more complex example would make better use of this new functionality.
References
The text was updated successfully, but these errors were encountered: