createOrganizationalUnit

Creates an organizational unit (OU) within a root or parent OU. An OU is a container for accounts that enables you to organize your accounts to apply policies according to your business requirements. The number of levels deep that you can nest OUs is dependent upon the policy types enabled for that root. For service control policies, the limit is five.

For more information about OUs, see Managing organizational units (OUs) in the Organizations User Guide.

If the request includes tags, then the requester must have the organizations:TagResource permission.

This operation can be called only from the organization's management account.

Samples


fun main() { 
   //sampleStart 
   // The following example shows how to create an OU that is named AccountingOU. The new OU is directly
// under the root.
val resp = organizationsClient.createOrganizationalUnit {
    parentId = "r-examplerootid111"
    name = "AccountingOU"
} 
   //sampleEnd
}