Hi there,
I try to attach multiple SCPs to a single target in my code. would like to know if I can use a nested loop in terraform for the following case?
count = “{var.org_type == "root" ? 1 : 0}"
count = " {length (var.policy_id)}”
Typical behavior should be asking for org type and read the policy id. However, it does not.
resource “aw_organizations_policy_attachment” “root” {
count = “{var.org_type == "root" ? 0:1 length (var.policy_id) }"
policy_id = "{element(var.policy_id, count.index)}”
target_id = “${var.target_id_root}”
}