I'm creating and updating a LaunchTemplate using AWS CDK, like
new ec2.LaunchTemplate(stack, "my-template", {
launchTemplateName: "my-template",
instanceType: new ec2.InstanceType("g3.4xlarge"),
machineImage: ec2.MachineImage.lookup({
name: "my-ami-*",
owners: [ACCOUNT_ID]
}),
keyName: "my-key",
role: myRole,
securityGroup: mySecGroup
})
This creates a launch template as expected, but when I make changes, it results to a new version of the same template and the old version stays as the default. The intention is to update template default version so that when I launch instances using AWS SDK I get up to date instances.
So, how do I do this using AWS CDK?