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?

已提問 1 年前檢視次數 765 次
1 個回答
1

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

已回答 1 年前
  • 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

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南