From 6fb74dbcf233eece040339849970635c878261ca Mon Sep 17 00:00:00 2001 From: Dharaneeshwaran Ravichandran Date: Mon, 10 Jun 2024 12:05:08 +0530 Subject: [PATCH] Minor utility func to retrieve vpc zone from vpc region --- region.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/region.go b/region.go index a09abed..d226892 100644 --- a/region.go +++ b/region.go @@ -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) +}