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?

posta un anno fa765 visualizzazioni
1 Risposta
1

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

con risposta un anno fa
  • 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

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande