Deploy Amazon CloudFormation stacks faster with express mode
With CloudFormation express mode, you can complete stack operations as soon as CloudFormation applies the resource configuration, without waiting for resources to fully stabilize. Use express mode to create, update, and delete stacks significantly faster during iterative development workflows.
Express mode works with all existing CloudFormation templates. You don't need to make any template changes to use express mode.
Topics
When to use express mode
Use express mode for development and iteration workflows where speed is more important than waiting for full resource stabilization. Use express mode when:
-
You iterate on template changes during development.
-
You want faster feedback on whether your resource configurations are valid.
-
You don't need to wait for resources to be fully operational before proceeding.
For production deployments where you need to verify that resources are fully stabilized and operational before considering the deployment complete, use the default deployment mode.
How express mode works
In the default deployment mode, CloudFormation waits for each resource to reach a fully
stabilized state before reporting the resource as complete. For example, when creating an
Amazon EC2 instance, CloudFormation waits until the instance is in the running state.
In express mode, CloudFormation typically considers a resource operation complete as soon as the API call to create, update, or delete the resource succeeds. In most cases, CloudFormation does not wait for the resource to reach its final operational state.
This means that after an express mode stack operation completes:
-
Resources might still be initializing or propagating changes.
-
Resources might not yet be ready to serve traffic or accept connections.
-
Delete operations might still be in progress.
Getting started with express mode
You can use express mode with the Amazon Command Line Interface (Amazon CLI), the Amazon Cloud Development Kit (Amazon CDK) (Amazon CDK), the CloudFormation console, and change sets. The following sections describe how to enable express mode with each method.
Using express mode with the Amazon CLI
To use express mode with the Amazon CLI, add the --deployment-config parameter
to your stack operation commands.
Create a stack with express mode
The following command creates a stack using express mode:
aws cloudformation create-stack --stack-namemy-stack\ --template-bodyfile://my-template.yaml\ --deployment-config '{"mode": "EXPRESS"}'
Update a stack with express mode
The following command updates a stack using express mode:
aws cloudformation update-stack --stack-namemy-stack\ --template-bodyfile://my-template.yaml\ --deployment-config '{"mode": "EXPRESS"}'
Delete a stack with express mode
The following command deletes a stack using express mode:
aws cloudformation delete-stack --stack-namemy-stack\ --deployment-config '{"mode": "EXPRESS"}'
Using express mode with the Amazon CDK
To use express mode with the Amazon Cloud Development Kit (Amazon CDK) (Amazon CDK), use the --express flag
with the cdk deploy command:
cdk deploy --express
Using express mode with the console
When creating or updating a stack in the CloudFormation console, you can enable express mode in the Configure stack options step. Under Deployment options, select Express for the deployment mode.
Using express mode with change sets
You can use express mode with change sets by specifying the deployment configuration when creating the change set:
aws cloudformation create-change-set --stack-namemy-stack\ --change-set-namemy-change-set\ --template-bodyfile://my-template.yaml\ --deployment-config '{"mode": "EXPRESS"}'
When you execute the change set, CloudFormation applies the express mode deployment configuration specified during change set creation.
Rollback behavior with express mode
When you use express mode, CloudFormation disables rollback by default. If a resource operation fails, CloudFormation does not automatically roll back the changes.
To re-enable rollback when using express mode, set disableRollback to
false in the --deployment-config parameter:
aws cloudformation create-stack --stack-namemy-stack\ --template-bodyfile://my-template.yaml\ --deployment-config '{"mode": "EXPRESS", "disableRollback": false}'
Express mode and nested stacks
When you use express mode on a parent stack, the setting propagates to all nested stacks in the hierarchy. You don't need to specify express mode for each nested stack separately. All resources in the root stack and its nested stacks complete as soon as their configuration is applied.
Resource readiness considerations
Express mode completes resource operations before resources reach a fully stabilized state, so any resource might require additional time to become fully ready to serve traffic or complete multi-region propagation. The following table illustrates the kinds of resource behavior you can expect, using examples across different resource types. These examples are illustrative and don't represent a complete list of supported resources.
| Resource type | Operation | Readiness behavior |
|---|---|---|
| Amazon CloudFront distribution | Create/Update | Distribution might take several minutes to deploy globally after configuration is applied. |
| Amazon EC2 instance | Create | Instance might still be initializing (running user data scripts, status checks) after the stack operation completes. |
| Amazon Lambda function | Delete | Function resources might still be cleaning up after the delete operation reports complete. |
| Amazon Elastic Container Service (Amazon ECS) service | Create/Update | Service tasks might still be starting or reaching a steady state after the stack operation completes. |
Unsupported features and limitations
The following features and services are not supported with express mode:
- CloudFormation StackSets
-
CloudFormation does not support express mode with StackSets operations.
- Amazon Serverless Application Model (Amazon SAM)
-
CloudFormation does not support express mode with Amazon SAM deployments.
The following resources have specific behavior with express mode:
- Custom resources
-
Custom resources (including
AWS::CloudFormation::CustomResourceandCustom::*resources) follow their default behavior. CloudFormation waits for the custom resource to send a response signal before considering the operation complete, even in express mode. To prevent a slow or stuck custom resource from delaying fast iteration workflows, set a maximum wait time with theServiceTimeoutproperty. For more information, see Response timeout.
Comparison with Amazon CDK hotswap deployments
The following table compares express mode with Amazon CDK hotswap deployments.
| Feature | Express mode | Amazon CDK hotswap |
|---|---|---|
| Deployment mechanism | Uses CloudFormation for all resource operations | Bypasses CloudFormation and calls service APIs directly |
| Template compatibility | Works with all existing CloudFormation templates | Supports a limited set of resource types |
| Stack state | Stack state remains consistent with template | Stack state might drift from template |
| Rollback support | Supports rollback (disabled by default) | No rollback support |
| Resource coverage | All CloudFormation resource types | Limited resource types (Amazon Lambda, Amazon ECS, Amazon Step Functions, and others) |
| Recommended use | Development and iteration workflows | Development workflows with supported resources only |
Related resources
-
CreateStack in the Amazon CloudFormation API Reference