This template retrieves and lists all service control policies for the root of an AWS Organizations structure.

Terraform Template

data "aws_organizations_organization" "example" {
}

data "aws_organizations_policies_for_target" "example" {
  filter = "SERVICE_CONTROL_POLICY"
  target_id = "data.aws_organizations_organization.example.roots[0].id"
}

data "aws_organizations_policy" "example" {
  for_each = toset(data.aws_organizations_policies_for_target.example.ids)
  policy_id = each.value
}