Skip to content

Commit

Permalink
Minor utility func to retrieve vpc zone from vpc region
Browse files Browse the repository at this point in the history
  • Loading branch information
dharaneeshvrd committed Jun 10, 2024
1 parent 6bdc07d commit 6fb74db
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 6fb74db

Please sign in to comment.