Get all direct child accounts under a parent organizational unit. This only provides immediate children, not all children.
data "aws_organizations_organization" "org" {}
data "aws_organizations_organizational_unit_child_accounts" "accounts" {
parent_id = data.aws_organizations_organization.org.roots[0].id
}
parent_id
- (Required) The parent ID of the accounts.This data source exports the following attributes in addition to the arguments above:
accounts
- List of child accounts, which have the following attributes:
arn
- The Amazon Resource Name (ARN) of the account.email
- The email address associated with the AWS account.id
- The unique identifier (ID) of the account.name
- The friendly name of the account.status
- The status of the account in the organization.id
- Parent identifier of the organizational units.