@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:39.100Z") public class CfnOrganizationalUnit extends CfnResource implements IInspectable
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.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.organizations.*; CfnOrganizationalUnit cfnOrganizationalUnit = CfnOrganizationalUnit.Builder.create(this, "MyCfnOrganizationalUnit") .name("name") .parentId("parentId") // the properties below are optional .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .build();
Modifier and Type | Class and Description |
---|---|
static class |
CfnOrganizationalUnit.Builder
A fluent builder for
CfnOrganizationalUnit . |
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnOrganizationalUnit(Construct scope,
java.lang.String id,
CfnOrganizationalUnitProps props)
Create a new `AWS::Organizations::OrganizationalUnit`.
|
protected |
CfnOrganizationalUnit(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnOrganizationalUnit(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrArn()
The Amazon Resource Name (ARN) of this OU.
|
java.lang.String |
getAttrId()
The unique identifier (ID) associated with this OU.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getName()
The friendly name of this OU.
|
java.lang.String |
getParentId()
The unique identifier (ID) of the parent root or OU that you want to create the new OU in.
|
TagManager |
getTags()
A list of tags that you want to attach to the newly created OU.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setName(java.lang.String value)
The friendly name of this OU.
|
void |
setParentId(java.lang.String value)
The unique identifier (ID) of the parent root or OU that you want to create the new OU in.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnOrganizationalUnit(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnOrganizationalUnit(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnOrganizationalUnit(Construct scope, java.lang.String id, CfnOrganizationalUnitProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrArn()
For example: arn:aws:organizations::111111111111:ou/o-exampleorgid/ou-examplerootid111-exampleouid111
.
public java.lang.String getAttrId()
For example: ou-examplerootid111-exampleouid111
.
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
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 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.
public java.lang.String getName()
The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.
public void setName(java.lang.String value)
The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.
public java.lang.String getParentId()
To update the
ParentId
parameter value, you must first remove all accounts attached to the organizational unit (OU). OUs can't be moved within the organization with accounts still attached.
The regex pattern for a parent ID string requires one of the following:
public void setParentId(java.lang.String value)
To update the
ParentId
parameter value, you must first remove all accounts attached to the organizational unit (OU). OUs can't be moved within the organization with accounts still attached.
The regex pattern for a parent ID string requires one of the following: