Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
    * Copyright 2010-2015 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 com.amazonaws.services.cloudformation.model;
  
  
Container for the parameters to the CreateStack operation.

Creates a stack as specified in the template. After the call completes successfully, the stack creation starts. You can check the status of the stack via the DescribeStacks API.

  
  public class CreateStackRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The name associated with the stack. The name must be unique within your AWS account. <note>Must contain only alphanumeric characters (case sensitive) and start with an alpha character. Maximum length of the name is 255 characters.</note>
  
      private String stackName;

    
Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. For more information, go to Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

Constraints:
Length: 1 -

  
      private String templateBody;

    
Location of file containing the template body. The URL must point to a template (max size: 307,200 bytes) located in an S3 bucket in the same region as the stack. For more information, go to the Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

Constraints:
Length: 1 - 1024

  
      private String templateURL;

    
A list of Parameter structures that specify input parameters for the stack.
  
Set to true to disable rollback of the stack if stack creation failed. You can specify either DisableRollback or OnFailure, but not both.

Default: false

  
      private Boolean disableRollback;

    
The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

Constraints:
Range: 1 -

  
      private Integer timeoutInMinutes;

    
The Simple Notification Service (SNS) topic ARNs to publish stack related events. You can find your SNS topic ARNs using the SNS console or your Command Line Interface (CLI).

Constraints:
Length: 0 - 5

 
A list of capabilities that you must specify before AWS CloudFormation can create or update certain stacks. Some stack templates might include resources that can affect permissions in your AWS account. For those stacks, you must explicitly acknowledge their capabilities by specifying this parameter.

Currently, the only valid value is CAPABILITY_IAM, which is required for the following resources: AWS::CloudFormation::Stack, AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, and AWS::IAM::UserToGroupAddition. If your stack template contains these resources, we recommend that you review any permissions associated with them. If you don't specify this parameter, this action returns an InsufficientCapabilities error.

 
Determines what action will be taken if stack creation fails. This must be one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either OnFailure or DisableRollback, but not both.

Default: ROLLBACK

Constraints:
Allowed Values: DO_NOTHING, ROLLBACK, DELETE

 
     private String onFailure;

    
Structure containing the stack policy body. For more information, go to Prevent Updates to Stack Resources in the AWS CloudFormation User Guide. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.

Constraints:
Length: 1 - 16384

 
     private String stackPolicyBody;

    
Location of a file containing the stack policy. The URL must point to a policy (max size: 16KB) located in an S3 bucket in the same region as the stack. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.

Constraints:
Length: 1 - 1350

 
     private String stackPolicyURL;

    
A set of user-defined Tags to associate with this stack, represented by key/value pairs. Tags defined for the stack are propagated to EC2 resources that are created as part of the stack. A maximum number of 10 tags can be specified.
 
The name associated with the stack. The name must be unique within your AWS account. <note>Must contain only alphanumeric characters (case sensitive) and start with an alpha character. Maximum length of the name is 255 characters.</note>

Returns:
The name associated with the stack. The name must be unique within your AWS account. <note>Must contain only alphanumeric characters (case sensitive) and start with an alpha character. Maximum length of the name is 255 characters.</note>
 
     public String getStackName() {
         return ;
     }
    
    
The name associated with the stack. The name must be unique within your AWS account. <note>Must contain only alphanumeric characters (case sensitive) and start with an alpha character. Maximum length of the name is 255 characters.</note>

Parameters:
stackName The name associated with the stack. The name must be unique within your AWS account. <note>Must contain only alphanumeric characters (case sensitive) and start with an alpha character. Maximum length of the name is 255 characters.</note>
 
     public void setStackName(String stackName) {
         this. = stackName;
     }
    
    
The name associated with the stack. The name must be unique within your AWS account. <note>Must contain only alphanumeric characters (case sensitive) and start with an alpha character. Maximum length of the name is 255 characters.</note>

Returns a reference to this object so that method calls can be chained together.

