cuddly-family-16114
02/27/2024, 4:04 PMValue () 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 missedfast-vase-27755
02/27/2024, 5:18 PMgroupId
at all hence empty value is invalidcuddly-family-16114
02/27/2024, 6:06 PMaws.ec2.LaunchTemplate
https://www.pulumi.com/registry/packages/aws/api-docs/ec2/launchtemplate/#inputsfast-vase-27755
02/27/2024, 6:10 PMcuddly-family-16114
02/27/2024, 6:10 PMcreating Auto Scaling Group (spot-asg-232abd0): ValidationError: You must use a valid fully-formed launch template. Value () for parameter groupId is invalid. The value cannot be empty
fast-vase-27755
02/27/2024, 6:24 PMlaunchTemplate: {
launchTemplateSpecification:{
launchTemplateId: launchTemplate.id,
},
},
is malformed
this is a tricky one, do you see launch template created?
I also noticed that you have dependency loop for autoScalingGroup
.. I do not think you need dependsOn statement here at allcuddly-family-16114
02/27/2024, 6:26 PMcuddly-family-16114
02/27/2024, 6:27 PMfast-vase-27755
02/27/2024, 6:29 PMcuddly-family-16114
02/27/2024, 6:30 PMlaunchTemplateSpecification
malformed? I'm not doing any overrides, so there shouldn't be anything there.cuddly-family-16114
02/27/2024, 6:30 PMfast-vase-27755
02/27/2024, 6:30 PMcuddly-family-16114
02/27/2024, 6:31 PMI wish I ever deployed ec2 ASGs with pulumiDon't worry about it, appreciate the help. I'm trying to come over from terraform so expecting to hit roadblocks
fast-vase-27755
02/27/2024, 6:31 PMcuddly-family-16114
02/27/2024, 6:37 PMcuddly-family-16114
02/27/2024, 9:44 PMfast-vase-27755
02/27/2024, 9:51 PM