Is it possible to iterate principal -> identifiers in Data Source: aws_iam_policy_document
in Terraform: 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*",
...
]
resources = ["*"]
effect = "Allow"
principals {
type = "AWS"
NEED TO ITERATE WITH GIVEN "var.env_names" LIST -------> identifiers = ["arn:aws:iam::accountName:role/${var.env_name}-role"]
}
}
}