Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
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 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.
Synopsis
- data CreateOrganizationalUnit = CreateOrganizationalUnit' {}
- newCreateOrganizationalUnit :: Text -> Text -> CreateOrganizationalUnit
- createOrganizationalUnit_tags :: Lens' CreateOrganizationalUnit (Maybe [Tag])
- createOrganizationalUnit_parentId :: Lens' CreateOrganizationalUnit Text
- createOrganizationalUnit_name :: Lens' CreateOrganizationalUnit Text
- data CreateOrganizationalUnitResponse = CreateOrganizationalUnitResponse' {}
- newCreateOrganizationalUnitResponse :: Int -> CreateOrganizationalUnitResponse
- createOrganizationalUnitResponse_organizationalUnit :: Lens' CreateOrganizationalUnitResponse (Maybe OrganizationalUnit)
- createOrganizationalUnitResponse_httpStatus :: Lens' CreateOrganizationalUnitResponse Int
Creating a Request
data CreateOrganizationalUnit Source #
See: newCreateOrganizationalUnit
smart constructor.
CreateOrganizationalUnit' | |
|
Instances
newCreateOrganizationalUnit Source #
:: Text | |
-> Text | |
-> CreateOrganizationalUnit |
Create a value of CreateOrganizationalUnit
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:tags:CreateOrganizationalUnit'
, createOrganizationalUnit_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.
If any one of the tags is invalid or if you exceed the allowed number of tags for an OU, then the entire request fails and the OU is not created.
$sel:parentId:CreateOrganizationalUnit'
, createOrganizationalUnit_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:
- Root - A string that begins with "r-" followed by from 4 to 32 lowercase letters or digits.
- Organizational unit (OU) - A string that begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This string is followed by a second "-" dash and from 8 to 32 additional lowercase letters or digits.
$sel:name:CreateOrganizationalUnit'
, createOrganizationalUnit_name
- The friendly name to assign to the new OU.
Request Lenses
createOrganizationalUnit_tags :: Lens' CreateOrganizationalUnit (Maybe [Tag]) Source #
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.
If any one of the tags is invalid or if you exceed the allowed number of tags for an OU, then the entire request fails and the OU is not created.
createOrganizationalUnit_parentId :: Lens' CreateOrganizationalUnit Text Source #
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:
- Root - A string that begins with "r-" followed by from 4 to 32 lowercase letters or digits.
- Organizational unit (OU) - A string that begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This string is followed by a second "-" dash and from 8 to 32 additional lowercase letters or digits.
createOrganizationalUnit_name :: Lens' CreateOrganizationalUnit Text Source #
The friendly name to assign to the new OU.
Destructuring the Response
data CreateOrganizationalUnitResponse Source #
See: newCreateOrganizationalUnitResponse
smart constructor.
CreateOrganizationalUnitResponse' | |
|
Instances
Eq CreateOrganizationalUnitResponse Source # | |
Read CreateOrganizationalUnitResponse Source # | |
Show CreateOrganizationalUnitResponse Source # | |
Generic CreateOrganizationalUnitResponse Source # | |
NFData CreateOrganizationalUnitResponse Source # | |
Defined in Amazonka.Organizations.CreateOrganizationalUnit rnf :: CreateOrganizationalUnitResponse -> () # | |
type Rep CreateOrganizationalUnitResponse Source # | |
Defined in Amazonka.Organizations.CreateOrganizationalUnit type Rep CreateOrganizationalUnitResponse = D1 ('MetaData "CreateOrganizationalUnitResponse" "Amazonka.Organizations.CreateOrganizationalUnit" "libZSservicesZSamazonka-organizationsZSamazonka-organizations" 'False) (C1 ('MetaCons "CreateOrganizationalUnitResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "organizationalUnit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe OrganizationalUnit)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))) |
newCreateOrganizationalUnitResponse Source #
Create a value of CreateOrganizationalUnitResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:organizationalUnit:CreateOrganizationalUnitResponse'
, createOrganizationalUnitResponse_organizationalUnit
- A structure that contains details about the newly created OU.
$sel:httpStatus:CreateOrganizationalUnitResponse'
, createOrganizationalUnitResponse_httpStatus
- The response's http status code.
Response Lenses
createOrganizationalUnitResponse_organizationalUnit :: Lens' CreateOrganizationalUnitResponse (Maybe OrganizationalUnit) Source #
A structure that contains details about the newly created OU.
createOrganizationalUnitResponse_httpStatus :: Lens' CreateOrganizationalUnitResponse Int Source #
The response's http status code.