I’m constructing a dynamic block of conditions
as part of aws_iam_policy_document
as follows:
data "aws_iam_policy_document" "app" {
statement {
effect = "Allow"
actions = ["sts:AssumeRole"]
dynamic "principals" {
...
}
dynamic "condition" {
for_each = var.iam_conditions
iterator = "this"
content {
test = this.operator
variable = this.variable
values = this.values
}
}
}
}
However, I’m having a hard time passing in the variable iam_conditions
. list(map(string)
won’t work because values
is expected to be a list(string)
. Is it possible to specify the variable type as an or
of 2 types string || list(string)
?