Hello team ,
Im pretty new to terraform and I’m trying to implement aws service control policies using module. Could you pls guide me in how to create module for implementing scp using below resources ?
data "aws_iam_policy_document" "example" {
statement {
effect = "Allow"
actions = ["*"]
resources = ["*"]
}
}
resource "aws_organizations_policy" "example" {
name = "example"
content = data.aws_iam_policy_document.example.json
}
resource "aws_organizations_policy_attachment" "account" {
policy_id = "${aws_organizations_policy.example.id}"
target_id = "123456789012"
}
Kindly guide me in how can I implement custom scp module using for_each