The Auto Scaling Group being created was to use the Launch Template being created. And that Launch Template was to use the Security Group being created.
When I created my CloudFormation stack, the stack failed with this error when my Auto Scaling Group was been created:
Even though the error says the issue is with the Auto Scaling Group, my issue was with my Launch Template. I attempted to specify the associated Security Group using the SecurityGroups property.
Security Groups[EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security group IDs instead. You cannot specify both a security group ID and security name in the same request.
When I switched to using SecurityGroupIds, my stack would create.
Here is the CloudFormation template for my Launch Template and Auto Scaling Group:
Published on Java Code Geeks with permission by Steven Wall, partner at our JCG program. See the original article here: AWS CloudFormation: AutoScaling Group – You must use a valid fully-formed launch template
Opinions expressed by Java Code Geeks contributors are their own.