Skip to content

Commit 4c7e384

Browse files
Kenta Suzukidadoonet
Kenta Suzuki
authored andcommitted
Support ap-northeast region for EC2 and S3
Closes #52.
1 parent 3616ed6 commit 4c7e384

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,18 @@ The plugin will automatically use the instance level security credentials (as of
4040

4141
### Region
4242

43-
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`).
43+
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:
44+
45+
* `us-east` (`us-east-1`)
46+
* `us-west` (`us-west-1`)
47+
* `us-west-1`
48+
* `us-west-2`
49+
* `ap-southeast` (`ap-southeast-1`)
50+
* `ap-southeast-1`
51+
* `ap-southeast-2`
52+
* `ap-northeast` (`ap-northeast-1`)
53+
* `eu-west` (`eu-west-1`)
54+
* `sa-east` (`sa-east-1`).
4455

4556

4657
## EC2 Discovery

src/main/java/org/elasticsearch/gateway/s3/S3Gateway.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ public S3Gateway(Settings settings, ThreadPool threadPool, ClusterService cluste
7676
region = "ap-southeast-1";
7777
} else if ("ap-southeast-2".equals(regionSetting.toLowerCase())) {
7878
region = "ap-southeast-2";
79+
} else if ("ap-northeast".equals(regionSetting.toLowerCase())) {
80+
region = "ap-northeast-1";
81+
} else if ("ap-northeast-1".equals(regionSetting.toLowerCase())) {
82+
region = "ap-northeast-1";
7983
} else if ("eu-west".equals(regionSetting.toLowerCase())) {
8084
region = "EU";
8185
} else if ("eu-west-1".equals(regionSetting.toLowerCase())) {

src/main/java/org/elasticsearch/repositories/s3/S3Repository.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ public S3Repository(RepositoryName name, RepositorySettings repositorySettings,
105105
region = "ap-southeast-1";
106106
} else if ("ap-southeast-2".equals(regionSetting)) {
107107
region = "ap-southeast-2";
108+
} else if ("ap-northeast".equals(regionSetting)) {
109+
region = "ap-northeast-1";
110+
} else if ("ap-northeast-1".equals(regionSetting)) {
111+
region = "ap-northeast-1";
108112
} else if ("eu-west".equals(regionSetting)) {
109113
region = "EU";
110114
} else if ("eu-west-1".equals(regionSetting)) {

0 commit comments

Comments
 (0)