Skip to main content
Control Tower 0.7.10Last updated in version 0.7.6

Organizational Units Data Source

View Source Release Notes

This Terraform module provides a data source for Organizational Units. If the input variable discover_ous_recursively is set to true, this module will look for the specified organizational unit (OU) recursively under the root of the organization. If set to false, it will only look for the OU directly under the root.

The output ous returns a list of organizational units, which have the following attributes:

[
{
arn = "arn:aws:organizations::123456789012:ou/o-i1qwerty/ou-hr12-2qwerty"
id = "ou-hr12-2qwerty"
name = "Acme"
}
]

Sample Usage

main.tf

# ------------------------------------------------------------------------------------------------------
# DEPLOY GRUNTWORK'S ORGANIZATIONAL-UNITS MODULE
# ------------------------------------------------------------------------------------------------------

module "organizational_units" {

source = "git::git@github.com:gruntwork-io/terraform-aws-control-tower.git//modules/landingzone/organizational-units?ref=v0.7.10"

# ----------------------------------------------------------------------------------------------------
# OPTIONAL VARIABLES
# ----------------------------------------------------------------------------------------------------

# If set to true, this module will look for the specified organizational unit
# (OU) recursively under the root of the organization. If set to false, it
# will only look for the OU directly under the root.
discover_ous_recursively = false

}


Reference

Optional

If set to true, this module will look for the specified organizational unit (OU) recursively under the root of the organization. If set to false, it will only look for the OU directly under the root.

false