diff --git a/aws/endpoints/endpoints.go b/aws/endpoints/endpoints.go index f82babf6f95..9c936be6cf9 100644 --- a/aws/endpoints/endpoints.go +++ b/aws/endpoints/endpoints.go @@ -170,10 +170,13 @@ func PartitionForRegion(ps []Partition, regionID string) (Partition, bool) { // A Partition provides the ability to enumerate the partition's regions // and services. type Partition struct { - id string - p *partition + id, dnsSuffix string + p *partition } +// DNSSuffix returns the base domain name of the partition. +func (p Partition) DNSSuffix() string { return p.dnsSuffix } + // ID returns the identifier of the partition. func (p Partition) ID() string { return p.id } diff --git a/aws/endpoints/endpoints_test.go b/aws/endpoints/endpoints_test.go index 23c63e96f7b..7c569258db1 100644 --- a/aws/endpoints/endpoints_test.go +++ b/aws/endpoints/endpoints_test.go @@ -330,8 +330,11 @@ func TestPartitionForRegion(t *testing.T) { if !ok { t.Fatalf("expect partition to be found") } + if e, a := expect.DNSSuffix(), actual.DNSSuffix(); e != a { + t.Errorf("expect %s partition DNSSuffix, got %s", e, a) + } if e, a := expect.ID(), actual.ID(); e != a { - t.Errorf("expect %s partition, got %s", e, a) + t.Errorf("expect %s partition ID, got %s", e, a) } } diff --git a/aws/endpoints/v3model.go b/aws/endpoints/v3model.go index ff6f76db6eb..523ad79ac0a 100644 --- a/aws/endpoints/v3model.go +++ b/aws/endpoints/v3model.go @@ -54,8 +54,9 @@ type partition struct { func (p partition) Partition() Partition { return Partition{ - id: p.ID, - p: &p, + dnsSuffix: p.DNSSuffix, + id: p.ID, + p: &p, } }