Troubleshooting template creation

Monitoring from the AWS Console

When you deploy the template, you can monitor the creation or update resources using AWS Console.

  1. Navigate to the CloudFormation Console
  2. Click the stack name to go through to the Stack Detail screen
  3. Under the Events section, you will see a list of the stack resource creation or update events. Errors will appear in red in the Status column.

Monitoring from the AWS CLI

  1. List the CloudFormation stacks in the region you deployed the stack to get its name:
aws cloudformation list-stacks --region us-east-2

Use the output to identify the stack with the StackName property and its current status with the StackStatus property. It should be in the CREATE_COMPLETE or UPDATE_COMPLETE state if it was created correctly.

  1. If something went wrong during stack creation, you can understand which event caused the stack failure by listing out the stack events:
# List all the events in reverse chronological order (most recent to least recent)

aws cloudformation describe-stack-events --stack-name ChrisLaptop --region us-east-2

# add `| less` to run them through a pager

aws cloudformation describe-stack-events --stack-name ChrisLaptop --region us-east-2 | less

# or to limit to the latest 5 events

aws cloudformation describe-stack-events --stack-name ChrisLaptop --region us-east-2 --max-items 5

# and to get the next five events (using the NextToken property from the previous output)

aws cloudformation describe-stack-events --stack-name ChrisLaptop --region us-east-2 --max-items 5 --starting-token <NextToken>