From 4c7e384c9606a597e9d9e09b9ebd0f0503576183 Mon Sep 17 00:00:00 2001 From: Kenta Suzuki Date: Wed, 5 Feb 2014 14:41:48 +0900 Subject: [PATCH] Support ap-northeast region for EC2 and S3 Closes #52. --- README.md | 13 ++++++++++++- .../org/elasticsearch/gateway/s3/S3Gateway.java | 4 ++++ .../elasticsearch/repositories/s3/S3Repository.java | 4 ++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 25dcf48844c..5897d5926e7 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,18 @@ The plugin will automatically use the instance level security credentials (as of ### Region -The `cloud.aws.region` can be set to a region and will automatically use the relevant settings for both `ec2` and `s3`. The available values are: `us-east` (`us-east-1`), `us-west` (`us-west-1`), `us-west-1`, `us-west-2` `ap-southeast` (`ap-southeast-1`), `ap-southeast-1`, `ap-southeast-2`, `ap-northeast` (`ap-northeast-1`) `eu-west` (`eu-west-1`), `sa-east` (`sa-east-1`). +The `cloud.aws.region` can be set to a region and will automatically use the relevant settings for both `ec2` and `s3`. The available values are: + +* `us-east` (`us-east-1`) +* `us-west` (`us-west-1`) +* `us-west-1` +* `us-west-2` +* `ap-southeast` (`ap-southeast-1`) +* `ap-southeast-1` +* `ap-southeast-2` +* `ap-northeast` (`ap-northeast-1`) +* `eu-west` (`eu-west-1`) +* `sa-east` (`sa-east-1`). ## EC2 Discovery diff --git a/src/main/java/org/elasticsearch/gateway/s3/S3Gateway.java b/src/main/java/org/elasticsearch/gateway/s3/S3Gateway.java index af6dfa5eaea..49c986aefdb 100644 --- a/src/main/java/org/elasticsearch/gateway/s3/S3Gateway.java +++ b/src/main/java/org/elasticsearch/gateway/s3/S3Gateway.java @@ -76,6 +76,10 @@ public class S3Gateway extends BlobStoreGateway { region = "ap-southeast-1"; } else if ("ap-southeast-2".equals(regionSetting.toLowerCase())) { region = "ap-southeast-2"; + } else if ("ap-northeast".equals(regionSetting.toLowerCase())) { + region = "ap-northeast-1"; + } else if ("ap-northeast-1".equals(regionSetting.toLowerCase())) { + region = "ap-northeast-1"; } else if ("eu-west".equals(regionSetting.toLowerCase())) { region = "EU"; } else if ("eu-west-1".equals(regionSetting.toLowerCase())) { diff --git a/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java b/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java index 9f16109b135..3f47f589a21 100644 --- a/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java +++ b/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java @@ -105,6 +105,10 @@ public class S3Repository extends BlobStoreRepository { region = "ap-southeast-1"; } else if ("ap-southeast-2".equals(regionSetting)) { region = "ap-southeast-2"; + } else if ("ap-northeast".equals(regionSetting)) { + region = "ap-northeast-1"; + } else if ("ap-northeast-1".equals(regionSetting)) { + region = "ap-northeast-1"; } else if ("eu-west".equals(regionSetting)) { region = "EU"; } else if ("eu-west-1".equals(regionSetting)) {