Skip to content

Commit

Permalink
Merge pull request #13 from dharaneeshvrd/vpc-zones
Browse files Browse the repository at this point in the history
Minor utility func to retrieve vpc zone from vpc region
  • Loading branch information
Power Cloud Robot authored Jun 10, 2024
2 parents 6bdc07d + 6fb74db commit 1c0d75a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions region.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,13 @@ func IsGlobalRoutingRequiredForTG(powerVSRegion string, vpcRegion string) bool {
}
return true
}

// VPCZonesForVPCRegion returns the VPC zones associated with the VPC region.
func VPCZonesForVPCRegion(region string) ([]string, error) {
for _, regionDetails := range Regions {
if regionDetails.VPCRegion == region {
return regionDetails.VPCZones, nil
}
}
return nil, fmt.Errorf("VPC zones corresponding to the VPC region %s is not found", region)
}

0 comments on commit 1c0d75a

Please sign in to comment.