Provides a resource to create an organizational unit.
resource "aws_organizations_organizational_unit" "example" {
name = "example"
parent_id = aws_organizations_organization.example.roots[0].id
}
This resource supports the following arguments:
name
- The name for the organizational unitparent_id
- ID of the parent organizational unit, which may be the roottags
- (Optional) Key-value map of resource tags. If configured with a provider default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.This resource exports the following attributes in addition to the arguments above:
accounts
- List of child accounts for this Organizational Unit. Does not return account information for child Organizational Units. All elements have these attributes:
arn
- ARN of the accountemail
- Email of the accountid
- Identifier of the accountname
- Name of the accountarn
- ARN of the organizational unitid
- Identifier of the organization unittags_all
- A map of tags assigned to the resource, including those inherited from the provider default_tags
configuration block.In Terraform v1.5.0 and later, use an import
block to import AWS Organizations Organizational Units using the id
. For example:
import {
to = aws_organizations_organizational_unit.example
id = "ou-1234567"
}
Using terraform import
, import AWS Organizations Organizational Units using the id
. For example:
% terraform import aws_organizations_organizational_unit.example ou-1234567