mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
Add China region for s3 and ec2
China region name is `cn-north-1`. Closes #156.
This commit is contained in:
parent
a76e93502f
commit
ea9609c642
@ -85,8 +85,8 @@ The `cloud.aws.region` can be set to a region and will automatically use the rel
|
||||
* `ap-northeast` (`ap-northeast-1`)
|
||||
* `eu-west` (`eu-west-1`)
|
||||
* `eu-central` (`eu-central-1`)
|
||||
* `sa-east` (`sa-east-1`).
|
||||
|
||||
* `sa-east` (`sa-east-1`)
|
||||
* `cn-north` (`cn-north-1`)
|
||||
|
||||
## EC2 Discovery
|
||||
|
||||
|
@ -125,6 +125,8 @@ public class AwsEc2Service extends AbstractLifecycleComponent<AwsEc2Service> {
|
||||
endpoint = "ec2.eu-central-1.amazonaws.com";
|
||||
} else if (region.equals("sa-east") || region.equals("sa-east-1")) {
|
||||
endpoint = "ec2.sa-east-1.amazonaws.com";
|
||||
} else if (region.equals("cn-north") || region.equals("cn-north-1")) {
|
||||
endpoint = "ec2.cn-north-1.amazonaws.com";
|
||||
} else {
|
||||
throw new ElasticsearchIllegalArgumentException("No automatic endpoint could be derived from region [" + region + "]");
|
||||
}
|
||||
|
@ -191,6 +191,10 @@ public class InternalAwsS3Service extends AbstractLifecycleComponent<AwsS3Servic
|
||||
return "s3-sa-east-1.amazonaws.com";
|
||||
} else if ("sa-east-1".equals(region)) {
|
||||
return "s3-sa-east-1.amazonaws.com";
|
||||
} else if ("cn-north".equals(region)) {
|
||||
return "s3-cn-north-1.amazonaws.com";
|
||||
} else if ("cn-north-1".equals(region)) {
|
||||
return "s3-cn-north-1.amazonaws.com";
|
||||
} else {
|
||||
throw new ElasticsearchIllegalArgumentException("No automatic endpoint could be derived from region [" + region + "]");
|
||||
}
|
||||
|
@ -121,6 +121,10 @@ public class S3Repository extends BlobStoreRepository {
|
||||
region = "sa-east-1";
|
||||
} else if ("sa-east-1".equals(regionSetting)) {
|
||||
region = "sa-east-1";
|
||||
} else if ("cn-north".equals(regionSetting)) {
|
||||
region = "cn-north-1";
|
||||
} else if ("cn-north-1".equals(regionSetting)) {
|
||||
region = "cn-north-1";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user