From 080875cd19df60169de792d571bda39c3f134459 Mon Sep 17 00:00:00 2001 From: AllanZhengYP Date: Mon, 21 Mar 2022 15:02:36 -0700 Subject: [PATCH] update Route53 endpoint resolution in us-iso regions (#4056) --- .../next-release/bugfix-Route53-5142179f.json | 5 +++++ lib/region_config_data.json | 10 ++++++++++ test/region_config.spec.js | 19 +++++++++++++------ 3 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 .changes/next-release/bugfix-Route53-5142179f.json diff --git a/.changes/next-release/bugfix-Route53-5142179f.json b/.changes/next-release/bugfix-Route53-5142179f.json new file mode 100644 index 0000000000..dd1482465a --- /dev/null +++ b/.changes/next-release/bugfix-Route53-5142179f.json @@ -0,0 +1,5 @@ +{ + "type": "bugfix", + "category": "Route53", + "description": "fix Route53 endpoints resolution for us-iso-* regions" +} \ No newline at end of file diff --git a/lib/region_config_data.json b/lib/region_config_data.json index c0c0108e5e..ecf8cea164 100644 --- a/lib/region_config_data.json +++ b/lib/region_config_data.json @@ -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", diff --git a/test/region_config.spec.js b/test/region_config.spec.js index 7d28eccf3d..5a0b485784 100644 --- a/test/region_config.spec.js +++ b/test/region_config.spec.js @@ -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() {