Browse Source

Add support for ca-central-1 region to EC2 and S3 plugins

Closes #22458 #22454
animageofmine 8 years ago
parent
commit
e3546d59c4

+ 1 - 0
docs/plugins/discovery-ec2.asciidoc

@@ -124,6 +124,7 @@ The available values are:
 * `eu-central` (`eu-central-1`) for EU (Frankfurt)
 * `sa-east` (`sa-east-1`) for South America (São Paulo)
 * `cn-north` (`cn-north-1`) for China (Beijing)
+* `ca-central` (`ca-central-1`) for Canada (Central)
 
 [[discovery-ec2-usage-signer]]
 ===== EC2 Signer API

+ 1 - 0
docs/plugins/repository-s3.asciidoc

@@ -129,6 +129,7 @@ The available values are:
 * `eu-central` (`eu-central-1`) for EU (Frankfurt)
 * `sa-east` (`sa-east-1`) for South America (São Paulo)
 * `cn-north` (`cn-north-1`) for China (Beijing)
+* `ca-central` (`ca-central-1`) for Canada (Central)
 
 [[repository-s3-usage-signer]]
 ===== S3 Signer API

+ 5 - 1
plugins/discovery-ec2/src/main/java/org/elasticsearch/cloud/aws/AwsEc2ServiceImpl.java

@@ -193,6 +193,10 @@ public class AwsEc2ServiceImpl extends AbstractComponent implements AwsEc2Servic
                 case "cn-north-1":
                     endpoint = "ec2.cn-north-1.amazonaws.com.cn";
                     break;
+                case "ca-central":
+                case "ca-central-1":
+                    endpoint = "ec2.ca-central-1.amazonaws.com";
+                    break;
                 default:
                     throw new IllegalArgumentException("No automatic endpoint could be derived from region [" + region + "]");
             }
@@ -210,4 +214,4 @@ public class AwsEc2ServiceImpl extends AbstractComponent implements AwsEc2Servic
         // Ensure that IdleConnectionReaper is shutdown
         IdleConnectionReaper.shutdown();
     }
-}
+}

+ 4 - 0
plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/InternalAwsS3Service.java

@@ -221,6 +221,10 @@ public class InternalAwsS3Service extends AbstractLifecycleComponent implements
             case "us-gov-west-1":
                 endpoint = "s3-us-gov-west-1.amazonaws.com";
                 break;
+            case "ca-central":
+            case "ca-central-1":
+                endpoint = "s3.ca-central-1.amazonaws.com";
+                break;
             default:
                 throw new IllegalArgumentException("No automatic endpoint could be derived from region [" + region + "]");
         }