Parameters:
stackName The name associated with the stack. The name must be unique within your AWS account. <note>Must contain only alphanumeric characters (case sensitive) and start with an alpha character. Maximum length of the name is 255 characters.</note>
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateStackRequest withStackName(String stackName) {
         this. = stackName;
         return this;
     }

    
Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. For more information, go to Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

Constraints:
Length: 1 -

Returns:
Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. For more information, go to Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

 
     public String getTemplateBody() {
         return ;
     }
    
    
Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. For more information, go to Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

Constraints:
Length: 1 -

Parameters:
templateBody Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. For more information, go to Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

 
     public void setTemplateBody(String templateBody) {
         this. = templateBody;
     }
    
    
Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. For more information, go to Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 -

Parameters:
templateBody Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. For more information, go to Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateStackRequest withTemplateBody(String templateBody) {
         this. = templateBody;
         return this;
     }

    
Location of file containing the template body. The URL must point to a template (max size: 307,200 bytes) located in an S3 bucket in the same region as the stack. For more information, go to the Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

Constraints:
Length: 1 - 1024

Returns:
Location of file containing the template body. The URL must point to a template (max size: 307,200 bytes) located in an S3 bucket in the same region as the stack. For more information, go to the Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

 
     public String getTemplateURL() {
         return ;
     }
    
    
Location of file containing the template body. The URL must point to a template (max size: 307,200 bytes) located in an S3 bucket in the same region as the stack. For more information, go to the Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

Constraints:
Length: 1 - 1024

Parameters:
templateURL Location of file containing the template body. The URL must point to a template (max size: 307,200 bytes) located in an S3 bucket in the same region as the stack. For more information, go to the Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

 
     public void setTemplateURL(String templateURL) {
         this. = templateURL;
     }
    
    
Location of file containing the template body. The URL must point to a template (max size: 307,200 bytes) located in an S3 bucket in the same region as the stack. For more information, go to the Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 1024

Parameters:
templateURL Location of file containing the template body. The URL must point to a template (max size: 307,200 bytes) located in an S3 bucket in the same region as the stack. For more information, go to the Template Anatomy in the AWS CloudFormation User Guide.

Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateStackRequest withTemplateURL(String templateURL) {
         this. = templateURL;
         return this;
     }

    
A list of Parameter structures that specify input parameters for the stack.

Returns:
A list of Parameter structures that specify input parameters for the stack.
 
     public java.util.List<ParametergetParameters() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<Parameter>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
A list of Parameter structures that specify input parameters for the stack.

Parameters:
parameters A list of Parameter structures that specify input parameters for the stack.
 
     public void setParameters(java.util.Collection<Parameterparameters) {
         if (parameters == null) {
             this. = null;
             return;
         }
         parametersCopy.addAll(parameters);
         this. = parametersCopy;
     }
    
    
A list of Parameter structures that specify input parameters for the stack.

