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?

질문됨 일 년 전765회 조회
1개 답변
1

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

답변함 일 년 전
  • 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

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