'Is aws_iam_policy_document's principal -> identifiers iteration possible?
Is it possible to iterate principal -> identifiers in Data Source: aws_iam_policy_document?
Terraform version: v0.11.15
data "aws_iam_policy_document" "kms_cmk_policy_document" {
statement {
sid = "Allow access for Key Administrators"
actions = [
"kms:Create*",
"kms:Describe*",
"kms:Enable*",
"kms:List*",
"kms:Put*",
"kms:Update*",
"kms:Revoke*",
"kms:Disable*",
"kms:Get*",
"kms:Delete*",
"kms:TagResource",
"kms:UntagResource",
"kms:ScheduleKeyDeletion",
"kms:CancelKeyDeletion",
]
resources = ["*"]
effect = "Allow"
principals {
type = "AWS"
identifiers = ["arn:aws:iam::accountName:role/${var.env_name}-role"] <--- NEED TO ITERATE WITH GIVEN "var.env_names" LIST
}
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
