Skip to content

Commit

Permalink
fix: preserve vpc ids in deployment config
Browse files Browse the repository at this point in the history
Co-Authored-By: David Aronchick <[email protected]>
  • Loading branch information
devin-ai-integration[bot] and aronchick committed Dec 13, 2024
1 parent 842e180 commit a3d6c91
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cmd/beta/aws/create_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,19 @@ func writeConfig() {
deploymentID := m.Deployment.UniqueID
deploymentPath := fmt.Sprintf("deployments.%s", deploymentID)

// Save VPC information for each region
regions := make(map[string]interface{})
if m.Deployment.AWS != nil && m.Deployment.AWS.RegionalResources != nil {
for region, vpc := range m.Deployment.AWS.RegionalResources.VPCs {
if vpc != nil {
regions[region] = map[string]interface{}{
"vpc_id": vpc.VPCID,
"security_group_id": vpc.SecurityGroupID,
}
}
}
}

// Save minimal deployment details
machines := make(map[string]interface{})
for name, machine := range m.Deployment.GetMachines() {
Expand All @@ -406,6 +419,7 @@ func writeConfig() {
"provider": "aws",
"aws": map[string]interface{}{
"account_id": m.Deployment.AWS.AccountID,
"regions": regions,
},
"machines": machines,
})
Expand Down

0 comments on commit a3d6c91

Please sign in to comment.