Control Tower 0.7.10Last updated in version 0.7.6
View Source
Release Notes
Organizational Units Data Source
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
- Terraform
- Terragrunt
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
}
terragrunt.hcl
# ------------------------------------------------------------------------------------------------------
# DEPLOY GRUNTWORK'S ORGANIZATIONAL-UNITS MODULE
# ------------------------------------------------------------------------------------------------------
terraform {
source = "git::git@github.com:gruntwork-io/terraform-aws-control-tower.git//modules/landingzone/organizational-units?ref=v0.7.10"
}
inputs = {
# ----------------------------------------------------------------------------------------------------
# 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
- Inputs
- Outputs
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