Class CfnOrganizationalUnit
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.organizations.CfnOrganizationalUnit
- All Implemented Interfaces:
IInspectable,IEnvironmentAware,IOrganizationalUnitRef,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.121.0 (build d7af9b9)",
date="2025-12-18T18:20:14.284Z")
@Stability(Stable)
public class CfnOrganizationalUnit
extends CfnResource
implements IInspectable, IOrganizationalUnitRef, ITaggable
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.
You can only call this operation from the 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();
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.organizations.IOrganizationalUnitRef
IOrganizationalUnitRef.Jsii$Default, IOrganizationalUnitRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnOrganizationalUnit(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnOrganizationalUnit(software.amazon.jsii.JsiiObjectRef objRef) CfnOrganizationalUnit(software.constructs.Construct scope, String id, CfnOrganizationalUnitProps props) Create a newAWS::Organizations::OrganizationalUnit. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringThe Amazon Resource Name (ARN) of this OU.The unique identifier (ID) associated with this OU.getName()The friendly name of this OU.A reference to a OrganizationalUnit resource.The unique identifier (ID) of the parent root or OU that you want to create the new OU in.getTags()Tag Manager which manages the tags for this resource.A list of tags that you want to attach to the newly created OU.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnOrganizationalUnit.renderProperties(Map<String, Object> props) voidThe friendly name of this OU.voidsetParentId(String value) The unique identifier (ID) of the parent root or OU that you want to create the new OU in.voidsetTagsRaw(List<CfnTag> value) A list of tags that you want to attach to the newly created OU.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnOrganizationalUnit
protected CfnOrganizationalUnit(software.amazon.jsii.JsiiObjectRef objRef) -
CfnOrganizationalUnit
protected CfnOrganizationalUnit(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnOrganizationalUnit
@Stability(Stable) public CfnOrganizationalUnit(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnOrganizationalUnitProps props) Create a newAWS::Organizations::OrganizationalUnit.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
arnForOrganizationalUnit
@Stability(Stable) @NotNull public static String arnForOrganizationalUnit(@NotNull IOrganizationalUnitRef resource) - Parameters:
resource- This parameter is required.
-
isCfnOrganizationalUnit
Checks whether the given object is a CfnOrganizationalUnit.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
The Amazon Resource Name (ARN) of this OU.For example:
arn:aws:organizations::111111111111:ou/o-exampleorgid/ou-examplerootid111-exampleouid111. -
getAttrId
The unique identifier (ID) associated with this OU.For example:
ou-examplerootid111-exampleouid111. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getOrganizationalUnitRef
A reference to a OrganizationalUnit resource.- Specified by:
getOrganizationalUnitRefin interfaceIOrganizationalUnitRef
-
getTags
Tag Manager which manages the tags for this resource. -
getName
The friendly name of this OU. -
setName
The friendly name of this OU. -
getParentId
The unique identifier (ID) of the parent root or OU that you want to create the new OU in. -
setParentId
The unique identifier (ID) of the parent root or OU that you want to create the new OU in. -
getTagsRaw
A list of tags that you want to attach to the newly created OU. -
setTagsRaw
A list of tags that you want to attach to the newly created OU.
-