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

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