You can now deploy your complete Auto Scaling life cycle hooks solution using the aws cloudformation deploy command as demonstrated earlier in this chapter.
Once deployment is complete, to test life cycle management is working as expected, a simple change you can perform to force replacement of the current ECS container instance in your ECS cluster is to revert the AMI change you made earlier in this chapter:
ApplicationDesiredCount=1
ApplicationImageId=ami-ec957491
ApplicationImageTag=5fdbe62
ApplicationSubnets=subnet-a5d3ecee,subnet-324e246f
VpcId=vpc-f8233a80
Reverting the ECS AMI
Once you now deploy this change, again using the aws cloudformation deploy command as demonstrated in earlier example, next switch to the CloudFormation console and when the event to terminate the existing EC2 instance is raised, quickly...