As recommended by AWS, Launch Templates are the preferred way when using EC2 Auto Scaling Groups. Instead of referencing the "AWS::AutoScaling::LaunchConfiguration" use the "AWS::EC2::LaunchTemplate". The code currently used for the Launch Configuration pretty much goes directy into the Launch Configuration "LaunchTemplateData" property.
The launch templates also support versioning which makes it easier updating the AMI or UserData without redeploying everything. Another benefit of versioning is that you can easily revert to a previous Launch Template.
As an examply the current CFN on the right and my take on the left.
As recommended by AWS, Launch Templates are the preferred way when using EC2 Auto Scaling Groups. Instead of referencing the "AWS::AutoScaling::LaunchConfiguration" use the "AWS::EC2::LaunchTemplate". The code currently used for the Launch Configuration pretty much goes directy into the Launch Configuration "LaunchTemplateData" property.
The launch templates also support versioning which makes it easier updating the AMI or UserData without redeploying everything. Another benefit of versioning is that you can easily revert to a previous Launch Template.
As an examply the current CFN on the right and my take on the left.