-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
data_source/aws_iam_policy_document: Make statement optional #6052
Conversation
fc32bf7
to
0edfa60
Compare
0edfa60
to
56f79a3
Compare
With this PR, the following is possible: data "aws_iam_policy_document" "source" {
statement {
sid = "OverridePlaceholder"
actions = ["ec2:DescribeAccountAttributes"]
resources = ["*"]
}
}
data "aws_iam_policy_document" "override" {
statement {
sid = "OverridePlaceholder"
actions = ["s3:GetObject"]
resources = ["*"]
}
}
data "aws_iam_policy_document" "yak_politik" {
source_json = "${data.aws_iam_policy_document.source.json}"
override_json = "${data.aws_iam_policy_document.override.json}"
} The data source {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "OverridePlaceholder",
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "*"
}
]
} |
This is definitely helpful for #5047! |
@tvald Thanks for the input! I'm not currently working on part 2 of #5047 but wanted to get your thoughts on the design approach to part 2: a new data source (perhaps |
Replied back in #5047 to keep the broader discussion in one place. |
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.
This looks great and its very awesome to enhance policy layering -- thanks so much, @YakDriver! 🚀
--- PASS: TestAccAWSDataSourceIAMPolicyDocument_override (4.10s)
--- PASS: TestAccAWSDataSourceIAMPolicyDocument_sourceConflicting (4.15s)
--- PASS: TestAccAWSDataSourceIAMPolicyDocument_noStatementOverride (4.20s)
--- PASS: TestAccAWSDataSourceIAMPolicyDocument_noStatementMerge (4.44s)
--- PASS: TestAccAWSDataSourceIAMPolicyDocument_basic (4.56s)
--- PASS: TestAccAWSDataSourceIAMPolicyDocument_source (5.95s)
Nice! 👍 |
This has been released in version 1.40.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
Fixes part 1 of #5047
Changes proposed in this pull request:
statement
optionaldata_source/aws_iam_policy_document
to Go conventionOutput from acceptance testing: