com.pepperize.cdk.organizations.OrganizationalUnit Maven / Gradle / Ivy
Show all versions of cdk-organizations Show documentation
package com.pepperize.cdk.organizations;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.98.0 (build 00b106d)", date = "2024-05-17T01:18:02.666Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = com.pepperize.cdk.organizations.$Module.class, fqn = "@pepperize/cdk-organizations.OrganizationalUnit")
public class OrganizationalUnit extends software.constructs.Construct implements com.pepperize.cdk.organizations.IOrganizationalUnit, com.pepperize.cdk.organizations.ITaggableResource {
protected OrganizationalUnit(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected OrganizationalUnit(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
* @param props This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public OrganizationalUnit(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull com.pepperize.cdk.organizations.OrganizationalUnitProps 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") });
}
/**
* Attach a policy.
*
* Before you can attach the policy, you must enable that policy type for use. You can use policies when you have all features enabled.
*
* @see https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html
* @param policy This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public void attachPolicy(final @org.jetbrains.annotations.NotNull com.pepperize.cdk.organizations.IPolicy policy) {
software.amazon.jsii.Kernel.call(this, "attachPolicy", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(policy, "policy is required") });
}
/**
* The unique identifier (ID) of the parent root, organizational unit (OU), account, or policy that you want to create the new OU in.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull java.lang.String identifier() {
return software.amazon.jsii.Kernel.call(this, "identifier", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* The Amazon Resource Name (ARN) of this OU.
*
* For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the AWS Service Authorization Reference.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.String getOrganizationalUnitArn() {
return software.amazon.jsii.Kernel.get(this, "organizationalUnitArn", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* The unique identifier (ID) associated with this OU.
*
* The regex pattern for an organizational unit ID string requires "ou-" followed by from 4 to 32 lowercase letters or digits (the ID of the root that contains the OU). This string is followed by a second "-" dash and from 8 to 32 additional lowercase letters or digits.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.String getOrganizationalUnitId() {
return software.amazon.jsii.Kernel.get(this, "organizationalUnitId", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* The friendly name of this OU.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.String getOrganizationalUnitName() {
return software.amazon.jsii.Kernel.get(this, "organizationalUnitName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
protected @org.jetbrains.annotations.NotNull software.amazon.awscdk.CustomResource getResource() {
return software.amazon.jsii.Kernel.get(this, "resource", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.CustomResource.class));
}
/**
* TagManager to set, remove and format tags.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.TagManager getTags() {
return software.amazon.jsii.Kernel.get(this, "tags", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.TagManager.class));
}
/**
* A fluent builder for {@link com.pepperize.cdk.organizations.OrganizationalUnit}.
*/
@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 This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private final com.pepperize.cdk.organizations.OrganizationalUnitProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
this.props = new com.pepperize.cdk.organizations.OrganizationalUnitProps.Builder();
}
/**
* The friendly name to assign to the new OU.
*
* @return {@code this}
* @param organizationalUnitName The friendly name to assign to the new OU. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder organizationalUnitName(final java.lang.String organizationalUnitName) {
this.props.organizationalUnitName(organizationalUnitName);
return this;
}
/**
* The parent root or OU that you want to create the new OrganizationalUnit in.
*
* @return {@code this}
* @param parent The parent root or OU that you want to create the new OrganizationalUnit in. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder parent(final com.pepperize.cdk.organizations.IParent parent) {
this.props.parent(parent);
return this;
}
/**
* Whether to import, if a duplicate organizational unit with same name exists in the parent exists.
*
* Default: true
*
* @return {@code this}
* @param importOnDuplicate Whether to import, if a duplicate organizational unit with same name exists in the parent exists. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder importOnDuplicate(final java.lang.Boolean importOnDuplicate) {
this.props.importOnDuplicate(importOnDuplicate);
return this;
}
/**
* If set to RemovalPolicy.DESTROY, the organizational unit will be deleted.
*
* Default: RemovalPolicy.Retain
*
* @return {@code this}
* @param removalPolicy If set to RemovalPolicy.DESTROY, the organizational unit will be deleted. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder removalPolicy(final software.amazon.awscdk.RemovalPolicy removalPolicy) {
this.props.removalPolicy(removalPolicy);
return this;
}
/**
* @return a newly built instance of {@link com.pepperize.cdk.organizations.OrganizationalUnit}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public com.pepperize.cdk.organizations.OrganizationalUnit build() {
return new com.pepperize.cdk.organizations.OrganizationalUnit(
this.scope,
this.id,
this.props.build()
);
}
}
}