Migrate LaunchConfiguration to LaunchTemplate

0

I have a CloudFormation template that creates an AutoScaling Group (AWS::AutoScaling::AutoScalingGroup) using a LaunchConfiguration (AWS::AutoScaling::LaunchConfiguration). I'm trying to convert it to use a LaunchTemplate (AWS::EC2::LaunchTemplate). I've updated the cloudformation template, creating a new launchTemplate resource. I created a CloudFormation Change set and I see that the LaunchConfiguration will be deleted, a LaunchTemplate will be created and the AutoScaleGroup will be updated. I used the same parameters as the existing CloudFormationTemplate. The error occurs when I attempt to Execute the changeset.

You must use a valid fully-formed launch template. The parameter groupName cannot be used with the parameter subnet

I'm supplying the Security Group ID via a parameter

 SecurityGroups:
          - !Ref InstanceSecurityGroup

If I switch to using the group name, I get a different error regarding defaultVPCs Looking at a partial execution, I see that the Security GroupID is listed in the LaunchTemplate under the "Security Groups" and not the "Security Group IDs", which is where I would expect it. How can I update my CloudFormation template to use a LaunchTemplate?

asked a year ago749 views
1 Answer
1

The property to set in the CloudFormation template is SecurityGroupIDs and not SecurityGroups

answered a year ago
  • Additionally, you don't need to include the Subnet in the launch template. The ASG will ignore it in favor of the subnets specified on the ASG itself

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions