
software.amazon.awssdk.services.cloudformation.model.CreateChangeSetRequest Maven / Gradle / Ivy
/*
* 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.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
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.awscore.AwsRequestOverrideConfiguration;
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 input for the CreateChangeSet action.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class CreateChangeSetRequest extends CloudFormationRequest implements
ToCopyableBuilder {
private static final SdkField STACK_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StackName").getter(getter(CreateChangeSetRequest::stackName)).setter(setter(Builder::stackName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StackName").build()).build();
private static final SdkField TEMPLATE_BODY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TemplateBody").getter(getter(CreateChangeSetRequest::templateBody))
.setter(setter(Builder::templateBody))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TemplateBody").build()).build();
private static final SdkField TEMPLATE_URL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TemplateURL").getter(getter(CreateChangeSetRequest::templateURL)).setter(setter(Builder::templateURL))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TemplateURL").build()).build();
private static final SdkField USE_PREVIOUS_TEMPLATE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("UsePreviousTemplate").getter(getter(CreateChangeSetRequest::usePreviousTemplate))
.setter(setter(Builder::usePreviousTemplate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UsePreviousTemplate").build())
.build();
private static final SdkField> PARAMETERS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Parameters")
.getter(getter(CreateChangeSetRequest::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> CAPABILITIES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Capabilities")
.getter(getter(CreateChangeSetRequest::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> RESOURCE_TYPES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("ResourceTypes")
.getter(getter(CreateChangeSetRequest::resourceTypes))
.setter(setter(Builder::resourceTypes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceTypes").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 ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RoleARN").getter(getter(CreateChangeSetRequest::roleARN)).setter(setter(Builder::roleARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleARN").build()).build();
private static final SdkField ROLLBACK_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("RollbackConfiguration")
.getter(getter(CreateChangeSetRequest::rollbackConfiguration)).setter(setter(Builder::rollbackConfiguration))
.constructor(RollbackConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RollbackConfiguration").build())
.build();
private static final SdkField> NOTIFICATION_AR_NS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("NotificationARNs")
.getter(getter(CreateChangeSetRequest::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> TAGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Tags")
.getter(getter(CreateChangeSetRequest::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 CHANGE_SET_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ChangeSetName").getter(getter(CreateChangeSetRequest::changeSetName))
.setter(setter(Builder::changeSetName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChangeSetName").build()).build();
private static final SdkField CLIENT_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ClientToken").getter(getter(CreateChangeSetRequest::clientToken)).setter(setter(Builder::clientToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClientToken").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(CreateChangeSetRequest::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField CHANGE_SET_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ChangeSetType").getter(getter(CreateChangeSetRequest::changeSetTypeAsString))
.setter(setter(Builder::changeSetType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChangeSetType").build()).build();
private static final SdkField> RESOURCES_TO_IMPORT_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("ResourcesToImport")
.getter(getter(CreateChangeSetRequest::resourcesToImport))
.setter(setter(Builder::resourcesToImport))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourcesToImport").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(ResourceToImport::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STACK_NAME_FIELD,
TEMPLATE_BODY_FIELD, TEMPLATE_URL_FIELD, USE_PREVIOUS_TEMPLATE_FIELD, PARAMETERS_FIELD, CAPABILITIES_FIELD,
RESOURCE_TYPES_FIELD, ROLE_ARN_FIELD, ROLLBACK_CONFIGURATION_FIELD, NOTIFICATION_AR_NS_FIELD, TAGS_FIELD,
CHANGE_SET_NAME_FIELD, CLIENT_TOKEN_FIELD, DESCRIPTION_FIELD, CHANGE_SET_TYPE_FIELD, RESOURCES_TO_IMPORT_FIELD));
private final String stackName;
private final String templateBody;
private final String templateURL;
private final Boolean usePreviousTemplate;
private final List parameters;
private final List capabilities;
private final List resourceTypes;
private final String roleARN;
private final RollbackConfiguration rollbackConfiguration;
private final List notificationARNs;
private final List tags;
private final String changeSetName;
private final String clientToken;
private final String description;
private final String changeSetType;
private final List resourcesToImport;
private CreateChangeSetRequest(BuilderImpl builder) {
super(builder);
this.stackName = builder.stackName;
this.templateBody = builder.templateBody;
this.templateURL = builder.templateURL;
this.usePreviousTemplate = builder.usePreviousTemplate;
this.parameters = builder.parameters;
this.capabilities = builder.capabilities;
this.resourceTypes = builder.resourceTypes;
this.roleARN = builder.roleARN;
this.rollbackConfiguration = builder.rollbackConfiguration;
this.notificationARNs = builder.notificationARNs;
this.tags = builder.tags;
this.changeSetName = builder.changeSetName;
this.clientToken = builder.clientToken;
this.description = builder.description;
this.changeSetType = builder.changeSetType;
this.resourcesToImport = builder.resourcesToImport;
}
/**
*
* The name or the unique ID of the stack for which you are creating a change set. AWS CloudFormation generates the
* change set by comparing this stack's information with the information that you submit, such as a modified
* template or different parameter input values.
*
*
* @return The name or the unique ID of the stack for which you are creating a change set. AWS CloudFormation
* generates the change set by comparing this stack's information with the information that you submit, such
* as a modified template or different parameter input values.
*/
public String stackName() {
return stackName;
}
/**
*
* A structure that contains the body of the revised template, with a minimum length of 1 byte and a maximum length
* of 51,200 bytes. AWS CloudFormation generates the change set by comparing this template with the template of the
* stack that you specified.
*
*
* Conditional: You must specify only TemplateBody
or TemplateURL
.
*
*
* @return A structure that contains the body of the revised template, with a minimum length of 1 byte and a maximum
* length of 51,200 bytes. AWS CloudFormation generates the change set by comparing this template with the
* template of the stack that you specified.
*
* Conditional: You must specify only TemplateBody
or TemplateURL
.
*/
public String templateBody() {
return templateBody;
}
/**
*
* The location of the file that contains the revised template. The URL must point to a template (max size: 460,800
* bytes) that is located in an S3 bucket. AWS CloudFormation generates the change set by comparing this template
* with the stack that you specified.
*
*
* Conditional: You must specify only TemplateBody
or TemplateURL
.
*
*
* @return The location of the file that contains the revised template. The URL must point to a template (max size:
* 460,800 bytes) that is located in an S3 bucket. AWS CloudFormation generates the change set by comparing
* this template with the stack that you specified.
*
* Conditional: You must specify only TemplateBody
or TemplateURL
.
*/
public String templateURL() {
return templateURL;
}
/**
*
* Whether to reuse the template that is associated with the stack to create the change set.
*
*
* @return Whether to reuse the template that is associated with the stack to create the change set.
*/
public Boolean usePreviousTemplate() {
return usePreviousTemplate;
}
/**
* Returns true if the Parameters property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasParameters() {
return parameters != null && !(parameters instanceof SdkAutoConstructList);
}
/**
*
* A list of Parameter
structures that specify input parameters for the change set. For more
* information, see the Parameter data type.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasParameters()} to see if a value was sent in this field.
*
*
* @return A list of Parameter
structures that specify input parameters for the change set. For more
* information, see the Parameter data type.
*/
public List parameters() {
return parameters;
}
/**
*
* In some cases, you must explicitly acknowledge that your stack template contains certain capabilities in order
* for AWS CloudFormation to create the stack.
*
*
* -
*
* CAPABILITY_IAM
and CAPABILITY_NAMED_IAM
*
*
* Some stack templates might include resources that can affect permissions in your AWS account; for example, by
* creating new AWS Identity and Access Management (IAM) users. For those stacks, you must explicitly acknowledge
* this by specifying one of these capabilities.
*
*
* The following IAM resources require you to specify either the CAPABILITY_IAM
or
* CAPABILITY_NAMED_IAM
capability.
*
*
* -
*
* If you have IAM resources, you can specify either capability.
*
*
* -
*
* If you have IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM
.
*
*
* -
*
* If you don't specify either of these capabilities, AWS CloudFormation returns an
* InsufficientCapabilities
error.
*
*
*
*
* If your stack template contains these resources, we recommend that you review all permissions associated with
* them and edit their permissions if necessary.
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* AWS::IAM::Role
*
*
* -
*
*
* AWS::IAM::User
*
*
* -
*
*
*
*
* For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
*
*
* -
*
* CAPABILITY_AUTO_EXPAND
*
*
* Some template contain macros. Macros perform custom processing on templates; this can include simple actions like
* find-and-replace operations, all the way to extensive transformations of entire templates. Because of this, users
* typically create a change set from the processed template, so that they can review the changes resulting from the
* macros before actually creating the stack. If your stack template contains one or more macros, and you choose to
* create a stack directly from the processed template, without first reviewing the resulting changes in a change
* set, you must acknowledge this capability. This includes the AWS::Include and AWS::Serverless transforms, which are macros hosted by AWS CloudFormation.
*
*
*
* This capacity does not apply to creating change sets, and specifying it when creating change sets has no effect.
*
*
* Also, change sets do not currently support nested stacks. If you want to create a stack from a stack template
* that contains macros and nested stacks, you must create or update the stack directly from the template
* using the CreateStack or UpdateStack action, and specifying this capability.
*
*
*
* For more information on macros, see Using AWS
* CloudFormation Macros to Perform Custom Processing on Templates.
*
*
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasCapabilities()} to see if a value was sent in this field.
*
*
* @return In some cases, you must explicitly acknowledge that your stack template contains certain capabilities in
* order for AWS CloudFormation to create the stack.
*
* -
*
* CAPABILITY_IAM
and CAPABILITY_NAMED_IAM
*
*
* Some stack templates might include resources that can affect permissions in your AWS account; for
* example, by creating new AWS Identity and Access Management (IAM) users. For those stacks, you must
* explicitly acknowledge this by specifying one of these capabilities.
*
*
* The following IAM resources require you to specify either the CAPABILITY_IAM
or
* CAPABILITY_NAMED_IAM
capability.
*
*
* -
*
* If you have IAM resources, you can specify either capability.
*
*
* -
*
* If you have IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM
.
*
*
* -
*
* If you don't specify either of these capabilities, AWS CloudFormation returns an
* InsufficientCapabilities
error.
*
*
*
*
* If your stack template contains these resources, we recommend that you review all permissions associated
* with them and edit their permissions if necessary.
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* AWS::IAM::Role
*
*
* -
*
*
* AWS::IAM::User
*
*
* -
*
*
*
*
* For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
*
*
* -
*
* CAPABILITY_AUTO_EXPAND
*
*
* Some template contain macros. Macros perform custom processing on templates; this can include simple
* actions like find-and-replace operations, all the way to extensive transformations of entire templates.
* Because of this, users typically create a change set from the processed template, so that they can review
* the changes resulting from the macros before actually creating the stack. If your stack template contains
* one or more macros, and you choose to create a stack directly from the processed template, without first
* reviewing the resulting changes in a change set, you must acknowledge this capability. This includes the
* AWS::Include and AWS::Serverless transforms, which are macros hosted by AWS CloudFormation.
*
*
*
* This capacity does not apply to creating change sets, and specifying it when creating change sets has no
* effect.
*
*
* Also, change sets do not currently support nested stacks. If you want to create a stack from a stack
* template that contains macros and nested stacks, you must create or update the stack directly from
* the template using the CreateStack or UpdateStack action, and specifying this capability.
*
*
*
* For more information on macros, see Using AWS
* CloudFormation Macros to Perform Custom Processing on Templates.
*
*
*/
public List capabilities() {
return CapabilitiesCopier.copyStringToEnum(capabilities);
}
/**
* Returns true if the Capabilities property was specified by the sender (it may be empty), or false if the sender
* did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasCapabilities() {
return capabilities != null && !(capabilities instanceof SdkAutoConstructList);
}
/**
*
* In some cases, you must explicitly acknowledge that your stack template contains certain capabilities in order
* for AWS CloudFormation to create the stack.
*
*
* -
*
* CAPABILITY_IAM
and CAPABILITY_NAMED_IAM
*
*
* Some stack templates might include resources that can affect permissions in your AWS account; for example, by
* creating new AWS Identity and Access Management (IAM) users. For those stacks, you must explicitly acknowledge
* this by specifying one of these capabilities.
*
*
* The following IAM resources require you to specify either the CAPABILITY_IAM
or
* CAPABILITY_NAMED_IAM
capability.
*
*
* -
*
* If you have IAM resources, you can specify either capability.
*
*
* -
*
* If you have IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM
.
*
*
* -
*
* If you don't specify either of these capabilities, AWS CloudFormation returns an
* InsufficientCapabilities
error.
*
*
*
*
* If your stack template contains these resources, we recommend that you review all permissions associated with
* them and edit their permissions if necessary.
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* AWS::IAM::Role
*
*
* -
*
*
* AWS::IAM::User
*
*
* -
*
*
*
*
* For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
*
*
* -
*
* CAPABILITY_AUTO_EXPAND
*
*
* Some template contain macros. Macros perform custom processing on templates; this can include simple actions like
* find-and-replace operations, all the way to extensive transformations of entire templates. Because of this, users
* typically create a change set from the processed template, so that they can review the changes resulting from the
* macros before actually creating the stack. If your stack template contains one or more macros, and you choose to
* create a stack directly from the processed template, without first reviewing the resulting changes in a change
* set, you must acknowledge this capability. This includes the AWS::Include and AWS::Serverless transforms, which are macros hosted by AWS CloudFormation.
*
*
*
* This capacity does not apply to creating change sets, and specifying it when creating change sets has no effect.
*
*
* Also, change sets do not currently support nested stacks. If you want to create a stack from a stack template
* that contains macros and nested stacks, you must create or update the stack directly from the template
* using the CreateStack or UpdateStack action, and specifying this capability.
*
*
*
* For more information on macros, see Using AWS
* CloudFormation Macros to Perform Custom Processing on Templates.
*
*
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasCapabilities()} to see if a value was sent in this field.
*
*
* @return In some cases, you must explicitly acknowledge that your stack template contains certain capabilities in
* order for AWS CloudFormation to create the stack.
*
* -
*
* CAPABILITY_IAM
and CAPABILITY_NAMED_IAM
*
*
* Some stack templates might include resources that can affect permissions in your AWS account; for
* example, by creating new AWS Identity and Access Management (IAM) users. For those stacks, you must
* explicitly acknowledge this by specifying one of these capabilities.
*
*
* The following IAM resources require you to specify either the CAPABILITY_IAM
or
* CAPABILITY_NAMED_IAM
capability.
*
*
* -
*
* If you have IAM resources, you can specify either capability.
*
*
* -
*
* If you have IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM
.
*
*
* -
*
* If you don't specify either of these capabilities, AWS CloudFormation returns an
* InsufficientCapabilities
error.
*
*
*
*
* If your stack template contains these resources, we recommend that you review all permissions associated
* with them and edit their permissions if necessary.
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* AWS::IAM::Role
*
*
* -
*
*
* AWS::IAM::User
*
*
* -
*
*
*
*
* For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
*
*
* -
*
* CAPABILITY_AUTO_EXPAND
*
*
* Some template contain macros. Macros perform custom processing on templates; this can include simple
* actions like find-and-replace operations, all the way to extensive transformations of entire templates.
* Because of this, users typically create a change set from the processed template, so that they can review
* the changes resulting from the macros before actually creating the stack. If your stack template contains
* one or more macros, and you choose to create a stack directly from the processed template, without first
* reviewing the resulting changes in a change set, you must acknowledge this capability. This includes the
* AWS::Include and AWS::Serverless transforms, which are macros hosted by AWS CloudFormation.
*
*
*
* This capacity does not apply to creating change sets, and specifying it when creating change sets has no
* effect.
*
*
* Also, change sets do not currently support nested stacks. If you want to create a stack from a stack
* template that contains macros and nested stacks, you must create or update the stack directly from
* the template using the CreateStack or UpdateStack action, and specifying this capability.
*
*
*
* For more information on macros, see Using AWS
* CloudFormation Macros to Perform Custom Processing on Templates.
*
*
*/
public List capabilitiesAsStrings() {
return capabilities;
}
/**
* Returns true if the ResourceTypes property was specified by the sender (it may be empty), or false if the sender
* did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasResourceTypes() {
return resourceTypes != null && !(resourceTypes instanceof SdkAutoConstructList);
}
/**
*
* The template resource types that you have permissions to work with if you execute this change set, such as
* AWS::EC2::Instance
, AWS::EC2::*
, or Custom::MyCustomInstance
.
*
*
* If the list of resource types doesn't include a resource type that you're updating, the stack update fails. By
* default, AWS CloudFormation grants permissions to all resource types. AWS Identity and Access Management (IAM)
* uses this parameter for condition keys in IAM policies for AWS CloudFormation. For more information, see Controlling Access
* with AWS Identity and Access Management in the AWS CloudFormation User Guide.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasResourceTypes()} to see if a value was sent in this field.
*
*
* @return The template resource types that you have permissions to work with if you execute this change set, such
* as AWS::EC2::Instance
, AWS::EC2::*
, or Custom::MyCustomInstance
* .
*
* If the list of resource types doesn't include a resource type that you're updating, the stack update
* fails. By default, AWS CloudFormation grants permissions to all resource types. AWS Identity and Access
* Management (IAM) uses this parameter for condition keys in IAM policies for AWS CloudFormation. For more
* information, see Controlling
* Access with AWS Identity and Access Management in the AWS CloudFormation User Guide.
*/
public List resourceTypes() {
return resourceTypes;
}
/**
*
* The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) role that AWS CloudFormation
* assumes when executing the change set. AWS CloudFormation uses the role's credentials to make calls on your
* behalf. AWS CloudFormation uses this role for all future operations on the stack. As long as users have
* permission to operate on the stack, AWS CloudFormation uses this role even if the users don't have permission to
* pass it. Ensure that the role grants least privilege.
*
*
* If you don't specify a value, AWS CloudFormation uses the role that was previously associated with the stack. If
* no role is available, AWS CloudFormation uses a temporary session that is generated from your user credentials.
*
*
* @return The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) role that AWS
* CloudFormation assumes when executing the change set. AWS CloudFormation uses the role's credentials to
* make calls on your behalf. AWS CloudFormation uses this role for all future operations on the stack. As
* long as users have permission to operate on the stack, AWS CloudFormation uses this role even if the
* users don't have permission to pass it. Ensure that the role grants least privilege.
*
* If you don't specify a value, AWS CloudFormation uses the role that was previously associated with the
* stack. If no role is available, AWS CloudFormation uses a temporary session that is generated from your
* user credentials.
*/
public String roleARN() {
return roleARN;
}
/**
*
* The rollback triggers for AWS CloudFormation to monitor during stack creation and updating operations, and for
* the specified monitoring period afterwards.
*
*
* @return The rollback triggers for AWS CloudFormation to monitor during stack creation and updating operations,
* and for the specified monitoring period afterwards.
*/
public RollbackConfiguration rollbackConfiguration() {
return rollbackConfiguration;
}
/**
* Returns true if the NotificationARNs property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public boolean hasNotificationARNs() {
return notificationARNs != null && !(notificationARNs instanceof SdkAutoConstructList);
}
/**
*
* The Amazon Resource Names (ARNs) of Amazon Simple Notification Service (Amazon SNS) topics that AWS
* CloudFormation associates with the stack. To remove all associated notification topics, specify an empty list.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasNotificationARNs()} to see if a value was sent in this field.
*
*
* @return The Amazon Resource Names (ARNs) of Amazon Simple Notification Service (Amazon SNS) topics that AWS
* CloudFormation associates with the stack. To remove all associated notification topics, specify an empty
* list.
*/
public List notificationARNs() {
return notificationARNs;
}
/**
* Returns true if the Tags property was specified by the sender (it may be empty), or false if the sender did not
* specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructList);
}
/**
*
* Key-value pairs to associate with this stack. AWS CloudFormation also propagates these tags to resources in the
* stack. You can specify a maximum of 50 tags.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasTags()} to see if a value was sent in this field.
*
*
* @return Key-value pairs to associate with this stack. AWS CloudFormation also propagates these tags to resources
* in the stack. You can specify a maximum of 50 tags.
*/
public List tags() {
return tags;
}
/**
*
* The name of the change set. The name must be unique among all change sets that are associated with the specified
* stack.
*
*
* A change set name can contain only alphanumeric, case sensitive characters and hyphens. It must start with an
* alphabetic character and cannot exceed 128 characters.
*
*
* @return The name of the change set. The name must be unique among all change sets that are associated with the
* specified stack.
*
* A change set name can contain only alphanumeric, case sensitive characters and hyphens. It must start
* with an alphabetic character and cannot exceed 128 characters.
*/
public String changeSetName() {
return changeSetName;
}
/**
*
* A unique identifier for this CreateChangeSet
request. Specify this token if you plan to retry
* requests so that AWS CloudFormation knows that you're not attempting to create another change set with the same
* name. You might retry CreateChangeSet
requests to ensure that AWS CloudFormation successfully
* received them.
*
*
* @return A unique identifier for this CreateChangeSet
request. Specify this token if you plan to
* retry requests so that AWS CloudFormation knows that you're not attempting to create another change set
* with the same name. You might retry CreateChangeSet
requests to ensure that AWS
* CloudFormation successfully received them.
*/
public String clientToken() {
return clientToken;
}
/**
*
* A description to help you identify this change set.
*
*
* @return A description to help you identify this change set.
*/
public String description() {
return description;
}
/**
*
* The type of change set operation. To create a change set for a new stack, specify CREATE
. To create
* a change set for an existing stack, specify UPDATE
. To create a change set for an import operation,
* specify IMPORT
.
*
*
* If you create a change set for a new stack, AWS Cloudformation creates a stack with a unique stack ID, but no
* template or resources. The stack will be in the
* REVIEW_IN_PROGRESS
state until you execute the change set.
*
*
* By default, AWS CloudFormation specifies UPDATE
. You can't use the UPDATE
type to
* create a change set for a new stack or the CREATE
type to create a change set for an existing stack.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #changeSetType}
* will return {@link ChangeSetType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #changeSetTypeAsString}.
*
*
* @return The type of change set operation. To create a change set for a new stack, specify CREATE
. To
* create a change set for an existing stack, specify UPDATE
. To create a change set for an
* import operation, specify IMPORT
.
*
* If you create a change set for a new stack, AWS Cloudformation creates a stack with a unique stack ID,
* but no template or resources. The stack will be in the REVIEW_IN_PROGRESS
state until you execute the change set.
*
*
* By default, AWS CloudFormation specifies UPDATE
. You can't use the UPDATE
type
* to create a change set for a new stack or the CREATE
type to create a change set for an
* existing stack.
* @see ChangeSetType
*/
public ChangeSetType changeSetType() {
return ChangeSetType.fromValue(changeSetType);
}
/**
*
* The type of change set operation. To create a change set for a new stack, specify CREATE
. To create
* a change set for an existing stack, specify UPDATE
. To create a change set for an import operation,
* specify IMPORT
.
*
*
* If you create a change set for a new stack, AWS Cloudformation creates a stack with a unique stack ID, but no
* template or resources. The stack will be in the
* REVIEW_IN_PROGRESS
state until you execute the change set.
*
*
* By default, AWS CloudFormation specifies UPDATE
. You can't use the UPDATE
type to
* create a change set for a new stack or the CREATE
type to create a change set for an existing stack.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #changeSetType}
* will return {@link ChangeSetType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #changeSetTypeAsString}.
*
*
* @return The type of change set operation. To create a change set for a new stack, specify CREATE
. To
* create a change set for an existing stack, specify UPDATE
. To create a change set for an
* import operation, specify IMPORT
.
*
* If you create a change set for a new stack, AWS Cloudformation creates a stack with a unique stack ID,
* but no template or resources. The stack will be in the REVIEW_IN_PROGRESS
state until you execute the change set.
*
*
* By default, AWS CloudFormation specifies UPDATE
. You can't use the UPDATE
type
* to create a change set for a new stack or the CREATE
type to create a change set for an
* existing stack.
* @see ChangeSetType
*/
public String changeSetTypeAsString() {
return changeSetType;
}
/**
* Returns true if the ResourcesToImport property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public boolean hasResourcesToImport() {
return resourcesToImport != null && !(resourcesToImport instanceof SdkAutoConstructList);
}
/**
*
* The resources to import into your stack.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasResourcesToImport()} to see if a value was sent in this field.
*
*
* @return The resources to import into your stack.
*/
public List resourcesToImport() {
return resourcesToImport;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(stackName());
hashCode = 31 * hashCode + Objects.hashCode(templateBody());
hashCode = 31 * hashCode + Objects.hashCode(templateURL());
hashCode = 31 * hashCode + Objects.hashCode(usePreviousTemplate());
hashCode = 31 * hashCode + Objects.hashCode(parameters());
hashCode = 31 * hashCode + Objects.hashCode(capabilitiesAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(resourceTypes());
hashCode = 31 * hashCode + Objects.hashCode(roleARN());
hashCode = 31 * hashCode + Objects.hashCode(rollbackConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(notificationARNs());
hashCode = 31 * hashCode + Objects.hashCode(tags());
hashCode = 31 * hashCode + Objects.hashCode(changeSetName());
hashCode = 31 * hashCode + Objects.hashCode(clientToken());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(changeSetTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(resourcesToImport());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof CreateChangeSetRequest)) {
return false;
}
CreateChangeSetRequest other = (CreateChangeSetRequest) obj;
return Objects.equals(stackName(), other.stackName()) && Objects.equals(templateBody(), other.templateBody())
&& Objects.equals(templateURL(), other.templateURL())
&& Objects.equals(usePreviousTemplate(), other.usePreviousTemplate())
&& Objects.equals(parameters(), other.parameters())
&& Objects.equals(capabilitiesAsStrings(), other.capabilitiesAsStrings())
&& Objects.equals(resourceTypes(), other.resourceTypes()) && Objects.equals(roleARN(), other.roleARN())
&& Objects.equals(rollbackConfiguration(), other.rollbackConfiguration())
&& Objects.equals(notificationARNs(), other.notificationARNs()) && Objects.equals(tags(), other.tags())
&& Objects.equals(changeSetName(), other.changeSetName()) && Objects.equals(clientToken(), other.clientToken())
&& Objects.equals(description(), other.description())
&& Objects.equals(changeSetTypeAsString(), other.changeSetTypeAsString())
&& Objects.equals(resourcesToImport(), other.resourcesToImport());
}
/**
* 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 String toString() {
return ToString.builder("CreateChangeSetRequest").add("StackName", stackName()).add("TemplateBody", templateBody())
.add("TemplateURL", templateURL()).add("UsePreviousTemplate", usePreviousTemplate())
.add("Parameters", parameters()).add("Capabilities", capabilitiesAsStrings())
.add("ResourceTypes", resourceTypes()).add("RoleARN", roleARN())
.add("RollbackConfiguration", rollbackConfiguration()).add("NotificationARNs", notificationARNs())
.add("Tags", tags()).add("ChangeSetName", changeSetName()).add("ClientToken", clientToken())
.add("Description", description()).add("ChangeSetType", changeSetTypeAsString())
.add("ResourcesToImport", resourcesToImport()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "StackName":
return Optional.ofNullable(clazz.cast(stackName()));
case "TemplateBody":
return Optional.ofNullable(clazz.cast(templateBody()));
case "TemplateURL":
return Optional.ofNullable(clazz.cast(templateURL()));
case "UsePreviousTemplate":
return Optional.ofNullable(clazz.cast(usePreviousTemplate()));
case "Parameters":
return Optional.ofNullable(clazz.cast(parameters()));
case "Capabilities":
return Optional.ofNullable(clazz.cast(capabilitiesAsStrings()));
case "ResourceTypes":
return Optional.ofNullable(clazz.cast(resourceTypes()));
case "RoleARN":
return Optional.ofNullable(clazz.cast(roleARN()));
case "RollbackConfiguration":
return Optional.ofNullable(clazz.cast(rollbackConfiguration()));
case "NotificationARNs":
return Optional.ofNullable(clazz.cast(notificationARNs()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
case "ChangeSetName":
return Optional.ofNullable(clazz.cast(changeSetName()));
case "ClientToken":
return Optional.ofNullable(clazz.cast(clientToken()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "ChangeSetType":
return Optional.ofNullable(clazz.cast(changeSetTypeAsString()));
case "ResourcesToImport":
return Optional.ofNullable(clazz.cast(resourcesToImport()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function