Add China region for s3 and ec2

China region name is `cn-north-1`.

Closes #156.
This commit is contained in:
David Pilato 2015-01-02 22:28:50 +01:00
parent a76e93502f
commit ea9609c642
4 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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 + "]");
}

View File

@ -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 + "]");
}

View File

@ -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";
}
}
}