The for_each line is where I get the error "Expected the start of an expression, but found an invalid expression token." I want to create that action based on a boolean variable. I already created a dynamic stage which works fine, but this dynamic action doesn't work.
How can I dynamically create this action?
resource "aws_codepipeline" "codepipeline" {
stage {
name = "Build"
dynamic "action" {
for_each = local.DoGovCloud ? [<<EOT
name = "BuildInGovcloud"
...
}
EOT
]: []
}
}