AWS removed endpoints package from Go SDK V2. Is there a way to get a list of AWS regions using Go SDK V2?
In V1 you could write something like this:
import "github.com/aws/aws-sdk-go/aws/endpoints"
...
...
partitions := endpoints.DefaultPartitions()
for _, p := range partitions {
for region := range p.Regions() {
validRegions[region] = struct{}{}
}
}
...
...
However, this seems no longer possible. I did notice an autogenerated json which seems to contain all the partitions, however I can't seem to figure out how to get the list of available regions in the code.
Is there a way to do this in Go SDK V2?