For non-default VPCs, AWS needs the subnets it can launch the instance in, otherwise it will try to launch the instance in the default VPC, even if the supplied security groups are attached to a non-default VPC. Furthermore there can only be 1 subnet specified per availability zone, so query the subnets in the VPC of the host (as the instance needs to be launched in the same network), and pick 1 of the VPC's subnets per AZ. |
||
|---|---|---|
| .. | ||
| awscloud.go | ||
| secure-instance.go | ||