A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.aws.amazon.com/organizations/latest/APIReference/API_CreateOrganizationalUnit.html below:

CreateOrganizationalUnit - AWS Organizations

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 AWS 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.

Request Syntax
{
   "Name": "string",
   "ParentId": "string",
   "Tags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ]
}
Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Name

The friendly name to assign to the new OU.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [\s\S]*

Required: Yes

ParentId

The unique identifier (ID) of the parent root or OU that you want to create the new OU in.

The regex pattern for a parent ID string requires one of the following:

Type: String

Length Constraints: Maximum length of 100.

Pattern: ^(r-[0-9a-z]{4,32})|(ou-[0-9a-z]{4,32}-[a-z0-9]{8,32})$

Required: Yes

Tags

A list of tags that you want to attach to the newly created OU. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null. For more information about tagging, see Tagging AWS Organizations resources in the AWS Organizations User Guide.

Note

If any one of the tags is not valid or if you exceed the allowed number of tags for an OU, then the entire request fails and the OU is not created.

Type: Array of Tag objects

Required: No

Response Syntax
{
   "OrganizationalUnit": { 
      "Arn": "string",
      "Id": "string",
      "Name": "string"
   }
}
Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see Access Management in the IAM User Guide.

HTTP Status Code: 400

AWSOrganizationsNotInUseException

Your account isn't a member of an organization. To make this request, you must use the credentials of an account that belongs to an organization.

HTTP Status Code: 400

ConcurrentModificationException

The target of the operation is currently being modified by a different request. Try again later.

HTTP Status Code: 400

ConstraintViolationException

Performing this operation violates a minimum or maximum value limit. For example, attempting to remove the last service control policy (SCP) from an OU or root, inviting or creating too many accounts to the organization, or attaching too many policies to an account, OU, or root. This exception includes a reason that contains additional information about the violated limit:

Note

Some of the reasons in the following list might not be applicable to this specific API or operation.

HTTP Status Code: 400

DuplicateOrganizationalUnitException

An OU with the same name already exists.

HTTP Status Code: 400

InvalidInputException

The requested operation failed because you provided invalid values for one or more of the request parameters. This exception includes a reason that contains additional information about the violated limit:

Note

Some of the reasons in the following list might not be applicable to this specific API or operation.

HTTP Status Code: 400

ParentNotFoundException

We can't find a root or OU with the ParentId that you specified.

HTTP Status Code: 400

ServiceException

AWS Organizations can't complete your request because of an internal service error. Try again later.

HTTP Status Code: 500

TooManyRequestsException

You have sent too many requests in too short a period of time. The quota helps protect against denial-of-service attacks. Try again later.

For information about quotas that affect AWS Organizations, see Quotas for AWS Organizations in the AWS Organizations User Guide.

HTTP Status Code: 400

Examples Example

The following example shows how to create an OU that is named AccountingOU.

Sample Request
POST / HTTP/1.1
X-Amz-Target: AWSOrganizationsV20161128.CreateOrganizationalUnit

{ "ParentId": "r-examplerootid111", "Name": "AccountingOU" }
Sample Response
HTTP/1.1 200 OK
Content-Type: application/json
{
  "OrganizationalUnit": {
    "Id": "ou-examplerootid111-exampleouid111",
    "Arn": "arn:aws:organizations::111111111111:ou/o-exampleorgid/ou-examplerootid111-exampleouid111",
    "Name": "AccountingOU"
  }
}
See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4