INNER CODE UNIT · Go
regions
kubernetes-sigs/aws-ebs-csi-driver · hack/generate-volume-limits-table/main.go:95
regions = append(regions, *region.RegionName)
}
// As of the time of writing this code, AWS has 34 publicly available regions.
// This number should only ever go down if a region is closed. Do not decrease it otherwise.
if len(regions) < 34 {
return nil, fmt.Errorf("expected at least 34 regions but got %d (account is probably missing opt-in regions)", len(regions))
}
return regions, nil
}
func getInstanceTypesForRegion(ctx context.Context, region string) (map[string]instanceData, error) {
cfg, err := config.LoadDefaultConfig(ctx, config.WithRegion(region))
if err != nil {
return nil, err
}
ec2Client := ec2.NewFromConfig(cfg)