All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awscdk.services.organizations.CfnOrganizationalUnit Maven / Gradle / Ivy

There is a newer version: 1.204.0
Show newest version
package software.amazon.awscdk.services.organizations;

/**
 * A CloudFormation `AWS::Organizations::OrganizationalUnit`.
 * 

* 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();
 * 
*/ @javax.annotation.Generated(value = "jsii-pacmak/1.73.0 (build 6faeda3)", date = "2023-01-31T18:36:49.436Z") @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.organizations.$Module.class, fqn = "@aws-cdk/aws-organizations.CfnOrganizationalUnit") public class CfnOrganizationalUnit extends software.amazon.awscdk.core.CfnResource implements software.amazon.awscdk.core.IInspectable { protected CfnOrganizationalUnit(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); } protected CfnOrganizationalUnit(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { super(initializationMode); } static { CFN_RESOURCE_TYPE_NAME = software.amazon.jsii.JsiiObject.jsiiStaticGet(software.amazon.awscdk.services.organizations.CfnOrganizationalUnit.class, "CFN_RESOURCE_TYPE_NAME", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); } /** * Create a new `AWS::Organizations::OrganizationalUnit`. *

* @param scope - scope in which this resource is defined. This parameter is required. * @param id - scoped id of the resource. This parameter is required. * @param props - resource properties. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public CfnOrganizationalUnit(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.organizations.CfnOrganizationalUnitProps props) { super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") }); } /** * Examines the CloudFormation resource and discloses attributes. *

* @param inspector - tree inspector to collect and process attributes. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override public void inspect(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.TreeInspector inspector) { software.amazon.jsii.Kernel.call(this, "inspect", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(inspector, "inspector is required") }); } /** * @param props This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override protected @org.jetbrains.annotations.NotNull java.util.Map renderProperties(final @org.jetbrains.annotations.NotNull java.util.Map props) { return java.util.Collections.unmodifiableMap(software.amazon.jsii.Kernel.call(this, "renderProperties", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.Object.class)), new Object[] { java.util.Objects.requireNonNull(props, "props is required") })); } /** * The CloudFormation resource type name for this resource class. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public final static java.lang.String CFN_RESOURCE_TYPE_NAME; /** * The Amazon Resource Name (ARN) of this OU. *

* For example: arn:aws:organizations::111111111111:ou/o-exampleorgid/ou-examplerootid111-exampleouid111 . */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public @org.jetbrains.annotations.NotNull java.lang.String getAttrArn() { return software.amazon.jsii.Kernel.get(this, "attrArn", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); } /** * The unique identifier (ID) associated with this OU. *

* For example: ou-examplerootid111-exampleouid111 . */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public @org.jetbrains.annotations.NotNull java.lang.String getAttrId() { return software.amazon.jsii.Kernel.get(this, "attrId", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); } /** */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) protected @org.jetbrains.annotations.NotNull java.util.Map getCfnProperties() { return java.util.Collections.unmodifiableMap(software.amazon.jsii.Kernel.get(this, "cfnProperties", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.Object.class)))); } /** * 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. *

*

*/ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.TagManager getTags() { return software.amazon.jsii.Kernel.get(this, "tags", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.core.TagManager.class)); } /** * The friendly name of this OU. *

* The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public @org.jetbrains.annotations.NotNull java.lang.String getName() { return software.amazon.jsii.Kernel.get(this, "name", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); } /** * The friendly name of this OU. *

* The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public void setName(final @org.jetbrains.annotations.NotNull java.lang.String value) { software.amazon.jsii.Kernel.set(this, "name", java.util.Objects.requireNonNull(value, "name is required")); } /** * The unique identifier (ID) of the parent root or OU that you want to create the new OU in. *

*

*

* 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: *

*

    *
  • 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.
  • *
*/ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public @org.jetbrains.annotations.NotNull java.lang.String getParentId() { return software.amazon.jsii.Kernel.get(this, "parentId", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); } /** * The unique identifier (ID) of the parent root or OU that you want to create the new OU in. *

*

*

* 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: *

*

    *
  • 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.
  • *
*/ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public void setParentId(final @org.jetbrains.annotations.NotNull java.lang.String value) { software.amazon.jsii.Kernel.set(this, "parentId", java.util.Objects.requireNonNull(value, "parentId is required")); } /** * A fluent builder for {@link software.amazon.awscdk.services.organizations.CfnOrganizationalUnit}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public static final class Builder implements software.amazon.jsii.Builder { /** * @return a new instance of {@link Builder}. * @param scope - scope in which this resource is defined. This parameter is required. * @param id - scoped id of the resource. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public static Builder create(final software.amazon.awscdk.core.Construct scope, final java.lang.String id) { return new Builder(scope, id); } private final software.amazon.awscdk.core.Construct scope; private final java.lang.String id; private final software.amazon.awscdk.services.organizations.CfnOrganizationalUnitProps.Builder props; private Builder(final software.amazon.awscdk.core.Construct scope, final java.lang.String id) { this.scope = scope; this.id = id; this.props = new software.amazon.awscdk.services.organizations.CfnOrganizationalUnitProps.Builder(); } /** * The friendly name of this OU. *

* The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range. *

* @return {@code this} * @param name The friendly name of this OU. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder name(final java.lang.String name) { this.props.name(name); return this; } /** * The unique identifier (ID) of the parent root or OU that you want to create the new OU in. *

*

*

* 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: *

*

    *
  • 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.
  • *
*

* @return {@code this} * @param parentId The unique identifier (ID) of the parent root or OU that you want to create the new OU in. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder parentId(final java.lang.String parentId) { this.props.parentId(parentId); return this; } /** * 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. *

*

*

* @return {@code this} * @param tags A list of tags that you want to attach to the newly created OU. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder tags(final java.util.List tags) { this.props.tags(tags); return this; } /** * @returns a newly built instance of {@link software.amazon.awscdk.services.organizations.CfnOrganizationalUnit}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override public software.amazon.awscdk.services.organizations.CfnOrganizationalUnit build() { return new software.amazon.awscdk.services.organizations.CfnOrganizationalUnit( this.scope, this.id, this.props.build() ); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy