Deployment Config

You use the deploymentConfig property to control how CloudFormation performs stack create and update operations.

The deploymentConfig property is an object with two optional properties: mode and disableRollback.

The mode property specifies the deployment mode. It accepts these values:

  • STANDARD - CloudFormation waits until resources are ready to serve traffic before completing the operation. This is the default.
  • EXPRESS - CloudFormation completes the operation as soon as the resource configuration is applied, without waiting for the resources to become ready. The resources continue becoming ready in the background. See the AWS announcement for more information.

The disableRollback property specifies whether CloudFormation should roll back the stack if the operation fails. The default is false.

Examples

Deploying stacks in express mode:

1deploymentConfig:
2  mode: EXPRESS

Deploying stacks in express mode with rollback disabled:

1deploymentConfig:
2  mode: EXPRESS
3  disableRollback: true

Disabling rollback while using the standard deployment mode:

1deploymentConfig:
2  disableRollback: true

Disabling Rollback

When rollback is disabled and a stack operation fails, CloudFormation leaves the stack and its resources in the failed state instead of rolling them back. This makes it easier to troubleshoot the failure.

  • If creating a new stack fails, the stack is left in CREATE_FAILED status. On the next deployment, Takomo deletes the stack and creates it again.
  • If updating an existing stack fails, the stack is left in UPDATE_FAILED status. On the next deployment, Takomo updates the stack. You can also undeploy a stack in this status.

Usage In Configuration

deploymentConfig property can be defined in:

  • stack group configuration files
  • blueprint configuration files
  • stack configuration files

Unlike many other object properties, deploymentConfig is not overridden as a whole. The mode and disableRollback properties are resolved separately, so you can override just one of them and inherit the other.

Stack Group Config File

When deploymentConfig property is defined in a stack group configuration file:

  • the properties it defines override the corresponding values inherited from the parent stack group, and the properties it omits are inherited from the parent stack group
  • its value is inherited by stack groups and stacks that belong under the stack group

Blueprint Config File

When deploymentConfig property is defined in a blueprint configuration file:

  • the properties it defines override the corresponding values inherited from the parent stack group, and the properties it omits are inherited from the parent stack group
  • its value is inherited by stacks that extend the blueprint

Stack Config File

When deploymentConfig property is defined in a stack configuration file:

  • if the stack extends a blueprint, the properties it defines override the corresponding values inherited from the blueprint, and the properties it omits are inherited from the blueprint or the parent stack group
  • otherwise, the properties it defines override the corresponding values inherited from the parent stack group, and the properties it omits are inherited from the parent stack group

Example

Given this stack group configuration:

stacks/config.yml
1deploymentConfig:
2  mode: EXPRESS

and this stack configuration:

stacks/my-stack.yml
1deploymentConfig:
2  disableRollback: true

The stack is deployed in express mode with rollback disabled.

Requirements

The deploymentConfig property must satisfy these requirements:

  • It must be an object
  • It must not contain properties other than mode and disableRollback
  • Mode must be either STANDARD or EXPRESS
  • Disable rollback must be a boolean