Understand CloudFormation stack creation events (original) (raw)

During stack deployment, several events occur to create, configure, and validate the resources defined in the stack template. Understanding these events can help you optimize your stack creation process and streamline deployments.

You can leverage the CONFIGURATION_COMPLETE event to streamline your stack creation process in scenarios where resource eventual consistency check is not required, such as validating a pre-production stack configuration or cross-stack provisioning. You can use this event in multiple ways. For example, you can use it as a visual signal to skip waiting for the resource or stack consistency check to finish. Or you could use it to create an automated mechanism using continuous integration and continuous delivery (CI/CD) to trigger additional actions.

Important

While leveraging the CONFIGURATION_COMPLETE event accelerates stack creation times, you should be aware of its trade-offs. First, it's only supported for a subset of resource type that support drift detection. For a list of resource types that support drift detection, see Resource type support. This approach may not be suitable for all scenarios, especially where resources require thorough eventual consistency checks to ensure full operational readiness across the cloud environment (for example, in production environments). We recommend carefully assessing your deployment requirements and the criticality of the consistency checks for each resource. Use theCONFIGURATION_COMPLETE event to optimize deployment speeds without compromising the integrity and reliability of your infrastructure.

Because the CONFIGURATION_COMPLETE event is not guaranteed to be set, any scenarios that use it should be prepared to handle a CREATE_COMPLETE event when no CONFIGURATION_COMPLETE event was set.

Diagram showing the sequence of events for resource creation and eventual consistency check in a stack.

When the stack deployment starts, both the AWS::ECR::Repository andAWS::ECS::Cluster resources start the creation process (ResourceStatus = CREATE_IN_PROGRESS. When theAWS::ECR::Repository resource type has started the eventual consistency check (DetailedStatus = CONFIGURATION_COMPLETE), then theAWS::ECS::TaskDefinition resource can start the creation process. Similarly, once the AWS::ECS::TaskDefinition resource begins the eventual consistency check, theAWS::ECS::Service resource start the creation process.

CREATE_IN_PROGRESS and CREATE_COMPLETE events