NOTE: This method appends the values to the existing list (if any). Use setParameters(java.util.Collection) or withParameters(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
parameters A list of Parameter structures that specify input parameters for the stack.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateStackRequest withParameters(Parameter... parameters) {
         if (getParameters() == nullsetParameters(new java.util.ArrayList<Parameter>(parameters.length));
         for (Parameter value : parameters) {
             getParameters().add(value);
         }
         return this;
     }
    
    
A list of Parameter structures that specify input parameters for the stack.

Returns a reference to this object so that method calls can be chained together.

Parameters:
parameters A list of Parameter structures that specify input parameters for the stack.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (parameters == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<ParameterparametersCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<Parameter>(parameters.size());
             parametersCopy.addAll(parameters);
             this. = parametersCopy;
         }
 
         return this;
     }

    
Set to true to disable rollback of the stack if stack creation failed. You can specify either DisableRollback or OnFailure, but not both.

Default: false

Returns:
Set to true to disable rollback of the stack if stack creation failed. You can specify either DisableRollback or OnFailure, but not both.

Default: false

 
     public Boolean isDisableRollback() {
         return ;
     }
    
    
Set to true to disable rollback of the stack if stack creation failed. You can specify either DisableRollback or OnFailure, but not both.

Default: false

Parameters:
disableRollback Set to true to disable rollback of the stack if stack creation failed. You can specify either DisableRollback or OnFailure, but not both.

Default: false

 
     public void setDisableRollback(Boolean disableRollback) {
         this. = disableRollback;
     }
    
    
Set to true to disable rollback of the stack if stack creation failed. You can specify either DisableRollback or OnFailure, but not both.

Default: false

Returns a reference to this object so that method calls can be chained together.

Parameters:
disableRollback Set to true to disable rollback of the stack if stack creation failed. You can specify either DisableRollback or OnFailure, but not both.

Default: false

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateStackRequest withDisableRollback(Boolean disableRollback) {
         this. = disableRollback;
         return this;
     }

    
Set to true to disable rollback of the stack if stack creation failed. You can specify either DisableRollback or OnFailure, but not both.

Default: false

Returns:
Set to true to disable rollback of the stack if stack creation failed. You can specify either DisableRollback or OnFailure, but not both.

Default: false

 
     public Boolean getDisableRollback() {
         return ;
     }

    
The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

Constraints:
Range: 1 -

Returns:
The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.
 
     public Integer getTimeoutInMinutes() {
         return ;
     }
    
    
The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

Constraints:
Range: 1 -

Parameters:
timeoutInMinutes The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.
 
     public void setTimeoutInMinutes(Integer timeoutInMinutes) {
         this. = timeoutInMinutes;
     }
    
    
The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Range: 1 -

Parameters:
timeoutInMinutes The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateStackRequest withTimeoutInMinutes(Integer timeoutInMinutes) {
         this. = timeoutInMinutes;
         return this;
     }

    
The Simple Notification Service (SNS) topic ARNs to publish stack related events. You can find your SNS topic ARNs using the SNS console or your Command Line Interface (CLI).

Constraints:
Length: 0 - 5

Returns:
The Simple Notification Service (SNS) topic ARNs to publish stack related events. You can find your SNS topic ARNs using the SNS console or your Command Line Interface (CLI).
 
     public java.util.List<StringgetNotificationARNs() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
The Simple Notification Service (SNS) topic ARNs to publish stack related events. You can find your SNS topic ARNs using the SNS console or your Command Line Interface (CLI).

Constraints:
Length: 0 - 5

Parameters:
notificationARNs The Simple Notification Service (SNS) topic ARNs to publish stack related events. You can find your SNS topic ARNs using the SNS console or your Command Line Interface (CLI).
 
     public void setNotificationARNs(java.util.Collection<StringnotificationARNs) {
         if (notificationARNs == null) {
             this. = null;
             return;
         }
         com.amazonaws.internal.ListWithAutoConstructFlag<StringnotificationARNsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(notificationARNs.size());
         notificationARNsCopy.addAll(notificationARNs);
         this. = notificationARNsCopy;
     }
    
    
The Simple Notification Service (SNS) topic ARNs to publish stack related events. You can find your SNS topic ARNs using the SNS console or your Command Line Interface (CLI).

NOTE: This method appends the values to the existing list (if any). Use setNotificationARNs(java.util.Collection) or withNotificationARNs(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 5

Parameters:
notificationARNs The Simple Notification Service (SNS) topic ARNs to publish stack related events. You can find your SNS topic ARNs using the SNS console or your Command Line Interface (CLI).
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateStackRequest withNotificationARNs(String... notificationARNs) {
         if (getNotificationARNs() == nullsetNotificationARNs(new java.util.ArrayList<String>(notificationARNs.length));
         for (String value : notificationARNs) {
             getNotificationARNs().add(value);
         }
         return this;
     }
    
    
The Simple Notification Service (SNS) topic ARNs to publish stack related events. You can find your SNS topic ARNs using the SNS console or your Command Line Interface (CLI).

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 5

Parameters:
notificationARNs The Simple Notification Service (SNS) topic ARNs to publish stack related events. You can find your SNS topic ARNs using the SNS console or your Command Line Interface (CLI).
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateStackRequest withNotificationARNs(java.util.Collection<StringnotificationARNs) {
         if (notificationARNs == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<StringnotificationARNsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(notificationARNs.size());
             notificationARNsCopy.addAll(notificationARNs);
             this. = notificationARNsCopy;
         }
 
         return this;
     }

    
A list of capabilities that you must specify before AWS CloudFormation can create or update certain stacks. Some stack templates might include resources that can affect permissions in your AWS account. For those stacks, you must explicitly acknowledge their capabilities by specifying this parameter.

Currently, the only valid value is CAPABILITY_IAM, which is required for the following resources: AWS::CloudFormation::Stack, AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, and AWS::IAM::UserToGroupAddition. If your stack template contains these resources, we recommend that you review any permissions associated with them. If you don't specify this parameter, this action returns an InsufficientCapabilities error.

Returns:
A list of capabilities that you must specify before AWS CloudFormation can create or update certain stacks. Some stack templates might include resources that can affect permissions in your AWS account. For those stacks, you must explicitly acknowledge their capabilities by specifying this parameter.

Currently, the only valid value is CAPABILITY_IAM, which is required for the following resources: AWS::CloudFormation::Stack, AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, and AWS::IAM::UserToGroupAddition. If your stack template contains these resources, we recommend that you review any permissions associated with them. If you don't specify this parameter, this action returns an InsufficientCapabilities error.

 
     public java.util.List<StringgetCapabilities() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
A list of capabilities that you must specify before AWS CloudFormation can create or update certain stacks. Some stack templates might include resources that can affect permissions in your AWS account. For those stacks, you must explicitly acknowledge their capabilities by specifying this parameter.

Currently, the only valid value is CAPABILITY_IAM, which is required for the following resources: AWS::CloudFormation::Stack, AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, and AWS::IAM::UserToGroupAddition. If your stack template contains these resources, we recommend that you review any permissions associated with them. If you don't specify this parameter, this action returns an InsufficientCapabilities error.

Parameters:
capabilities A list of capabilities that you must specify before AWS CloudFormation can create or update certain stacks. Some stack templates might include resources that can affect permissions in your AWS account. For those stacks, you must explicitly acknowledge their capabilities by specifying this parameter.

Currently, the only valid value is CAPABILITY_IAM, which is required for the following resources: AWS::CloudFormation::Stack, AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, and AWS::IAM::UserToGroupAddition. If your stack template contains these resources, we recommend that you review any permissions associated with them. If you don't specify this parameter, this action returns an InsufficientCapabilities error.

 
     public void setCapabilities(java.util.Collection<Stringcapabilities) {
         if (capabilities == null) {
             this. = null;
             return;
         }
         com.amazonaws.internal.ListWithAutoConstructFlag<StringcapabilitiesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(capabilities.size());
         capabilitiesCopy.addAll(capabilities);
         this. = capabilitiesCopy;
     }
    
    
A list of capabilities that you must specify before AWS CloudFormation can create or update certain stacks. Some stack templates might include resources that can affect permissions in your AWS account. For those stacks, you must explicitly acknowledge their capabilities by specifying this parameter.

Currently, the only valid value is CAPABILITY_IAM, which is required for the following resources: AWS::CloudFormation::Stack, AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, and AWS::IAM::UserToGroupAddition. If your stack template contains these resources, we recommend that you review any permissions associated with them. If you don't specify this parameter, this action returns an InsufficientCapabilities error.

NOTE: This method appends the values to the existing list (if any). Use setCapabilities(java.util.Collection) or withCapabilities(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
capabilities A list of capabilities that you must specify before AWS CloudFormation can create or update certain stacks. Some stack templates might include resources that can affect permissions in your AWS account. For those stacks, you must explicitly acknowledge their capabilities by specifying this parameter.

Currently, the only valid value is CAPABILITY_IAM, which is required for the following resources: AWS::CloudFormation::Stack, AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, and AWS::IAM::UserToGroupAddition. If your stack template contains these resources, we recommend that you review any permissions associated with them. If you don't specify this parameter, this action returns an InsufficientCapabilities error.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateStackRequest withCapabilities(String... capabilities) {
         if (getCapabilities() == nullsetCapabilities(new java.util.ArrayList<String>(capabilities.length));
         for (String value : capabilities) {
             getCapabilities().add(value);
         }
         return this;
     }
    
    
A list of capabilities that you must specify before AWS CloudFormation can create or update certain stacks. Some stack templates might include resources that can affect permissions in your AWS account. For those stacks, you must explicitly acknowledge their capabilities by specifying this parameter.

Currently, the only valid value is CAPABILITY_IAM, which is required for the following resources: AWS::CloudFormation::Stack, AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, and AWS::IAM::UserToGroupAddition. If your stack template contains these resources, we recommend that you review any permissions associated with them. If you don't specify this parameter, this action returns an InsufficientCapabilities error.

Returns a reference to this object so that method calls can be chained together.

Parameters:
capabilities A list of capabilities that you must specify before AWS CloudFormation can create or update certain stacks. Some stack templates might include resources that can affect permissions in your AWS account. For those stacks, you must explicitly acknowledge their capabilities by specifying this parameter.

Currently, the only valid value is CAPABILITY_IAM, which is required for the following resources: AWS::CloudFormation::Stack, AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, and AWS::IAM::UserToGroupAddition. If your stack template contains these resources, we recommend that you review any permissions associated with them. If you don't specify this parameter, this action returns an InsufficientCapabilities error.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateStackRequest withCapabilities(java.util.Collection<Stringcapabilities) {
         if (capabilities == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<StringcapabilitiesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(capabilities.size());
             capabilitiesCopy.addAll(capabilities);
             this. = capabilitiesCopy;
         }
 
         return this;
     }

    
A list of capabilities that you must specify before AWS CloudFormation can create or update certain stacks. Some stack templates might include resources that can affect permissions in your AWS account. For those stacks, you must explicitly acknowledge their capabilities by specifying this parameter.

Currently, the only valid value is CAPABILITY_IAM, which is required for the following resources: AWS::CloudFormation::Stack, AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, and AWS::IAM::UserToGroupAddition. If your stack template contains these resources, we recommend that you review any permissions associated with them. If you don't specify this parameter, this action returns an InsufficientCapabilities error.

Returns a reference to this object so that method calls can be chained together.

Parameters:
capabilities A list of capabilities that you must specify before AWS CloudFormation can create or update certain stacks. Some stack templates might include resources that can affect permissions in your AWS account. For those stacks, you must explicitly acknowledge their capabilities by specifying this parameter.

Currently, the only valid value is CAPABILITY_IAM, which is required for the following resources: AWS::CloudFormation::Stack, AWS::IAM::AccessKey, AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, and AWS::IAM::UserToGroupAddition. If your stack template contains these resources, we recommend that you review any permissions associated with them. If you don't specify this parameter, this action returns an InsufficientCapabilities error.

Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateStackRequest withCapabilities(Capability... capabilities) {
        java.util.ArrayList<StringcapabilitiesCopy = new java.util.ArrayList<String>(capabilities.length);
        for (Capability member : capabilities) {
            capabilitiesCopy.add(member.toString());
        }
        if (getCapabilities() == null) {
            setCapabilities(capabilitiesCopy);
        } else {
            getCapabilities().addAll(capabilitiesCopy);
        }
        return this;
    }

    
Determines what action will be taken if stack creation fails. This must be one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either OnFailure or DisableRollback, but not both.

Default: ROLLBACK

Constraints:
Allowed Values: DO_NOTHING, ROLLBACK, DELETE

Returns:
Determines what action will be taken if stack creation fails. This must be one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either OnFailure or DisableRollback, but not both.

Default: ROLLBACK

See also:
OnFailure
    public String getOnFailure() {
        return ;
    }
    
    
Determines what action will be taken if stack creation fails. This must be one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either OnFailure or DisableRollback, but not both.

Default: ROLLBACK

Constraints:
Allowed Values: DO_NOTHING, ROLLBACK, DELETE

Parameters:
onFailure Determines what action will be taken if stack creation fails. This must be one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either OnFailure or DisableRollback, but not both.

Default: ROLLBACK

See also:
OnFailure
    public void setOnFailure(String onFailure) {
        this. = onFailure;
    }
    
    
Determines what action will be taken if stack creation fails. This must be one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either OnFailure or DisableRollback, but not both.

Default: ROLLBACK

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: DO_NOTHING, ROLLBACK, DELETE

Parameters:
onFailure Determines what action will be taken if stack creation fails. This must be one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either OnFailure or DisableRollback, but not both.

Default: ROLLBACK

Returns:
A reference to this updated object so that method calls can be chained together.
See also:
OnFailure
    public CreateStackRequest withOnFailure(String onFailure) {
        this. = onFailure;
        return this;
    }

    
Determines what action will be taken if stack creation fails. This must be one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either OnFailure or DisableRollback, but not both.

Default: ROLLBACK

Constraints:
Allowed Values: DO_NOTHING, ROLLBACK, DELETE

Parameters:
onFailure Determines what action will be taken if stack creation fails. This must be one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either OnFailure or DisableRollback, but not both.

Default: ROLLBACK

See also:
OnFailure
    public void setOnFailure(OnFailure onFailure) {
        this. = onFailure.toString();
    }
    
    
Determines what action will be taken if stack creation fails. This must be one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either OnFailure or DisableRollback, but not both.

Default: ROLLBACK

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: DO_NOTHING, ROLLBACK, DELETE

Parameters:
onFailure Determines what action will be taken if stack creation fails. This must be one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either OnFailure or DisableRollback, but not both.

Default: ROLLBACK

Returns:
A reference to this updated object so that method calls can be chained together.
See also:
OnFailure
    public CreateStackRequest withOnFailure(OnFailure onFailure) {
        this. = onFailure.toString();
        return this;
    }

    
Structure containing the stack policy body. For more information, go to Prevent Updates to Stack Resources in the AWS CloudFormation User Guide. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.

Constraints:
Length: 1 - 16384

Returns:
Structure containing the stack policy body. For more information, go to Prevent Updates to Stack Resources in the AWS CloudFormation User Guide. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.
    public String getStackPolicyBody() {
        return ;
    }
    
    
Structure containing the stack policy body. For more information, go to Prevent Updates to Stack Resources in the AWS CloudFormation User Guide. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.

Constraints:
Length: 1 - 16384

Parameters:
stackPolicyBody Structure containing the stack policy body. For more information, go to Prevent Updates to Stack Resources in the AWS CloudFormation User Guide. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.
    public void setStackPolicyBody(String stackPolicyBody) {
        this. = stackPolicyBody;
    }
    
    
Structure containing the stack policy body. For more information, go to Prevent Updates to Stack Resources in the AWS CloudFormation User Guide. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 16384

Parameters:
stackPolicyBody Structure containing the stack policy body. For more information, go to Prevent Updates to Stack Resources in the AWS CloudFormation User Guide. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateStackRequest withStackPolicyBody(String stackPolicyBody) {
        this. = stackPolicyBody;
        return this;
    }

    
Location of a file containing the stack policy. The URL must point to a policy (max size: 16KB) located in an S3 bucket in the same region as the stack. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.

Constraints:
Length: 1 - 1350

Returns:
Location of a file containing the stack policy. The URL must point to a policy (max size: 16KB) located in an S3 bucket in the same region as the stack. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.
    public String getStackPolicyURL() {
        return ;
    }
    
    
Location of a file containing the stack policy. The URL must point to a policy (max size: 16KB) located in an S3 bucket in the same region as the stack. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.

Constraints:
Length: 1 - 1350

Parameters:
stackPolicyURL Location of a file containing the stack policy. The URL must point to a policy (max size: 16KB) located in an S3 bucket in the same region as the stack. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.
    public void setStackPolicyURL(String stackPolicyURL) {
        this. = stackPolicyURL;
    }
    
    
Location of a file containing the stack policy. The URL must point to a policy (max size: 16KB) located in an S3 bucket in the same region as the stack. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 1350

Parameters:
stackPolicyURL Location of a file containing the stack policy. The URL must point to a policy (max size: 16KB) located in an S3 bucket in the same region as the stack. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateStackRequest withStackPolicyURL(String stackPolicyURL) {
        this. = stackPolicyURL;
        return this;
    }

    
A set of user-defined Tags to associate with this stack, represented by key/value pairs. Tags defined for the stack are propagated to EC2 resources that are created as part of the stack. A maximum number of 10 tags can be specified.

Returns:
A set of user-defined Tags to associate with this stack, represented by key/value pairs. Tags defined for the stack are propagated to EC2 resources that are created as part of the stack. A maximum number of 10 tags can be specified.
    public java.util.List<TaggetTags() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Tag>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A set of user-defined Tags to associate with this stack, represented by key/value pairs. Tags defined for the stack are propagated to EC2 resources that are created as part of the stack. A maximum number of 10 tags can be specified.

Parameters:
tags A set of user-defined Tags to associate with this stack, represented by key/value pairs. Tags defined for the stack are propagated to EC2 resources that are created as part of the stack. A maximum number of 10 tags can be specified.
    public void setTags(java.util.Collection<Tagtags) {
        if (tags == null) {
            this. = null;
            return;
        }
        tagsCopy.addAll(tags);
        this. = tagsCopy;
    }
    
    
A set of user-defined Tags to associate with this stack, represented by key/value pairs. Tags defined for the stack are propagated to EC2 resources that are created as part of the stack. A maximum number of 10 tags can be specified.

NOTE: This method appends the values to the existing list (if any). Use setTags(java.util.Collection) or withTags(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
tags A set of user-defined Tags to associate with this stack, represented by key/value pairs. Tags defined for the stack are propagated to EC2 resources that are created as part of the stack. A maximum number of 10 tags can be specified.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateStackRequest withTags(Tag... tags) {
        if (getTags() == nullsetTags(new java.util.ArrayList<Tag>(tags.length));
        for (Tag value : tags) {
            getTags().add(value);
        }
        return this;
    }
    
    
A set of user-defined Tags to associate with this stack, represented by key/value pairs. Tags defined for the stack are propagated to EC2 resources that are created as part of the stack. A maximum number of 10 tags can be specified.

Returns a reference to this object so that method calls can be chained together.

Parameters:
tags A set of user-defined Tags to associate with this stack, represented by key/value pairs. Tags defined for the stack are propagated to EC2 resources that are created as part of the stack. A maximum number of 10 tags can be specified.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (tags == null) {
            this. = null;
        } else {
            tagsCopy.addAll(tags);
            this. = tagsCopy;
        }
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getStackName() != nullsb.append("StackName: " + getStackName() + ",");
        if (getTemplateBody() != nullsb.append("TemplateBody: " + getTemplateBody() + ",");
        if (getTemplateURL() != nullsb.append("TemplateURL: " + getTemplateURL() + ",");
        if (getParameters() != nullsb.append("Parameters: " + getParameters() + ",");
        if (isDisableRollback() != nullsb.append("DisableRollback: " + isDisableRollback() + ",");
        if (getTimeoutInMinutes() != nullsb.append("TimeoutInMinutes: " + getTimeoutInMinutes() + ",");
        if (getNotificationARNs() != nullsb.append("NotificationARNs: " + getNotificationARNs() + ",");
        if (getCapabilities() != nullsb.append("Capabilities: " + getCapabilities() + ",");
        if (getOnFailure() != nullsb.append("OnFailure: " + getOnFailure() + ",");
        if (getStackPolicyBody() != nullsb.append("StackPolicyBody: " + getStackPolicyBody() + ",");
        if (getStackPolicyURL() != nullsb.append("StackPolicyURL: " + getStackPolicyURL() + ",");
        if (getTags() != nullsb.append("Tags: " + getTags() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getStackName() == null) ? 0 : getStackName().hashCode()); 
        hashCode = prime * hashCode + ((getTemplateBody() == null) ? 0 : getTemplateBody().hashCode()); 
        hashCode = prime * hashCode + ((getTemplateURL() == null) ? 0 : getTemplateURL().hashCode()); 
        hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode()); 
        hashCode = prime * hashCode + ((isDisableRollback() == null) ? 0 : isDisableRollback().hashCode()); 
        hashCode = prime * hashCode + ((getTimeoutInMinutes() == null) ? 0 : getTimeoutInMinutes().hashCode()); 
        hashCode = prime * hashCode + ((getNotificationARNs() == null) ? 0 : getNotificationARNs().hashCode()); 
        hashCode = prime * hashCode + ((getCapabilities() == null) ? 0 : getCapabilities().hashCode()); 
        hashCode = prime * hashCode + ((getOnFailure() == null) ? 0 : getOnFailure().hashCode()); 
        hashCode = prime * hashCode + ((getStackPolicyBody() == null) ? 0 : getStackPolicyBody().hashCode()); 
        hashCode = prime * hashCode + ((getStackPolicyURL() == null) ? 0 : getStackPolicyURL().hashCode()); 
        hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateStackRequest == falsereturn false;
        CreateStackRequest other = (CreateStackRequest)obj;
        
        if (other.getStackName() == null ^ this.getStackName() == nullreturn false;
        if (other.getStackName() != null && other.getStackName().equals(this.getStackName()) == falsereturn false
        if (other.getTemplateBody() == null ^ this.getTemplateBody() == nullreturn false;
        if (other.getTemplateBody() != null && other.getTemplateBody().equals(this.getTemplateBody()) == falsereturn false
        if (other.getTemplateURL() == null ^ this.getTemplateURL() == nullreturn false;
        if (other.getTemplateURL() != null && other.getTemplateURL().equals(this.getTemplateURL()) == falsereturn false
        if (other.getParameters() == null ^ this.getParameters() == nullreturn false;
        if (other.getParameters() != null && other.getParameters().equals(this.getParameters()) == falsereturn false
        if (other.isDisableRollback() == null ^ this.isDisableRollback() == nullreturn false;
        if (other.isDisableRollback() != null && other.isDisableRollback().equals(this.isDisableRollback()) == falsereturn false
        if (other.getTimeoutInMinutes() == null ^ this.getTimeoutInMinutes() == nullreturn false;
        if (other.getTimeoutInMinutes() != null && other.getTimeoutInMinutes().equals(this.getTimeoutInMinutes()) == falsereturn false
        if (other.getNotificationARNs() == null ^ this.getNotificationARNs() == nullreturn false;
        if (other.getNotificationARNs() != null && other.getNotificationARNs().equals(this.getNotificationARNs()) == falsereturn false
        if (other.getCapabilities() == null ^ this.getCapabilities() == nullreturn false;
        if (other.getCapabilities() != null && other.getCapabilities().equals(this.getCapabilities()) == falsereturn false
        if (other.getOnFailure() == null ^ this.getOnFailure() == nullreturn false;
        if (other.getOnFailure() != null && other.getOnFailure().equals(this.getOnFailure()) == falsereturn false
        if (other.getStackPolicyBody() == null ^ this.getStackPolicyBody() == nullreturn false;
        if (other.getStackPolicyBody() != null && other.getStackPolicyBody().equals(this.getStackPolicyBody()) == falsereturn false
        if (other.getStackPolicyURL() == null ^ this.getStackPolicyURL() == nullreturn false;
        if (other.getStackPolicyURL() != null && other.getStackPolicyURL().equals(this.getStackPolicyURL()) == falsereturn false
        if (other.getTags() == null ^ this.getTags() == nullreturn false;
        if (other.getTags() != null && other.getTags().equals(this.getTags()) == falsereturn false
        return true;
    }
    
    @Override
    public CreateStackRequest clone() {
        
            return (CreateStackRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X