Skip to content

Commit d51d15f

Browse files
Support multiple Regions (#171)
* Allow controller to run against regions in addition to us-west-2 * Use Region to build lattice endpoint * Update it for endpoint environment
1 parent 5ee3670 commit d51d15f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pkg/aws/services/vpclattice.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,14 @@ type defaultLattice struct {
2525
vpclatticeiface.VpcLatticeAPI
2626
}
2727

28-
const (
29-
GammaEndpoint = "https://mercury-gamma.us-west-2.amazonaws.com/"
30-
BetaProdEndpoint = "https://vpc-lattice.us-west-2.amazonaws.com"
31-
)
32-
3328
func NewDefaultLattice(sess *session.Session, region string) *defaultLattice {
3429
var latticeSess vpclatticeiface.VpcLatticeAPI
30+
31+
latticeEndpoint := "https://vpc-lattice." + region + ".amazonaws.com"
3532
endpoint := os.Getenv("LATTICE_ENDPOINT")
3633

3734
if endpoint == "" {
38-
endpoint = BetaProdEndpoint
35+
endpoint = latticeEndpoint
3936
}
4037

4138
latticeSess = vpclattice.New(sess, aws.NewConfig().WithRegion(region).WithEndpoint(endpoint))

0 commit comments

Comments
 (0)