You can use organizational units (OUs) to group accounts together to administer as a single unit. This greatly simplifies the management of your accounts. For example, you can attach a policy-based control to an OU, and all accounts within the OU automatically inherit the policy. You can create multiple OUs within a single organization, and you can create OUs within other OUs. Each OU can contain multiple accounts, and you can move accounts from one OU to another. However, OU names must be unique within a parent OU or root.
To create a new OU under the root Organizations:
resource "awscc_organizations_organizational_unit" "this" {
name = "child-ou-lv1"
parent_id = var.root_id
}
To create a nested OU
resource "awscc_organizations_organizational_unit" "level_1_ou" {
name = "child-ou-lv1"
parent_id = var.root_id
}
resource "awscc_organizations_organizational_unit" "level_2_ou" {
name = "child-ou-lv2"
parent_id = awscc_organizations_organizational_unit.level_1_ou.id
}
name
(String) The friendly name of this OU.parent_id
(String) The unique identifier (ID) of the parent root or OU that you want to create the new OU in.tags
(Attributes Set) A list of tags that you want to attach to the newly created OU. (see below for nested schema)arn
(String) The Amazon Resource Name (ARN) of this OU.id
(String) Uniquely identifies the resource.organizational_unit_id
(String) The unique identifier (ID) associated with this OU.tags
Required:
key
(String) The key identifier, or name, of the tag.value
(String) The string value that's associated with the key of the tag. You can set the value of a tag to an empty string, but you can't set the value of a tag to null.Import is supported using the following syntax:
$ terraform import awscc_organizations_organizational_unit.example <resource ID>