Skip to main content

organizational_units

Creates, updates, deletes or gets an organizational_unit resource or lists organizational_units in a region

Overview

Nameorganizational_units
TypeResource
DescriptionYou 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.
Idaws.organizations.organizational_units

Fields

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of this OU.
idstringThe unique identifier (ID) associated with this OU.
namestringThe friendly name of this OU.
parent_idstringThe unique identifier (ID) of the parent root or OU that you want to create the new OU in.
tagsarrayA list of tags that you want to attach to the newly created OU.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTName, ParentId, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all organizational_units in a region.

SELECT
region,
arn,
id,
name,
parent_id,
tags
FROM aws.organizations.organizational_units
WHERE region = 'us-east-1';

Gets all properties from an individual organizational_unit.

SELECT
region,
arn,
id,
name,
parent_id,
tags
FROM aws.organizations.organizational_units
WHERE region = 'us-east-1' AND data__Identifier = '<Id>';

INSERT example

Use the following StackQL query and manifest file to create a new organizational_unit resource, using stack-deploy.

/*+ create */
INSERT INTO aws.organizations.organizational_units (
Name,
ParentId,
region
)
SELECT
'{{ Name }}',
'{{ ParentId }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.organizations.organizational_units
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';

Permissions

To operate on the organizational_units resource, the following permissions are required:

Create

organizations:CreateOrganizationalUnit,
organizations:DescribeOrganizationalUnit,
organizations:ListParents,
organizations:ListTagsForResource,
organizations:TagResource

Read

organizations:DescribeOrganizationalUnit,
organizations:ListParents,
organizations:ListTagsForResource

Update

organizations:DescribeOrganizationalUnit,
organizations:ListParents,
organizations:ListTagsForResource,
organizations:TagResource,
organizations:UntagResource,
organizations:UpdateOrganizationalUnit

Delete

organizations:DeleteOrganizationalUnit

List

organizations:ListOrganizationalUnitsForParent