Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.cloudformation.model.Stack Maven / Gradle / Ivy
Go to download
The AWS Java SDK for AWS CloudFormation module holds the client classes that are used for communicating
with AWS CloudFormation Service
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.cloudformation.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The Stack data type.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Stack implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField STACK_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StackId").getter(getter(Stack::stackId)).setter(setter(Builder::stackId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StackId").build()).build();
private static final SdkField STACK_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StackName").getter(getter(Stack::stackName)).setter(setter(Builder::stackName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StackName").build()).build();
private static final SdkField CHANGE_SET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ChangeSetId").getter(getter(Stack::changeSetId)).setter(setter(Builder::changeSetId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChangeSetId").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(Stack::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField> PARAMETERS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Parameters")
.getter(getter(Stack::parameters))
.setter(setter(Builder::parameters))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Parameters").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Parameter::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationTime").getter(getter(Stack::creationTime)).setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();
private static final SdkField DELETION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("DeletionTime").getter(getter(Stack::deletionTime)).setter(setter(Builder::deletionTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeletionTime").build()).build();
private static final SdkField LAST_UPDATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LastUpdatedTime").getter(getter(Stack::lastUpdatedTime)).setter(setter(Builder::lastUpdatedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastUpdatedTime").build()).build();
private static final SdkField ROLLBACK_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("RollbackConfiguration")
.getter(getter(Stack::rollbackConfiguration)).setter(setter(Builder::rollbackConfiguration))
.constructor(RollbackConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RollbackConfiguration").build())
.build();
private static final SdkField STACK_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StackStatus").getter(getter(Stack::stackStatusAsString)).setter(setter(Builder::stackStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StackStatus").build()).build();
private static final SdkField STACK_STATUS_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StackStatusReason").getter(getter(Stack::stackStatusReason)).setter(setter(Builder::stackStatusReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StackStatusReason").build()).build();
private static final SdkField DISABLE_ROLLBACK_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("DisableRollback").getter(getter(Stack::disableRollback)).setter(setter(Builder::disableRollback))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DisableRollback").build()).build();
private static final SdkField> NOTIFICATION_AR_NS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("NotificationARNs")
.getter(getter(Stack::notificationARNs))
.setter(setter(Builder::notificationARNs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotificationARNs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField TIMEOUT_IN_MINUTES_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("TimeoutInMinutes").getter(getter(Stack::timeoutInMinutes)).setter(setter(Builder::timeoutInMinutes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimeoutInMinutes").build()).build();
private static final SdkField> CAPABILITIES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Capabilities")
.getter(getter(Stack::capabilitiesAsStrings))
.setter(setter(Builder::capabilitiesWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Capabilities").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> OUTPUTS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Outputs")
.getter(getter(Stack::outputs))
.setter(setter(Builder::outputs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Outputs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Output::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RoleARN").getter(getter(Stack::roleARN)).setter(setter(Builder::roleARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleARN").build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Tags")
.getter(getter(Stack::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Tag::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField ENABLE_TERMINATION_PROTECTION_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("EnableTerminationProtection")
.getter(getter(Stack::enableTerminationProtection))
.setter(setter(Builder::enableTerminationProtection))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnableTerminationProtection")
.build()).build();
private static final SdkField PARENT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ParentId").getter(getter(Stack::parentId)).setter(setter(Builder::parentId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ParentId").build()).build();
private static final SdkField ROOT_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("RootId")
.getter(getter(Stack::rootId)).setter(setter(Builder::rootId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RootId").build()).build();
private static final SdkField DRIFT_INFORMATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DriftInformation")
.getter(getter(Stack::driftInformation)).setter(setter(Builder::driftInformation))
.constructor(StackDriftInformation::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DriftInformation").build()).build();
private static final SdkField RETAIN_EXCEPT_ON_CREATE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("RetainExceptOnCreate").getter(getter(Stack::retainExceptOnCreate))
.setter(setter(Builder::retainExceptOnCreate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RetainExceptOnCreate").build())
.build();
private static final SdkField DELETION_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeletionMode").getter(getter(Stack::deletionModeAsString)).setter(setter(Builder::deletionMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeletionMode").build()).build();
private static final SdkField DETAILED_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DetailedStatus").getter(getter(Stack::detailedStatusAsString)).setter(setter(Builder::detailedStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DetailedStatus").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STACK_ID_FIELD,
STACK_NAME_FIELD, CHANGE_SET_ID_FIELD, DESCRIPTION_FIELD, PARAMETERS_FIELD, CREATION_TIME_FIELD, DELETION_TIME_FIELD,
LAST_UPDATED_TIME_FIELD, ROLLBACK_CONFIGURATION_FIELD, STACK_STATUS_FIELD, STACK_STATUS_REASON_FIELD,
DISABLE_ROLLBACK_FIELD, NOTIFICATION_AR_NS_FIELD, TIMEOUT_IN_MINUTES_FIELD, CAPABILITIES_FIELD, OUTPUTS_FIELD,
ROLE_ARN_FIELD, TAGS_FIELD, ENABLE_TERMINATION_PROTECTION_FIELD, PARENT_ID_FIELD, ROOT_ID_FIELD,
DRIFT_INFORMATION_FIELD, RETAIN_EXCEPT_ON_CREATE_FIELD, DELETION_MODE_FIELD, DETAILED_STATUS_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private static final long serialVersionUID = 1L;
private final String stackId;
private final String stackName;
private final String changeSetId;
private final String description;
private final List parameters;
private final Instant creationTime;
private final Instant deletionTime;
private final Instant lastUpdatedTime;
private final RollbackConfiguration rollbackConfiguration;
private final String stackStatus;
private final String stackStatusReason;
private final Boolean disableRollback;
private final List notificationARNs;
private final Integer timeoutInMinutes;
private final List capabilities;
private final List outputs;
private final String roleARN;
private final List tags;
private final Boolean enableTerminationProtection;
private final String parentId;
private final String rootId;
private final StackDriftInformation driftInformation;
private final Boolean retainExceptOnCreate;
private final String deletionMode;
private final String detailedStatus;
private Stack(BuilderImpl builder) {
this.stackId = builder.stackId;
this.stackName = builder.stackName;
this.changeSetId = builder.changeSetId;
this.description = builder.description;
this.parameters = builder.parameters;
this.creationTime = builder.creationTime;
this.deletionTime = builder.deletionTime;
this.lastUpdatedTime = builder.lastUpdatedTime;
this.rollbackConfiguration = builder.rollbackConfiguration;
this.stackStatus = builder.stackStatus;
this.stackStatusReason = builder.stackStatusReason;
this.disableRollback = builder.disableRollback;
this.notificationARNs = builder.notificationARNs;
this.timeoutInMinutes = builder.timeoutInMinutes;
this.capabilities = builder.capabilities;
this.outputs = builder.outputs;
this.roleARN = builder.roleARN;
this.tags = builder.tags;
this.enableTerminationProtection = builder.enableTerminationProtection;
this.parentId = builder.parentId;
this.rootId = builder.rootId;
this.driftInformation = builder.driftInformation;
this.retainExceptOnCreate = builder.retainExceptOnCreate;
this.deletionMode = builder.deletionMode;
this.detailedStatus = builder.detailedStatus;
}
/**
*
* Unique identifier of the stack.
*
*
* @return Unique identifier of the stack.
*/
public final String stackId() {
return stackId;
}
/**
*
* The name associated with the stack.
*
*
* @return The name associated with the stack.
*/
public final String stackName() {
return stackName;
}
/**
*
* The unique ID of the change set.
*
*
* @return The unique ID of the change set.
*/
public final String changeSetId() {
return changeSetId;
}
/**
*
* A user-defined description associated with the stack.
*
*
* @return A user-defined description associated with the stack.
*/
public final String description() {
return description;
}
/**
* For responses, this returns true if the service returned a value for the Parameters property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasParameters() {
return parameters != null && !(parameters instanceof SdkAutoConstructList);
}
/**
*
* A list of Parameter
structures.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasParameters} method.
*
*
* @return A list of Parameter
structures.
*/
public final List parameters() {
return parameters;
}
/**
*
* The time at which the stack was created.
*
*
* @return The time at which the stack was created.
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* The time the stack was deleted.
*
*
* @return The time the stack was deleted.
*/
public final Instant deletionTime() {
return deletionTime;
}
/**
*
* The time the stack was last updated. This field will only be returned if the stack has been updated at least
* once.
*
*
* @return The time the stack was last updated. This field will only be returned if the stack has been updated at
* least once.
*/
public final Instant lastUpdatedTime() {
return lastUpdatedTime;
}
/**
*
* The rollback triggers for CloudFormation to monitor during stack creation and updating operations, and for the
* specified monitoring period afterwards.
*
*
* @return The rollback triggers for CloudFormation to monitor during stack creation and updating operations, and
* for the specified monitoring period afterwards.
*/
public final RollbackConfiguration rollbackConfiguration() {
return rollbackConfiguration;
}
/**
*
* Current status of the stack.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #stackStatus} will
* return {@link StackStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #stackStatusAsString}.
*
*
* @return Current status of the stack.
* @see StackStatus
*/
public final StackStatus stackStatus() {
return StackStatus.fromValue(stackStatus);
}
/**
*
* Current status of the stack.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #stackStatus} will
* return {@link StackStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #stackStatusAsString}.
*
*
* @return Current status of the stack.
* @see StackStatus
*/
public final String stackStatusAsString() {
return stackStatus;
}
/**
*
* Success/failure message associated with the stack status.
*
*
* @return Success/failure message associated with the stack status.
*/
public final String stackStatusReason() {
return stackStatusReason;
}
/**
*
* Boolean to enable or disable rollback on stack creation failures:
*
*
*
* @return Boolean to enable or disable rollback on stack creation failures:
*
*
*
* true
: disable rollback.
*
*
*
*
* false
: enable rollback.
*
*
*/
public final Boolean disableRollback() {
return disableRollback;
}
/**
* For responses, this returns true if the service returned a value for the NotificationARNs property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasNotificationARNs() {
return notificationARNs != null && !(notificationARNs instanceof SdkAutoConstructList);
}
/**
*
* Amazon SNS topic Amazon Resource Names (ARNs) to which stack related events are published.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasNotificationARNs} method.
*
*
* @return Amazon SNS topic Amazon Resource Names (ARNs) to which stack related events are published.
*/
public final List notificationARNs() {
return notificationARNs;
}
/**
*
* The amount of time within which stack creation should complete.
*
*
* @return The amount of time within which stack creation should complete.
*/
public final Integer timeoutInMinutes() {
return timeoutInMinutes;
}
/**
*
* The capabilities allowed in the stack.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasCapabilities} method.
*
*
* @return The capabilities allowed in the stack.
*/
public final List capabilities() {
return CapabilitiesCopier.copyStringToEnum(capabilities);
}
/**
* For responses, this returns true if the service returned a value for the Capabilities property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasCapabilities() {
return capabilities != null && !(capabilities instanceof SdkAutoConstructList);
}
/**
*
* The capabilities allowed in the stack.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasCapabilities} method.
*
*
* @return The capabilities allowed in the stack.
*/
public final List capabilitiesAsStrings() {
return capabilities;
}
/**
* For responses, this returns true if the service returned a value for the Outputs property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasOutputs() {
return outputs != null && !(outputs instanceof SdkAutoConstructList);
}
/**
*
* A list of output structures.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasOutputs} method.
*
*
* @return A list of output structures.
*/
public final List outputs() {
return outputs;
}
/**
*
* The Amazon Resource Name (ARN) of an IAM role that's associated with the stack. During a stack operation,
* CloudFormation uses this role's credentials to make calls on your behalf.
*
*
* @return The Amazon Resource Name (ARN) of an IAM role that's associated with the stack. During a stack operation,
* CloudFormation uses this role's credentials to make calls on your behalf.
*/
public final String roleARN() {
return roleARN;
}
/**
* For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructList);
}
/**
*
* A list of Tag
s that specify information about the stack.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasTags} method.
*
*
* @return A list of Tag
s that specify information about the stack.
*/
public final List tags() {
return tags;
}
/**
*
* Whether termination protection is enabled for the stack.
*
*
* For nested
* stacks , termination protection is set on the root stack and can't be changed directly on the nested stack.
* For more information, see Protect a
* CloudFormation stack from being deleted in the CloudFormation User Guide .
*
*
* @return Whether termination protection is enabled for the stack.
*
* For nested
* stacks , termination protection is set on the root stack and can't be changed directly on the nested
* stack. For more information, see Protect a CloudFormation stack from being deleted in the CloudFormation User Guide .
*/
public final Boolean enableTerminationProtection() {
return enableTerminationProtection;
}
/**
*
* For nested stacks--stacks created as resources for another stack--the stack ID of the direct parent of this
* stack. For the first level of nested stacks, the root stack is also the parent stack.
*
*
* For more information, see Embed stacks
* within other stacks using nested stacks in the CloudFormation User Guide .
*
*
* @return For nested stacks--stacks created as resources for another stack--the stack ID of the direct parent of
* this stack. For the first level of nested stacks, the root stack is also the parent stack.
*
* For more information, see Embed
* stacks within other stacks using nested stacks in the CloudFormation User Guide .
*/
public final String parentId() {
return parentId;
}
/**
*
* For nested stacks--stacks created as resources for another stack--the stack ID of the top-level stack to which
* the nested stack ultimately belongs.
*
*
* For more information, see Embed stacks
* within other stacks using nested stacks in the CloudFormation User Guide .
*
*
* @return For nested stacks--stacks created as resources for another stack--the stack ID of the top-level stack to
* which the nested stack ultimately belongs.
*
* For more information, see Embed
* stacks within other stacks using nested stacks in the CloudFormation User Guide .
*/
public final String rootId() {
return rootId;
}
/**
*
* Information about whether a stack's actual configuration differs, or has drifted , from its expected
* configuration, as defined in the stack template and any values specified as template parameters. For more
* information, see Detect unmanaged
* configuration changes to stacks and resources with drift detection .
*
*
* @return Information about whether a stack's actual configuration differs, or has drifted , from its
* expected configuration, as defined in the stack template and any values specified as template parameters.
* For more information, see Detect
* unmanaged configuration changes to stacks and resources with drift detection .
*/
public final StackDriftInformation driftInformation() {
return driftInformation;
}
/**
*
* When set to true
, newly created resources are deleted when the operation rolls back. This includes
* newly created resources marked with a deletion policy of Retain
.
*
*
* Default: false
*
*
* @return When set to true
, newly created resources are deleted when the operation rolls back. This
* includes newly created resources marked with a deletion policy of Retain
.
*
* Default: false
*/
public final Boolean retainExceptOnCreate() {
return retainExceptOnCreate;
}
/**
*
* Specifies the deletion mode for the stack. Possible values are:
*
*
*
*
* STANDARD
- Use the standard behavior. Specifying this value is the same as not specifying this
* parameter.
*
*
*
*
* FORCE_DELETE_STACK
- Delete the stack if it's stuck in a DELETE_FAILED
state due to
* resource deletion failure.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #deletionMode} will
* return {@link DeletionMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #deletionModeAsString}.
*
*
* @return Specifies the deletion mode for the stack. Possible values are:
*
*
*
* STANDARD
- Use the standard behavior. Specifying this value is the same as not specifying
* this parameter.
*
*
*
*
* FORCE_DELETE_STACK
- Delete the stack if it's stuck in a DELETE_FAILED
state
* due to resource deletion failure.
*
*
* @see DeletionMode
*/
public final DeletionMode deletionMode() {
return DeletionMode.fromValue(deletionMode);
}
/**
*
* Specifies the deletion mode for the stack. Possible values are:
*
*
*
*
* STANDARD
- Use the standard behavior. Specifying this value is the same as not specifying this
* parameter.
*
*
*
*
* FORCE_DELETE_STACK
- Delete the stack if it's stuck in a DELETE_FAILED
state due to
* resource deletion failure.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #deletionMode} will
* return {@link DeletionMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #deletionModeAsString}.
*
*
* @return Specifies the deletion mode for the stack. Possible values are:
*
*
*
* STANDARD
- Use the standard behavior. Specifying this value is the same as not specifying
* this parameter.
*
*
*
*
* FORCE_DELETE_STACK
- Delete the stack if it's stuck in a DELETE_FAILED
state
* due to resource deletion failure.
*
*
* @see DeletionMode
*/
public final String deletionModeAsString() {
return deletionMode;
}
/**
*
* The detailed status of the resource or stack. If CONFIGURATION_COMPLETE
is present, the resource or
* resource configuration phase has completed and the stabilization of the resources is in progress. The stack sets
* CONFIGURATION_COMPLETE
when all of the resources in the stack have reached that event. For more
* information, see Understand CloudFormation stack creation events in the CloudFormation User Guide .
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #detailedStatus}
* will return {@link DetailedStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #detailedStatusAsString}.
*
*
* @return The detailed status of the resource or stack. If CONFIGURATION_COMPLETE
is present, the
* resource or resource configuration phase has completed and the stabilization of the resources is in
* progress. The stack sets CONFIGURATION_COMPLETE
when all of the resources in the stack have
* reached that event. For more information, see Understand CloudFormation stack creation events in the CloudFormation User Guide .
* @see DetailedStatus
*/
public final DetailedStatus detailedStatus() {
return DetailedStatus.fromValue(detailedStatus);
}
/**
*
* The detailed status of the resource or stack. If CONFIGURATION_COMPLETE
is present, the resource or
* resource configuration phase has completed and the stabilization of the resources is in progress. The stack sets
* CONFIGURATION_COMPLETE
when all of the resources in the stack have reached that event. For more
* information, see Understand CloudFormation stack creation events in the CloudFormation User Guide .
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #detailedStatus}
* will return {@link DetailedStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #detailedStatusAsString}.
*
*
* @return The detailed status of the resource or stack. If CONFIGURATION_COMPLETE
is present, the
* resource or resource configuration phase has completed and the stabilization of the resources is in
* progress. The stack sets CONFIGURATION_COMPLETE
when all of the resources in the stack have
* reached that event. For more information, see Understand CloudFormation stack creation events in the CloudFormation User Guide .
* @see DetailedStatus
*/
public final String detailedStatusAsString() {
return detailedStatus;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(stackId());
hashCode = 31 * hashCode + Objects.hashCode(stackName());
hashCode = 31 * hashCode + Objects.hashCode(changeSetId());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(hasParameters() ? parameters() : null);
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(deletionTime());
hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedTime());
hashCode = 31 * hashCode + Objects.hashCode(rollbackConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(stackStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(stackStatusReason());
hashCode = 31 * hashCode + Objects.hashCode(disableRollback());
hashCode = 31 * hashCode + Objects.hashCode(hasNotificationARNs() ? notificationARNs() : null);
hashCode = 31 * hashCode + Objects.hashCode(timeoutInMinutes());
hashCode = 31 * hashCode + Objects.hashCode(hasCapabilities() ? capabilitiesAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasOutputs() ? outputs() : null);
hashCode = 31 * hashCode + Objects.hashCode(roleARN());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
hashCode = 31 * hashCode + Objects.hashCode(enableTerminationProtection());
hashCode = 31 * hashCode + Objects.hashCode(parentId());
hashCode = 31 * hashCode + Objects.hashCode(rootId());
hashCode = 31 * hashCode + Objects.hashCode(driftInformation());
hashCode = 31 * hashCode + Objects.hashCode(retainExceptOnCreate());
hashCode = 31 * hashCode + Objects.hashCode(deletionModeAsString());
hashCode = 31 * hashCode + Objects.hashCode(detailedStatusAsString());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Stack)) {
return false;
}
Stack other = (Stack) obj;
return Objects.equals(stackId(), other.stackId()) && Objects.equals(stackName(), other.stackName())
&& Objects.equals(changeSetId(), other.changeSetId()) && Objects.equals(description(), other.description())
&& hasParameters() == other.hasParameters() && Objects.equals(parameters(), other.parameters())
&& Objects.equals(creationTime(), other.creationTime()) && Objects.equals(deletionTime(), other.deletionTime())
&& Objects.equals(lastUpdatedTime(), other.lastUpdatedTime())
&& Objects.equals(rollbackConfiguration(), other.rollbackConfiguration())
&& Objects.equals(stackStatusAsString(), other.stackStatusAsString())
&& Objects.equals(stackStatusReason(), other.stackStatusReason())
&& Objects.equals(disableRollback(), other.disableRollback())
&& hasNotificationARNs() == other.hasNotificationARNs()
&& Objects.equals(notificationARNs(), other.notificationARNs())
&& Objects.equals(timeoutInMinutes(), other.timeoutInMinutes()) && hasCapabilities() == other.hasCapabilities()
&& Objects.equals(capabilitiesAsStrings(), other.capabilitiesAsStrings()) && hasOutputs() == other.hasOutputs()
&& Objects.equals(outputs(), other.outputs()) && Objects.equals(roleARN(), other.roleARN())
&& hasTags() == other.hasTags() && Objects.equals(tags(), other.tags())
&& Objects.equals(enableTerminationProtection(), other.enableTerminationProtection())
&& Objects.equals(parentId(), other.parentId()) && Objects.equals(rootId(), other.rootId())
&& Objects.equals(driftInformation(), other.driftInformation())
&& Objects.equals(retainExceptOnCreate(), other.retainExceptOnCreate())
&& Objects.equals(deletionModeAsString(), other.deletionModeAsString())
&& Objects.equals(detailedStatusAsString(), other.detailedStatusAsString());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("Stack").add("StackId", stackId()).add("StackName", stackName())
.add("ChangeSetId", changeSetId()).add("Description", description())
.add("Parameters", hasParameters() ? parameters() : null).add("CreationTime", creationTime())
.add("DeletionTime", deletionTime()).add("LastUpdatedTime", lastUpdatedTime())
.add("RollbackConfiguration", rollbackConfiguration()).add("StackStatus", stackStatusAsString())
.add("StackStatusReason", stackStatusReason()).add("DisableRollback", disableRollback())
.add("NotificationARNs", hasNotificationARNs() ? notificationARNs() : null)
.add("TimeoutInMinutes", timeoutInMinutes())
.add("Capabilities", hasCapabilities() ? capabilitiesAsStrings() : null)
.add("Outputs", hasOutputs() ? outputs() : null).add("RoleARN", roleARN()).add("Tags", hasTags() ? tags() : null)
.add("EnableTerminationProtection", enableTerminationProtection()).add("ParentId", parentId())
.add("RootId", rootId()).add("DriftInformation", driftInformation())
.add("RetainExceptOnCreate", retainExceptOnCreate()).add("DeletionMode", deletionModeAsString())
.add("DetailedStatus", detailedStatusAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "StackId":
return Optional.ofNullable(clazz.cast(stackId()));
case "StackName":
return Optional.ofNullable(clazz.cast(stackName()));
case "ChangeSetId":
return Optional.ofNullable(clazz.cast(changeSetId()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "Parameters":
return Optional.ofNullable(clazz.cast(parameters()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "DeletionTime":
return Optional.ofNullable(clazz.cast(deletionTime()));
case "LastUpdatedTime":
return Optional.ofNullable(clazz.cast(lastUpdatedTime()));
case "RollbackConfiguration":
return Optional.ofNullable(clazz.cast(rollbackConfiguration()));
case "StackStatus":
return Optional.ofNullable(clazz.cast(stackStatusAsString()));
case "StackStatusReason":
return Optional.ofNullable(clazz.cast(stackStatusReason()));
case "DisableRollback":
return Optional.ofNullable(clazz.cast(disableRollback()));
case "NotificationARNs":
return Optional.ofNullable(clazz.cast(notificationARNs()));
case "TimeoutInMinutes":
return Optional.ofNullable(clazz.cast(timeoutInMinutes()));
case "Capabilities":
return Optional.ofNullable(clazz.cast(capabilitiesAsStrings()));
case "Outputs":
return Optional.ofNullable(clazz.cast(outputs()));
case "RoleARN":
return Optional.ofNullable(clazz.cast(roleARN()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
case "EnableTerminationProtection":
return Optional.ofNullable(clazz.cast(enableTerminationProtection()));
case "ParentId":
return Optional.ofNullable(clazz.cast(parentId()));
case "RootId":
return Optional.ofNullable(clazz.cast(rootId()));
case "DriftInformation":
return Optional.ofNullable(clazz.cast(driftInformation()));
case "RetainExceptOnCreate":
return Optional.ofNullable(clazz.cast(retainExceptOnCreate()));
case "DeletionMode":
return Optional.ofNullable(clazz.cast(deletionModeAsString()));
case "DetailedStatus":
return Optional.ofNullable(clazz.cast(detailedStatusAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("StackId", STACK_ID_FIELD);
map.put("StackName", STACK_NAME_FIELD);
map.put("ChangeSetId", CHANGE_SET_ID_FIELD);
map.put("Description", DESCRIPTION_FIELD);
map.put("Parameters", PARAMETERS_FIELD);
map.put("CreationTime", CREATION_TIME_FIELD);
map.put("DeletionTime", DELETION_TIME_FIELD);
map.put("LastUpdatedTime", LAST_UPDATED_TIME_FIELD);
map.put("RollbackConfiguration", ROLLBACK_CONFIGURATION_FIELD);
map.put("StackStatus", STACK_STATUS_FIELD);
map.put("StackStatusReason", STACK_STATUS_REASON_FIELD);
map.put("DisableRollback", DISABLE_ROLLBACK_FIELD);
map.put("NotificationARNs", NOTIFICATION_AR_NS_FIELD);
map.put("TimeoutInMinutes", TIMEOUT_IN_MINUTES_FIELD);
map.put("Capabilities", CAPABILITIES_FIELD);
map.put("Outputs", OUTPUTS_FIELD);
map.put("RoleARN", ROLE_ARN_FIELD);
map.put("Tags", TAGS_FIELD);
map.put("EnableTerminationProtection", ENABLE_TERMINATION_PROTECTION_FIELD);
map.put("ParentId", PARENT_ID_FIELD);
map.put("RootId", ROOT_ID_FIELD);
map.put("DriftInformation", DRIFT_INFORMATION_FIELD);
map.put("RetainExceptOnCreate", RETAIN_EXCEPT_ON_CREATE_FIELD);
map.put("DeletionMode", DELETION_MODE_FIELD);
map.put("DetailedStatus", DETAILED_STATUS_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function getter(Function g) {
return obj -> g.apply((Stack) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* Unique identifier of the stack.
*
*
* @param stackId
* Unique identifier of the stack.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stackId(String stackId);
/**
*
* The name associated with the stack.
*
*
* @param stackName
* The name associated with the stack.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stackName(String stackName);
/**
*
* The unique ID of the change set.
*
*
* @param changeSetId
* The unique ID of the change set.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder changeSetId(String changeSetId);
/**
*
* A user-defined description associated with the stack.
*
*
* @param description
* A user-defined description associated with the stack.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder description(String description);
/**
*
* A list of Parameter
structures.
*
*
* @param parameters
* A list of Parameter
structures.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder parameters(Collection parameters);
/**
*
* A list of Parameter
structures.
*
*
* @param parameters
* A list of Parameter
structures.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder parameters(Parameter... parameters);
/**
*
* A list of Parameter
structures.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.cloudformation.model.Parameter.Builder} avoiding the need to create
* one manually via {@link software.amazon.awssdk.services.cloudformation.model.Parameter#builder()}.
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.cloudformation.model.Parameter.Builder#build()} is called immediately
* and its result is passed to {@link #parameters(List)}.
*
* @param parameters
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.cloudformation.model.Parameter.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #parameters(java.util.Collection)
*/
Builder parameters(Consumer... parameters);
/**
*
* The time at which the stack was created.
*
*
* @param creationTime
* The time at which the stack was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder creationTime(Instant creationTime);
/**
*
* The time the stack was deleted.
*
*
* @param deletionTime
* The time the stack was deleted.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder deletionTime(Instant deletionTime);
/**
*
* The time the stack was last updated. This field will only be returned if the stack has been updated at least
* once.
*
*
* @param lastUpdatedTime
* The time the stack was last updated. This field will only be returned if the stack has been updated at
* least once.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder lastUpdatedTime(Instant lastUpdatedTime);
/**
*
* The rollback triggers for CloudFormation to monitor during stack creation and updating operations, and for
* the specified monitoring period afterwards.
*
*
* @param rollbackConfiguration
* The rollback triggers for CloudFormation to monitor during stack creation and updating operations, and
* for the specified monitoring period afterwards.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder rollbackConfiguration(RollbackConfiguration rollbackConfiguration);
/**
*
* The rollback triggers for CloudFormation to monitor during stack creation and updating operations, and for
* the specified monitoring period afterwards.
*
* This is a convenience method that creates an instance of the {@link RollbackConfiguration.Builder} avoiding
* the need to create one manually via {@link RollbackConfiguration#builder()}.
*
*
* When the {@link Consumer} completes, {@link RollbackConfiguration.Builder#build()} is called immediately and
* its result is passed to {@link #rollbackConfiguration(RollbackConfiguration)}.
*
* @param rollbackConfiguration
* a consumer that will call methods on {@link RollbackConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #rollbackConfiguration(RollbackConfiguration)
*/
default Builder rollbackConfiguration(Consumer rollbackConfiguration) {
return rollbackConfiguration(RollbackConfiguration.builder().applyMutation(rollbackConfiguration).build());
}
/**
*
* Current status of the stack.
*
*
* @param stackStatus
* Current status of the stack.
* @see StackStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see StackStatus
*/
Builder stackStatus(String stackStatus);
/**
*
* Current status of the stack.
*
*
* @param stackStatus
* Current status of the stack.
* @see StackStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see StackStatus
*/
Builder stackStatus(StackStatus stackStatus);
/**
*
* Success/failure message associated with the stack status.
*
*
* @param stackStatusReason
* Success/failure message associated with the stack status.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stackStatusReason(String stackStatusReason);
/**
*
* Boolean to enable or disable rollback on stack creation failures:
*
*
*
* @param disableRollback
* Boolean to enable or disable rollback on stack creation failures:
*
*
*
* true
: disable rollback.
*
*
*
*
* false
: enable rollback.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder disableRollback(Boolean disableRollback);
/**
*
* Amazon SNS topic Amazon Resource Names (ARNs) to which stack related events are published.
*
*
* @param notificationARNs
* Amazon SNS topic Amazon Resource Names (ARNs) to which stack related events are published.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder notificationARNs(Collection notificationARNs);
/**
*
* Amazon SNS topic Amazon Resource Names (ARNs) to which stack related events are published.
*
*
* @param notificationARNs
* Amazon SNS topic Amazon Resource Names (ARNs) to which stack related events are published.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder notificationARNs(String... notificationARNs);
/**
*
* The amount of time within which stack creation should complete.
*
*
* @param timeoutInMinutes
* The amount of time within which stack creation should complete.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder timeoutInMinutes(Integer timeoutInMinutes);
/**
*
* The capabilities allowed in the stack.
*
*
* @param capabilities
* The capabilities allowed in the stack.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder capabilitiesWithStrings(Collection capabilities);
/**
*
* The capabilities allowed in the stack.
*
*
* @param capabilities
* The capabilities allowed in the stack.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder capabilitiesWithStrings(String... capabilities);
/**
*
* The capabilities allowed in the stack.
*
*
* @param capabilities
* The capabilities allowed in the stack.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder capabilities(Collection capabilities);
/**
*
* The capabilities allowed in the stack.
*
*
* @param capabilities
* The capabilities allowed in the stack.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder capabilities(Capability... capabilities);
/**
*
* A list of output structures.
*
*
* @param outputs
* A list of output structures.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder outputs(Collection outputs);
/**
*
* A list of output structures.
*
*
* @param outputs
* A list of output structures.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder outputs(Output... outputs);
/**
*
* A list of output structures.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.cloudformation.model.Output.Builder} avoiding the need to create one
* manually via {@link software.amazon.awssdk.services.cloudformation.model.Output#builder()}.
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.cloudformation.model.Output.Builder#build()} is called immediately and
* its result is passed to {@link #outputs(List)}.
*
* @param outputs
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.cloudformation.model.Output.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #outputs(java.util.Collection)
*/
Builder outputs(Consumer... outputs);
/**
*
* The Amazon Resource Name (ARN) of an IAM role that's associated with the stack. During a stack operation,
* CloudFormation uses this role's credentials to make calls on your behalf.
*
*
* @param roleARN
* The Amazon Resource Name (ARN) of an IAM role that's associated with the stack. During a stack
* operation, CloudFormation uses this role's credentials to make calls on your behalf.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder roleARN(String roleARN);
/**
*
* A list of Tag
s that specify information about the stack.
*
*
* @param tags
* A list of Tag
s that specify information about the stack.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Collection tags);
/**
*
* A list of Tag
s that specify information about the stack.
*
*
* @param tags
* A list of Tag
s that specify information about the stack.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Tag... tags);
/**
*
* A list of Tag
s that specify information about the stack.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.cloudformation.model.Tag.Builder} avoiding the need to create one
* manually via {@link software.amazon.awssdk.services.cloudformation.model.Tag#builder()}.
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.cloudformation.model.Tag.Builder#build()} is called immediately and
* its result is passed to {@link #tags(List)}.
*
* @param tags
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.cloudformation.model.Tag.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #tags(java.util.Collection)
*/
Builder tags(Consumer... tags);
/**
*
* Whether termination protection is enabled for the stack.
*
*
* For nested
* stacks , termination protection is set on the root stack and can't be changed directly on the nested
* stack. For more information, see Protect a
* CloudFormation stack from being deleted in the CloudFormation User Guide .
*
*
* @param enableTerminationProtection
* Whether termination protection is enabled for the stack.
*
* For nested stacks , termination protection is set on the root stack and can't be changed directly on
* the nested stack. For more information, see Protect a CloudFormation stack from being deleted in the CloudFormation User Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder enableTerminationProtection(Boolean enableTerminationProtection);
/**
*
* For nested stacks--stacks created as resources for another stack--the stack ID of the direct parent of this
* stack. For the first level of nested stacks, the root stack is also the parent stack.
*
*
* For more information, see Embed
* stacks within other stacks using nested stacks in the CloudFormation User Guide .
*
*
* @param parentId
* For nested stacks--stacks created as resources for another stack--the stack ID of the direct parent of
* this stack. For the first level of nested stacks, the root stack is also the parent stack.
*
* For more information, see Embed stacks within other stacks using nested stacks in the CloudFormation User Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder parentId(String parentId);
/**
*
* For nested stacks--stacks created as resources for another stack--the stack ID of the top-level stack to
* which the nested stack ultimately belongs.
*
*
* For more information, see Embed
* stacks within other stacks using nested stacks in the CloudFormation User Guide .
*
*
* @param rootId
* For nested stacks--stacks created as resources for another stack--the stack ID of the top-level stack
* to which the nested stack ultimately belongs.
*
* For more information, see Embed stacks within other stacks using nested stacks in the CloudFormation User Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder rootId(String rootId);
/**
*
* Information about whether a stack's actual configuration differs, or has drifted , from its expected
* configuration, as defined in the stack template and any values specified as template parameters. For more
* information, see Detect
* unmanaged configuration changes to stacks and resources with drift detection .
*
*
* @param driftInformation
* Information about whether a stack's actual configuration differs, or has drifted , from its
* expected configuration, as defined in the stack template and any values specified as template
* parameters. For more information, see Detect unmanaged configuration changes to stacks and resources with drift detection .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder driftInformation(StackDriftInformation driftInformation);
/**
*
* Information about whether a stack's actual configuration differs, or has drifted , from its expected
* configuration, as defined in the stack template and any values specified as template parameters. For more
* information, see Detect
* unmanaged configuration changes to stacks and resources with drift detection .
*
* This is a convenience method that creates an instance of the {@link StackDriftInformation.Builder} avoiding
* the need to create one manually via {@link StackDriftInformation#builder()}.
*
*
* When the {@link Consumer} completes, {@link StackDriftInformation.Builder#build()} is called immediately and
* its result is passed to {@link #driftInformation(StackDriftInformation)}.
*
* @param driftInformation
* a consumer that will call methods on {@link StackDriftInformation.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #driftInformation(StackDriftInformation)
*/
default Builder driftInformation(Consumer driftInformation) {
return driftInformation(StackDriftInformation.builder().applyMutation(driftInformation).build());
}
/**
*
* When set to true
, newly created resources are deleted when the operation rolls back. This
* includes newly created resources marked with a deletion policy of Retain
.
*
*
* Default: false
*
*
* @param retainExceptOnCreate
* When set to true
, newly created resources are deleted when the operation rolls back. This
* includes newly created resources marked with a deletion policy of Retain
.
*
* Default: false
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder retainExceptOnCreate(Boolean retainExceptOnCreate);
/**
*
* Specifies the deletion mode for the stack. Possible values are:
*
*
*
*
* STANDARD
- Use the standard behavior. Specifying this value is the same as not specifying this
* parameter.
*
*
*
*
* FORCE_DELETE_STACK
- Delete the stack if it's stuck in a DELETE_FAILED
state due to
* resource deletion failure.
*
*
*
*
* @param deletionMode
* Specifies the deletion mode for the stack. Possible values are:
*
*
*
* STANDARD
- Use the standard behavior. Specifying this value is the same as not specifying
* this parameter.
*
*
*
*
* FORCE_DELETE_STACK
- Delete the stack if it's stuck in a DELETE_FAILED
state
* due to resource deletion failure.
*
*
* @see DeletionMode
* @return Returns a reference to this object so that method calls can be chained together.
* @see DeletionMode
*/
Builder deletionMode(String deletionMode);
/**
*
* Specifies the deletion mode for the stack. Possible values are:
*
*
*
*
* STANDARD
- Use the standard behavior. Specifying this value is the same as not specifying this
* parameter.
*
*
*
*
* FORCE_DELETE_STACK
- Delete the stack if it's stuck in a DELETE_FAILED
state due to
* resource deletion failure.
*
*
*
*
* @param deletionMode
* Specifies the deletion mode for the stack. Possible values are:
*
*
*
* STANDARD
- Use the standard behavior. Specifying this value is the same as not specifying
* this parameter.
*
*
*
*
* FORCE_DELETE_STACK
- Delete the stack if it's stuck in a DELETE_FAILED
state
* due to resource deletion failure.
*
*
* @see DeletionMode
* @return Returns a reference to this object so that method calls can be chained together.
* @see DeletionMode
*/
Builder deletionMode(DeletionMode deletionMode);
/**
*
* The detailed status of the resource or stack. If CONFIGURATION_COMPLETE
is present, the resource
* or resource configuration phase has completed and the stabilization of the resources is in progress. The
* stack sets CONFIGURATION_COMPLETE
when all of the resources in the stack have reached that
* event. For more information, see Understand CloudFormation stack creation events in the CloudFormation User Guide .
*
*
* @param detailedStatus
* The detailed status of the resource or stack. If CONFIGURATION_COMPLETE
is present, the
* resource or resource configuration phase has completed and the stabilization of the resources is in
* progress. The stack sets CONFIGURATION_COMPLETE
when all of the resources in the stack
* have reached that event. For more information, see Understand CloudFormation stack creation events in the CloudFormation User Guide .
* @see DetailedStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see DetailedStatus
*/
Builder detailedStatus(String detailedStatus);
/**
*
* The detailed status of the resource or stack. If CONFIGURATION_COMPLETE
is present, the resource
* or resource configuration phase has completed and the stabilization of the resources is in progress. The
* stack sets CONFIGURATION_COMPLETE
when all of the resources in the stack have reached that
* event. For more information, see Understand CloudFormation stack creation events in the CloudFormation User Guide .
*
*
* @param detailedStatus
* The detailed status of the resource or stack. If CONFIGURATION_COMPLETE
is present, the
* resource or resource configuration phase has completed and the stabilization of the resources is in
* progress. The stack sets CONFIGURATION_COMPLETE
when all of the resources in the stack
* have reached that event. For more information, see Understand CloudFormation stack creation events in the CloudFormation User Guide .
* @see DetailedStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see DetailedStatus
*/
Builder detailedStatus(DetailedStatus detailedStatus);
}
static final class BuilderImpl implements Builder {
private String stackId;
private String stackName;
private String changeSetId;
private String description;
private List parameters = DefaultSdkAutoConstructList.getInstance();
private Instant creationTime;
private Instant deletionTime;
private Instant lastUpdatedTime;
private RollbackConfiguration rollbackConfiguration;
private String stackStatus;
private String stackStatusReason;
private Boolean disableRollback;
private List notificationARNs = DefaultSdkAutoConstructList.getInstance();
private Integer timeoutInMinutes;
private List capabilities = DefaultSdkAutoConstructList.getInstance();
private List outputs = DefaultSdkAutoConstructList.getInstance();
private String roleARN;
private List tags = DefaultSdkAutoConstructList.getInstance();
private Boolean enableTerminationProtection;
private String parentId;
private String rootId;
private StackDriftInformation driftInformation;
private Boolean retainExceptOnCreate;
private String deletionMode;
private String detailedStatus;
private BuilderImpl() {
}
private BuilderImpl(Stack model) {
stackId(model.stackId);
stackName(model.stackName);
changeSetId(model.changeSetId);
description(model.description);
parameters(model.parameters);
creationTime(model.creationTime);
deletionTime(model.deletionTime);
lastUpdatedTime(model.lastUpdatedTime);
rollbackConfiguration(model.rollbackConfiguration);
stackStatus(model.stackStatus);
stackStatusReason(model.stackStatusReason);
disableRollback(model.disableRollback);
notificationARNs(model.notificationARNs);
timeoutInMinutes(model.timeoutInMinutes);
capabilitiesWithStrings(model.capabilities);
outputs(model.outputs);
roleARN(model.roleARN);
tags(model.tags);
enableTerminationProtection(model.enableTerminationProtection);
parentId(model.parentId);
rootId(model.rootId);
driftInformation(model.driftInformation);
retainExceptOnCreate(model.retainExceptOnCreate);
deletionMode(model.deletionMode);
detailedStatus(model.detailedStatus);
}
public final String getStackId() {
return stackId;
}
public final void setStackId(String stackId) {
this.stackId = stackId;
}
@Override
public final Builder stackId(String stackId) {
this.stackId = stackId;
return this;
}
public final String getStackName() {
return stackName;
}
public final void setStackName(String stackName) {
this.stackName = stackName;
}
@Override
public final Builder stackName(String stackName) {
this.stackName = stackName;
return this;
}
public final String getChangeSetId() {
return changeSetId;
}
public final void setChangeSetId(String changeSetId) {
this.changeSetId = changeSetId;
}
@Override
public final Builder changeSetId(String changeSetId) {
this.changeSetId = changeSetId;
return this;
}
public final String getDescription() {
return description;
}
public final void setDescription(String description) {
this.description = description;
}
@Override
public final Builder description(String description) {
this.description = description;
return this;
}
public final List getParameters() {
List result = ParametersCopier.copyToBuilder(this.parameters);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setParameters(Collection parameters) {
this.parameters = ParametersCopier.copyFromBuilder(parameters);
}
@Override
public final Builder parameters(Collection parameters) {
this.parameters = ParametersCopier.copy(parameters);
return this;
}
@Override
@SafeVarargs
public final Builder parameters(Parameter... parameters) {
parameters(Arrays.asList(parameters));
return this;
}
@Override
@SafeVarargs
public final Builder parameters(Consumer... parameters) {
parameters(Stream.of(parameters).map(c -> Parameter.builder().applyMutation(c).build()).collect(Collectors.toList()));
return this;
}
public final Instant getCreationTime() {
return creationTime;
}
public final void setCreationTime(Instant creationTime) {
this.creationTime = creationTime;
}
@Override
public final Builder creationTime(Instant creationTime) {
this.creationTime = creationTime;
return this;
}
public final Instant getDeletionTime() {
return deletionTime;
}
public final void setDeletionTime(Instant deletionTime) {
this.deletionTime = deletionTime;
}
@Override
public final Builder deletionTime(Instant deletionTime) {
this.deletionTime = deletionTime;
return this;
}
public final Instant getLastUpdatedTime() {
return lastUpdatedTime;
}
public final void setLastUpdatedTime(Instant lastUpdatedTime) {
this.lastUpdatedTime = lastUpdatedTime;
}
@Override
public final Builder lastUpdatedTime(Instant lastUpdatedTime) {
this.lastUpdatedTime = lastUpdatedTime;
return this;
}
public final RollbackConfiguration.Builder getRollbackConfiguration() {
return rollbackConfiguration != null ? rollbackConfiguration.toBuilder() : null;
}
public final void setRollbackConfiguration(RollbackConfiguration.BuilderImpl rollbackConfiguration) {
this.rollbackConfiguration = rollbackConfiguration != null ? rollbackConfiguration.build() : null;
}
@Override
public final Builder rollbackConfiguration(RollbackConfiguration rollbackConfiguration) {
this.rollbackConfiguration = rollbackConfiguration;
return this;
}
public final String getStackStatus() {
return stackStatus;
}
public final void setStackStatus(String stackStatus) {
this.stackStatus = stackStatus;
}
@Override
public final Builder stackStatus(String stackStatus) {
this.stackStatus = stackStatus;
return this;
}
@Override
public final Builder stackStatus(StackStatus stackStatus) {
this.stackStatus(stackStatus == null ? null : stackStatus.toString());
return this;
}
public final String getStackStatusReason() {
return stackStatusReason;
}
public final void setStackStatusReason(String stackStatusReason) {
this.stackStatusReason = stackStatusReason;
}
@Override
public final Builder stackStatusReason(String stackStatusReason) {
this.stackStatusReason = stackStatusReason;
return this;
}
public final Boolean getDisableRollback() {
return disableRollback;
}
public final void setDisableRollback(Boolean disableRollback) {
this.disableRollback = disableRollback;
}
@Override
public final Builder disableRollback(Boolean disableRollback) {
this.disableRollback = disableRollback;
return this;
}
public final Collection getNotificationARNs() {
if (notificationARNs instanceof SdkAutoConstructList) {
return null;
}
return notificationARNs;
}
public final void setNotificationARNs(Collection notificationARNs) {
this.notificationARNs = NotificationARNsCopier.copy(notificationARNs);
}
@Override
public final Builder notificationARNs(Collection notificationARNs) {
this.notificationARNs = NotificationARNsCopier.copy(notificationARNs);
return this;
}
@Override
@SafeVarargs
public final Builder notificationARNs(String... notificationARNs) {
notificationARNs(Arrays.asList(notificationARNs));
return this;
}
public final Integer getTimeoutInMinutes() {
return timeoutInMinutes;
}
public final void setTimeoutInMinutes(Integer timeoutInMinutes) {
this.timeoutInMinutes = timeoutInMinutes;
}
@Override
public final Builder timeoutInMinutes(Integer timeoutInMinutes) {
this.timeoutInMinutes = timeoutInMinutes;
return this;
}
public final Collection getCapabilities() {
if (capabilities instanceof SdkAutoConstructList) {
return null;
}
return capabilities;
}
public final void setCapabilities(Collection capabilities) {
this.capabilities = CapabilitiesCopier.copy(capabilities);
}
@Override
public final Builder capabilitiesWithStrings(Collection capabilities) {
this.capabilities = CapabilitiesCopier.copy(capabilities);
return this;
}
@Override
@SafeVarargs
public final Builder capabilitiesWithStrings(String... capabilities) {
capabilitiesWithStrings(Arrays.asList(capabilities));
return this;
}
@Override
public final Builder capabilities(Collection capabilities) {
this.capabilities = CapabilitiesCopier.copyEnumToString(capabilities);
return this;
}
@Override
@SafeVarargs
public final Builder capabilities(Capability... capabilities) {
capabilities(Arrays.asList(capabilities));
return this;
}
public final List getOutputs() {
List result = OutputsCopier.copyToBuilder(this.outputs);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setOutputs(Collection outputs) {
this.outputs = OutputsCopier.copyFromBuilder(outputs);
}
@Override
public final Builder outputs(Collection outputs) {
this.outputs = OutputsCopier.copy(outputs);
return this;
}
@Override
@SafeVarargs
public final Builder outputs(Output... outputs) {
outputs(Arrays.asList(outputs));
return this;
}
@Override
@SafeVarargs
public final Builder outputs(Consumer... outputs) {
outputs(Stream.of(outputs).map(c -> Output.builder().applyMutation(c).build()).collect(Collectors.toList()));
return this;
}
public final String getRoleARN() {
return roleARN;
}
public final void setRoleARN(String roleARN) {
this.roleARN = roleARN;
}
@Override
public final Builder roleARN(String roleARN) {
this.roleARN = roleARN;
return this;
}
public final List getTags() {
List result = TagsCopier.copyToBuilder(this.tags);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setTags(Collection tags) {
this.tags = TagsCopier.copyFromBuilder(tags);
}
@Override
public final Builder tags(Collection tags) {
this.tags = TagsCopier.copy(tags);
return this;
}
@Override
@SafeVarargs
public final Builder tags(Tag... tags) {
tags(Arrays.asList(tags));
return this;
}
@Override
@SafeVarargs
public final Builder tags(Consumer... tags) {
tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList()));
return this;
}
public final Boolean getEnableTerminationProtection() {
return enableTerminationProtection;
}
public final void setEnableTerminationProtection(Boolean enableTerminationProtection) {
this.enableTerminationProtection = enableTerminationProtection;
}
@Override
public final Builder enableTerminationProtection(Boolean enableTerminationProtection) {
this.enableTerminationProtection = enableTerminationProtection;
return this;
}
public final String getParentId() {
return parentId;
}
public final void setParentId(String parentId) {
this.parentId = parentId;
}
@Override
public final Builder parentId(String parentId) {
this.parentId = parentId;
return this;
}
public final String getRootId() {
return rootId;
}
public final void setRootId(String rootId) {
this.rootId = rootId;
}
@Override
public final Builder rootId(String rootId) {
this.rootId = rootId;
return this;
}
public final StackDriftInformation.Builder getDriftInformation() {
return driftInformation != null ? driftInformation.toBuilder() : null;
}
public final void setDriftInformation(StackDriftInformation.BuilderImpl driftInformation) {
this.driftInformation = driftInformation != null ? driftInformation.build() : null;
}
@Override
public final Builder driftInformation(StackDriftInformation driftInformation) {
this.driftInformation = driftInformation;
return this;
}
public final Boolean getRetainExceptOnCreate() {
return retainExceptOnCreate;
}
public final void setRetainExceptOnCreate(Boolean retainExceptOnCreate) {
this.retainExceptOnCreate = retainExceptOnCreate;
}
@Override
public final Builder retainExceptOnCreate(Boolean retainExceptOnCreate) {
this.retainExceptOnCreate = retainExceptOnCreate;
return this;
}
public final String getDeletionMode() {
return deletionMode;
}
public final void setDeletionMode(String deletionMode) {
this.deletionMode = deletionMode;
}
@Override
public final Builder deletionMode(String deletionMode) {
this.deletionMode = deletionMode;
return this;
}
@Override
public final Builder deletionMode(DeletionMode deletionMode) {
this.deletionMode(deletionMode == null ? null : deletionMode.toString());
return this;
}
public final String getDetailedStatus() {
return detailedStatus;
}
public final void setDetailedStatus(String detailedStatus) {
this.detailedStatus = detailedStatus;
}
@Override
public final Builder detailedStatus(String detailedStatus) {
this.detailedStatus = detailedStatus;
return this;
}
@Override
public final Builder detailedStatus(DetailedStatus detailedStatus) {
this.detailedStatus(detailedStatus == null ? null : detailedStatus.toString());
return this;
}
@Override
public Stack build() {
return new Stack(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
@Override
public Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
}
}