Skip to content

Instantly share code, notes, and snippets.

@sunckell
Created August 11, 2020 12:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunckell/a9aec49f07fe3d606379c3886ef9455e to your computer and use it in GitHub Desktop.
Save sunckell/a9aec49f07fe3d606379c3886ef9455e to your computer and use it in GitHub Desktop.
dynamic "statement" {
for_each = [for s in var.additional_bucket_policy_statements : {
sid = lookup(s, "sid", null)
effect = lookup(s, "effect", null)
actions = lookup(s, "actions", null)
resources = lookup(s, "resources", null)
principals = lookup(s, "principals", null)
condition = lookup(s, "condition", null)
}]
content {
sid = statement.value.sid
effect = statement.value.effect
actions = statement.value.actions
resources = statement.value.resources
dynamic "principals" {
for_each = statement.value.principals
content {
type = lookup(principals.value, "type", null)
identifiers = lookup(principals.value, "identifiers", null)
}
}
dynamic "condition" {
for_each = statement.value.condition
content {
test = lookup(condition.value, "test", null)
variable = lookup(condition.value, "variable", null)
values = lookup(condition.value, "values", null)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment