From 7e55c8985c428c105d5946c7cb5b18c0aac5b049 Mon Sep 17 00:00:00 2001 From: Banji Jolaoso Date: Tue, 24 Jan 2023 09:54:54 -0800 Subject: [PATCH] added mel region --- .../com/amazonaws/regions/RegionDefaults.java | 26 +++++++++++++++++++ .../java/com/amazonaws/regions/Regions.java | 3 +++ .../amazonaws/regions/RegionUtilsTest.java | 2 +- .../amazonaws/services/s3/model/Region.java | 14 +++++++++- 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/aws-android-sdk-core/src/main/java/com/amazonaws/regions/RegionDefaults.java b/aws-android-sdk-core/src/main/java/com/amazonaws/regions/RegionDefaults.java index cb3e4de953..7dba5c89dd 100644 --- a/aws-android-sdk-core/src/main/java/com/amazonaws/regions/RegionDefaults.java +++ b/aws-android-sdk-core/src/main/java/com/amazonaws/regions/RegionDefaults.java @@ -651,6 +651,32 @@ public static List getRegions() { updateRegion(region, "sts", "sts.ap-south-2.amazonaws.com", false, true); + // Support for Asia Pacific (Melbourne) `ap-southeast-4` region + region = new Region("ap-southeast-4", "amazonaws.com"); + ret.add(region); + updateRegion(region, "autoscaling", "autoscaling.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "cognito-identity", "cognito-identity.ap-southeast-4.amazonaws.com", + false, true); + updateRegion(region, "cognito-idp", "cognito-idp.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "cognito-sync", "cognito-sync.ap-southeast-4.amazonaws.com", false, + true); + updateRegion(region, "data.iot", "data.iot.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "dynamodb", "dynamodb.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "ec2", "ec2.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "elasticloadbalancing", + "elasticloadbalancing.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "firehose", "firehose.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "iot", "iot.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "kinesis", "kinesis.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "kms", "kms.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "lambda", "lambda.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "logs", "logs.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "polly", "polly.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "s3", "s3.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "sdb", "sdb.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "sns", "sns.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "sqs", "sqs.ap-southeast-4.amazonaws.com", false, true); + updateRegion(region, "sts", "sts.ap-southeast-4.amazonaws.com", false, true); return ret; } diff --git a/aws-android-sdk-core/src/main/java/com/amazonaws/regions/Regions.java b/aws-android-sdk-core/src/main/java/com/amazonaws/regions/Regions.java index 763ed9aee8..09997d2ed5 100644 --- a/aws-android-sdk-core/src/main/java/com/amazonaws/regions/Regions.java +++ b/aws-android-sdk-core/src/main/java/com/amazonaws/regions/Regions.java @@ -74,6 +74,9 @@ public enum Regions { /** ap-southeast-2. */ AP_SOUTHEAST_2("ap-southeast-2"), + /** ap-southeast-4. */ + AP_SOUTHEAST_4("ap-southeast-4"), + /** ap-northeast-1. */ AP_NORTHEAST_1("ap-northeast-1"), diff --git a/aws-android-sdk-core/src/test/java/com/amazonaws/regions/RegionUtilsTest.java b/aws-android-sdk-core/src/test/java/com/amazonaws/regions/RegionUtilsTest.java index 4ad947223c..66596d19c0 100644 --- a/aws-android-sdk-core/src/test/java/com/amazonaws/regions/RegionUtilsTest.java +++ b/aws-android-sdk-core/src/test/java/com/amazonaws/regions/RegionUtilsTest.java @@ -46,7 +46,7 @@ public void testGetRegionByEndpointWithBogusEndpoint() { @Test public void testGetRegionsForService() { List regions = RegionUtils.getRegionsForService(ServiceAbbreviations.SimpleDB); - assertEquals(regions.size(), 14); + assertEquals(regions.size(), 15); boolean usEast1 = false; boolean usWest1 = false; for (Region curr : regions) { diff --git a/aws-android-sdk-s3/src/main/java/com/amazonaws/services/s3/model/Region.java b/aws-android-sdk-s3/src/main/java/com/amazonaws/services/s3/model/Region.java index f11569e9e9..5386506693 100644 --- a/aws-android-sdk-s3/src/main/java/com/amazonaws/services/s3/model/Region.java +++ b/aws-android-sdk-s3/src/main/java/com/amazonaws/services/s3/model/Region.java @@ -374,7 +374,19 @@ public enum Region { * bucket in this region. *

*/ - AP_HYD("ap-south-2"); + AP_HYD("ap-south-2"), + + /** + * The Asia Pacific (Melbourne) Region. This region uses Amazon S3 servers + * located in Melbourne. + *

+ * When using buckets in this region, set the client endpoint to + * s3-ap-southeast-4.amazonaws.com on all requests to these buckets + * to reduce any latency experienced after the first hour of creating a + * bucket in this region. + *

+ */ + AP_Melbourne("ap-southeast-4"); /** * Used to extract the S3 regional id from an S3 end point. Note this