Good Morning,
I'm experiencing an issue where an ASG I'm creating is saying the Launch Template isn't valid with the following error:
Value () for parameter groupId is invalid.
I've got a simplified version of my code below. Can someone tell me what I'm missing? I've tried everything including
vpcSecurityGroups
,
securityGroupNames
,
networkInterfaces:securityGroups
as well as doing getSecurityGroup requests instead.
const group1s = new aws.ec2.SecurityGroup("secgrp-1s", {
vpcId: defaultVpcId,
description: "Enable HTTPS access",
ingress: [{
protocol: "tcp",
fromPort: 443,
toPort: 443,
cidrBlocks: ["0.0.0.0/0"],
}],
egress: [{
protocol: "-1",
fromPort: 0,
toPort: 0,
cidrBlocks: ["0.0.0.0/0"],
}],
}, {dependsOn: [appVpc]})
const launchTemplate = new aws.ec2.LaunchTemplate("spot-lt", {
imageId: "ami-0f93c02efd1974b8b",
instanceType: instanceType ?? "t3.micro",
vpcSecurityGroupIds: [group1s.id],
}, {dependsOn: [group1s]})
const autoScalingGroup = new aws.autoscaling.Group("spot-asg", {
desiredCapacity: desiredCapacity ?? 1,
minSize: minSize ?? 1,
maxSize: maxSize ?? 1,
availabilityZones: ["us-east-1a", "us-east-1b"],
mixedInstancesPolicy:{
instancesDistribution: {
onDemandBaseCapacity: onDemandBaseCapacity ?? 1,
onDemandPercentageAboveBaseCapacity: onDemandPercentageAboveBaseCapacity ?? 0,
spotAllocationStrategy: "lowest-price",
},
launchTemplate: {
launchTemplateSpecification:{
launchTemplateId: launchTemplate.id,
},
},
},
}, {dependsOn: [launchTemplate, group1s]})
Going a little nuts figuring out what I missed