Skip to content

Commit

Permalink
update Route53 endpoint resolution in us-iso regions (#4056)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanZhengYP authored Mar 21, 2022
1 parent 09d75b3 commit 080875c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-Route53-5142179f.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "Route53",
"description": "fix Route53 endpoints resolution for us-iso-* regions"
}
10 changes: 10 additions & 0 deletions lib/region_config_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
"signingRegion": "cn-northwest-1"
},
"us-gov-*/route53": "globalGovCloud",
"us-iso-*/route53": {
"endpoint": "{service}.c2s.ic.gov",
"globalEndpoint": true,
"signingRegion": "us-iso-east-1"
},
"us-isob-*/route53": {
"endpoint": "{service}.sc2s.sgov.gov",
"globalEndpoint": true,
"signingRegion": "us-isob-east-1"
},

"*/waf": "globalSSL",

Expand Down
19 changes: 13 additions & 6 deletions test/region_config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,20 @@ describe('region_config.js', function() {
expect(service.endpoint.host).to.equal('iam.cn-north-1.amazonaws.com.cn');
});

it('uses "global" endpoint for Route53 in cn-north-1', function() {
var service = new AWS.Route53({
region: 'cn-north-1'
[
['cn-north-1', 'cn-northwest-1', 'route53.amazonaws.com.cn'],
['us-gov-west-1', 'us-gov-west-1', 'route53.us-gov.amazonaws.com'],
['us-iso-west-1', 'us-iso-east-1', 'route53.c2s.ic.gov'],
['us-isob-west-1', 'us-isob-east-1', 'route53.sc2s.sgov.gov'],
].forEach(function([region, signingRegion, endpoint]) {
it('uses "global" endpoint for Route53 in ' + region, function () {
var service = new AWS.Route53({
region
});
expect(service.isGlobalEndpoint).to.equal(true);
expect(service.signingRegion).to.equal(signingRegion);
expect(service.endpoint.host).to.equal(endpoint);
});
expect(service.isGlobalEndpoint).to.equal(true);
expect(service.signingRegion).to.equal('cn-northwest-1');
expect(service.endpoint.host).to.equal('route53.amazonaws.com.cn');
});

it('enables signature version 4 signing in cn-*', function() {
Expand Down

0 comments on commit 080875c

Please sign in to comment.