README

Organizational Units

Provisions and manages OUs up to 3 levels deep (root, child, grandchild) under the organization root. Fully configurable via the organizational_units variable. Depends on the governance/organization module for the root ID.

Usage

module "ou" {
  source  = "hcassc.jfrog.io/iac-terraform-modules-virtual/governance/ou/aws"
  version = "0.1.0"

  root_id = module.organization.roots[0].id

  organizational_units = {
    workloads = {
      name       = "Workloads"
      parent_key = "root"
    }
    workloads_prod = {
      name       = "Prod"
      parent_key = "workloads"
    }
    sandbox = {
      name       = "Sandbox"
      parent_key = "root"
    }
  }
}

Requirements

Name Version
terraform ~> 1.5
aws ~> 5.0

Providers

Name Version
aws 6.50.0

Resources

Name Type
aws_organizations_organizational_unit.child resource
aws_organizations_organizational_unit.grandchild resource
aws_organizations_organizational_unit.root resource

Inputs

Name Description Type Default Required
organizational_units Map of OU definitions. Each key is a logical name used internally.parent_key references another key in this map (or 'root' for top-level OUs). map(object({ name = string parent_key = string tags = optional(map(string), {}) })) n/a yes
root_id Organization root ID under which top-level OUs are created (e.g. r-xxxx) string n/a yes

Outputs

Name Description
all_ou_ids Merged map of all OU logical keys to IDs
child_ou_arns Map of logical key to child OU ARN
child_ou_ids Map of logical key to child OU ID
grandchild_ou_arns Map of logical key to grandchild OU ARN
grandchild_ou_ids Map of logical key to grandchild OU ID
root_ou_arns Map of logical key to root-level OU ARN
root_ou_ids Map of logical key to root-level OU ID