Skip to content

Commit 4358b1d

Browse files
committed
Merge branch 'main' into aronchick/aws-spot-part-3-remaining-resources
2 parents 27383d3 + 7f8e4d8 commit 4358b1d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cmd/beta/aws/create_deployment.go

+14
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,19 @@ func writeConfig() {
445445
deploymentID := m.Deployment.UniqueID
446446
deploymentPath := fmt.Sprintf("deployments.%s", deploymentID)
447447

448+
// Save VPC information for each region
449+
regions := make(map[string]interface{})
450+
if m.Deployment.AWS != nil && m.Deployment.AWS.RegionalResources != nil {
451+
for region, vpc := range m.Deployment.AWS.RegionalResources.VPCs {
452+
if vpc != nil {
453+
regions[region] = map[string]interface{}{
454+
"vpc_id": vpc.VPCID,
455+
"security_group_id": vpc.SecurityGroupID,
456+
}
457+
}
458+
}
459+
}
460+
448461
// Save minimal deployment details
449462
machines := make(map[string]interface{})
450463
for name, machine := range m.Deployment.GetMachines() {
@@ -460,6 +473,7 @@ func writeConfig() {
460473
"provider": "aws",
461474
"aws": map[string]interface{}{
462475
"account_id": m.Deployment.AWS.AccountID,
476+
"regions": regions,
463477
},
464478
"machines": machines,
465479
})

0 commit comments

Comments
 (0)