You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--vpc is parsed and never read: the instance silently launches in the DEFAULT VPC #673
Found while fixing #667, by the class gate added with it (TestLaunchFlagsAreWired).
--vpc is bound to the vpcID package global in cmd/launch_flags.go:234, and nothing ever reads it. There is no VPCID field on aws.LaunchConfig at all. Every consumer calls GetDefaultVPC instead:
cmd/launch_single.go:1103 (MPI SG) and :1130 (Windows SG)
pkg/aws/fsx.go:84 (FSx subnet selection)
cmd/app.go:336, cmd/image.go:489
So spawn launch --vpc vpc-0abc... is accepted, exits 0, and launches the instance in the default VPC — with a security group created in the default VPC too.
This is the same shape as #667 but harder to spot, because the identifier looks used: each of those call sites declares its own function-local vpcID, err := awsClient.GetDefaultVPC(...), which shadows the global. A plain grep (or a naive AST identifier count) reads those as uses of the flag variable. The gate in #667 skips any function that declares the name locally, which is what surfaced it.
Why it matters
An account with no default VPC, or one where the research VPC is not the default, cannot target a VPC at all. The failure is silent and the blast radius is network placement: wrong subnet, wrong route table, no route to an EFS/FSx mount target, and SG rules written into a VPC the instance is not in.
Fix sketch
Add VPCID string to aws.LaunchConfig and copy vpcID onto it in buildLaunchConfig (next to the #667 block).
Replace the GetDefaultVPC calls with "use config.VPCID if set, else default".
Subnet selection has to agree: GetSubnetForAZ/GetSubnets must be constrained to the chosen VPC, or an explicit --subnet-id in a different VPC should be a hard error rather than an EC2-level one.
Validate that an explicit --subnet-id and --vpc are consistent, since passing both is the natural way to use this.
Not folded into #667 because step 2/3 changes EFS/FSx subnet resolution, which deserves its own test pass. Listed in knownUnwiredFlags so the gate stays green and the debt stays visible.
Activity
fix(launch): stop dropping --security-group-ids and --subnet-id (#676)
test(sweep): classify every launch flag for the sweep path (#698)
fix(launch): honour --vpc instead of always using the default VPC (#700)
fix(sweep): honour CLI flags instead of dropping 83 of 127 (#697) (#724)