Creating a change set - AWS CloudFormation

Creating a change set

To create a change set for a running stack, submit the changes that you want to make by providing a modified template, new input parameter values, or both. CloudFormation generates a change set by comparing your stack with the changes you submitted.

You can either modify a template before creating the change set or during change set creation.

Create a change set for nested stacks (console)
To create a change set for nested stacks (console)
  1. In the AWS CloudFormation console, in Stacks, choose the running stack for which you want to create a change set.

  2. In the stack details pane, choose Stack actions, and then choose Create change set for current stack.

  3. On the Create change set for stack-name page, do one of the following to modify input parameter values, specify the location of an updated template, or modify the template:

    Task Action
    To modify input parameter values Choose Use current template, and then choose Next to proceed to enter or modify input parameter values.
    To specify the location of an updated template

    If you've modified the template, choose Replace current template, and then do one of the following:

    • For a template stored in an Amazon S3 bucket, choose Amazon S3 URL. Enter or paste the URL for the template, and then choose Next.

      If you have a template in a versioning-enabled bucket, you can specify a specific version of the template, such as https://s3.amazonaws.com/templates/myTemplate.template?versionId=123ab1cdeKdOW5IH4GAcYbEngcpTJTDW. For more information, see Managing objects in a versioning-enabled bucket in the Amazon Simple Storage Service User Guide.

    • For a template stored locally on your computer, choose Upload a template file. Choose Choose File to navigate to the file and select it, and then choose Next.

    To modify the template If you haven't modified the template, choose Edit template in designer, and then choose View in designer. You're redirected to the AWS CloudFormation Designer. Once you've modified the template, choose to return to the Create change set for stack-name page, and then choose Next.
  4. If your template contains parameters, on the Specify stack details page, enter or modify applicable input parameter values, and then choose Next.

    If you're reusing the stack's template, CloudFormation populates each parameter with the current value in the stack, with the exception of parameters declared with the NoEcho attribute. To use existing values for those parameters, select Use existing value.

    For more information about using NoEcho to mask sensitive information, as well as using dynamic parameters to manage secrets, see the Do not embed credentials in your templates best practice.

  5. On the Configure stack options page, update the stack's tags, IAM service role, stack policy, rollback configuration, Amazon SNS notification topic (if applicable), or change sets and then choose Next.

    Note

    Change sets for nested stacks are Enabled by default, which will create change sets for all nested stacks specified in your template. For more information about change sets for nested stacks, see Change sets for nested stacks.

  6. On the Review stack-name page, review the changes for this change set.

    If the template includes AWS Identity and Access Management (IAM) resources, select I acknowledge that CloudFormation might create IAM resources. IAM resources can modify permissions in your AWS account; review these resources to ensure that you're permitting only the actions that you intend. For more information, see Controlling access with AWS Identity and Access Management.

  7. Choose Create change set. Specify a name for the change set and optionally specify a description of the change set to identify its purpose. Then, choose Create change set.

    You're redirected to the Changes tab of the change set's details page. While CloudFormation generates the change set, the status of the change set is CREATE_IN_PROGRESS. After it has created the change set, CloudFormation sets the status to CREATE_COMPLETE. In the Changes section, CloudFormation lists all of the changes that it will make to your stack. For more information, see Viewing a change set.

    
                  The details page for the nested change set.

    If CloudFormation fails to create the change set (reports FAILED status), fix the error displayed in the Status field, and then recreate the change set.

Create a change set (console)
To create a change set (console)
  1. In the AWS CloudFormation console, in Stacks, choose the running stack for which you want to create a change set.

  2. In the stack details pane, choose Stack actions, and then choose Create change set for current stack.

  3. On the Create change set for stack-name page, do one of the following to modify input parameter values, specify the location of an updated template, or modify the template:

    Task Action
    To modify input parameter values Choose Use current template, and then choose Next to proceed to enter or modify input parameter values.
    To specify the location of an updated template

    If you've modified the template, choose Replace current template, and then do one of the following:

    • For a template stored in an Amazon S3 bucket, choose Amazon S3 URL. Enter or paste the URL for the template, and then choose Next.

      If you have a template in a versioning-enabled bucket, you can specify a specific version of the template, such as https://s3.amazonaws.com/templates/myTemplate.template?versionId=123ab1cdeKdOW5IH4GAcYbEngcpTJTDW. For more information, see Managing objects in a versioning-enabled bucket in the Amazon Simple Storage Service User Guide.

    • For a template stored locally on your computer, choose Upload a template file. Choose Choose File to navigate to the file and select it, and then choose Next.

    To modify the template If you haven't modified the template, choose Edit template in designer, and then choose View in designer. You're redirected to the AWS CloudFormation Designer. Once you've modified the template, choose to return to the Create change set for stack-name page, and then choose Next.
  4. If your template contains parameters, on the Specify stack details page, enter or modify applicable input parameter values, and then choose Next.

    If you're reusing the stack's template, CloudFormation populates each parameter with the current value in the stack, with the exception of parameters declared with the NoEcho attribute. To use existing values for those parameters, select Use existing value.

    For more information about using NoEcho to mask sensitive information, and using dynamic parameters to manage secrets, see the Do not embed credentials in your templates best practice.

  5. On the Configure stack options page, update the stack's tags, IAM service role, stack policy, rollback configuration, Amazon SNS notification topic (if applicable), or change sets and then choose Next.

    Note

    Change sets for nested stacks are Enabled by default, which will create change sets for all nested stacks specified in your template. To create a change set for the current stack only, choose Disabled. For more information about change sets for nested stacks, see Change sets for nested stacks.

  6. On the Review stack-name page, review the changes for this change set.

    If the template includes AWS Identity and Access Management (IAM) resources, select I acknowledge that CloudFormation might create IAM resources. IAM resources can modify permissions in your AWS account; review these resources to ensure that you're permitting only the actions that you intend. For more information, see Controlling access with AWS Identity and Access Management.

  7. Choose Create change set. Specify a name for the change set and optionally specify a description of the change set to identify its purpose. Then, choose Create change set.

    You're redirected to the Changes tab of the change set's details page. While CloudFormation generates the change set, the status of the change set is CREATE_IN_PROGRESS. After it has created the change set, CloudFormation sets the status to CREATE_COMPLETE. In the Changes section, CloudFormation lists all of the changes that it will make to your stack. For more information, see Viewing a change set.

    
                The details page for the change set.

    If CloudFormation fails to create the change set (reports FAILED status), fix the error displayed in the Status field, and then recreate the change set.

To create a change set (AWS CLI)
  • Run the aws cloudformation create-change-set command.

    You submit your changes as command options. You can specify new parameter values, a modified template, or both. For example, the following command creates a change set named SampleChangeSet for the SampleStack stack. The change set uses the current stack's template, but with a different value for the Purpose parameter:

    aws cloudformation create-change-set --stack-name arn:aws:cloudformation:us-east-1:123456789012:stack/SampleStack/1a2345b6-0000-00a0-a123-00abc0abc000 --change-set-name SampleChangeSet --use-previous-template --parameters ParameterKey="InstanceType",UsePreviousValue=true ParameterKey="KeyPairName",UsePreviousValue=true ParameterKey="Purpose",ParameterValue="production"