This template creates an Auto Scaling group with a launch template and a lifecycle hook. The launch template is used to configure the instances in the Auto Scaling group, including the image, instance type, security groups, and user data. The lifecycle hook is used to perform a custom action on instances when they are launched. In this example, the lifecycle hook keeps each instance in a wait state for 60 seconds to allow the user data script to complete before the instance enters the InService state.

CloudFormation Template