This is an automated email from the ASF dual-hosted git repository.

xxyu pushed a commit to branch kylin4_on_cloud
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/kylin4_on_cloud by this push:
     new 7eafdff  # support multiple region for tool (#1807)
7eafdff is described below

commit 7eafdfffe30239a73aaae28db60e673eb9b94831
Author: Tengting Xu <34978943+muk...@users.noreply.github.com>
AuthorDate: Wed Feb 2 20:47:15 2022 +0800

    # support multiple region for tool (#1807)
    
    * # support multiple region for tool
    
    * # minor fix
---
 .../ec2-cluster-kylin4-template.yaml               | 28 ++++++++++++++
 cloudformation_templates/ec2-cluster-kylin4.yaml   | 28 ++++++++++++++
 cloudformation_templates/ec2-cluster-rds.yaml      | 30 +++++++++++++++
 .../ec2-cluster-spark-master.yaml                  | 28 ++++++++++++++
 .../ec2-cluster-spark-slave-template.yaml          | 28 ++++++++++++++
 .../ec2-cluster-spark-slave.yaml                   | 28 ++++++++++++++
 .../ec2-cluster-static-services.yaml               | 28 ++++++++++++++
 cloudformation_templates/ec2-cluster-zk.yaml       | 28 ++++++++++++++
 cloudformation_templates/ec2-or-emr-vpc.yaml       | 45 ++++++++++++++++++++++
 constant/yaml_params.py                            |  1 +
 instances/aws_instance.py                          |  1 +
 kylin_configs.yaml                                 |  1 +
 12 files changed, 274 insertions(+)

diff --git a/cloudformation_templates/ec2-cluster-kylin4-template.yaml 
b/cloudformation_templates/ec2-cluster-kylin4-template.yaml
index 5b77e12..9ccd13b 100644
--- a/cloudformation_templates/ec2-cluster-kylin4-template.yaml
+++ b/cloudformation_templates/ec2-cluster-kylin4-template.yaml
@@ -142,6 +142,34 @@ Mappings:
       HVMebs: ami-00ac27054b887ff5c
     cn-northwest-1:
       HVMebs: ami-0135cb179d33fbe3e
+    us-east-1:
+      HVMebs: ami-0c6b1d09930fac512
+    us-east-2:
+      HVMebs: ami-0ebbf2179e615c338
+    us-west-2:
+      HVMebs: ami-0cb72367e98845d43
+    us-west-1:
+      HVMebs: ami-015954d5e5548d13b
+    eu-west-1:
+      HVMebs: ami-030dbca661d402413
+    ca-central-1:
+      HVMebs: ami-08a9b721ecc5b0a53
+    eu-west-2:
+      HVMebs: ami-0009a33f033d8b7b6
+    eu-central-1:
+      HVMebs: ami-0ebe657bc328d4e82
+    ap-southeast-1:
+      HVMebs: ami-0b5a47f8865280111
+    ap-northeast-2:
+      HVMebs: ami-08ab3f7e72215fe91
+    ap-northeast-1:
+      HVMebs: ami-00d101850e971728d
+    ap-southeast-2:
+      HVMebs: ami-0fb7513bcdc525c3b
+    ap-south-1:
+      HVMebs: ami-00e782930f1c3dbc7
+    sa-east-1:
+      HVMebs: ami-058141e091292ecf0
 
 Conditions:
   NotNullSubnetId:
diff --git a/cloudformation_templates/ec2-cluster-kylin4.yaml 
b/cloudformation_templates/ec2-cluster-kylin4.yaml
index dcfd775..9d909dd 100644
--- a/cloudformation_templates/ec2-cluster-kylin4.yaml
+++ b/cloudformation_templates/ec2-cluster-kylin4.yaml
@@ -141,6 +141,34 @@ Mappings:
       HVMebs: ami-00ac27054b887ff5c
     cn-northwest-1:
       HVMebs: ami-0135cb179d33fbe3e
+    us-east-1:
+      HVMebs: ami-0c6b1d09930fac512
+    us-east-2:
+      HVMebs: ami-0ebbf2179e615c338
+    us-west-2:
+      HVMebs: ami-0cb72367e98845d43
+    us-west-1:
+      HVMebs: ami-015954d5e5548d13b
+    eu-west-1:
+      HVMebs: ami-030dbca661d402413
+    ca-central-1:
+      HVMebs: ami-08a9b721ecc5b0a53
+    eu-west-2:
+      HVMebs: ami-0009a33f033d8b7b6
+    eu-central-1:
+      HVMebs: ami-0ebe657bc328d4e82
+    ap-southeast-1:
+      HVMebs: ami-0b5a47f8865280111
+    ap-northeast-2:
+      HVMebs: ami-08ab3f7e72215fe91
+    ap-northeast-1:
+      HVMebs: ami-00d101850e971728d
+    ap-southeast-2:
+      HVMebs: ami-0fb7513bcdc525c3b
+    ap-south-1:
+      HVMebs: ami-00e782930f1c3dbc7
+    sa-east-1:
+      HVMebs: ami-058141e091292ecf0
 
 Conditions:
   NotNullSubnetId:
diff --git a/cloudformation_templates/ec2-cluster-rds.yaml 
b/cloudformation_templates/ec2-cluster-rds.yaml
index 24ea418..5f612de 100644
--- a/cloudformation_templates/ec2-cluster-rds.yaml
+++ b/cloudformation_templates/ec2-cluster-rds.yaml
@@ -80,6 +80,36 @@ Parameters:
     AllowedValues:
       - cn-northwest-1a
       - cn-northwest-1b
+      - cn-north-1a
+      - cn-north-1b
+      - us-east-1a
+      - us-east-1b
+      - us-east-2a
+      - us-east-2b
+      - us-west-2a
+      - us-west-2b
+      - us-west-1a
+      - us-west-1b
+      - eu-west-1a
+      - eu-west-1b
+      - ca-central-1a
+      - ca-central-1b
+      - eu-west-2a
+      - eu-west-2b
+      - eu-central-1a
+      - eu-central-1b
+      - ap-southeast-1a
+      - ap-southeast-1b
+      - ap-northeast-2a
+      - ap-northeast-2b
+      - ap-northeast-1a
+      - ap-northeast-1b
+      - ap-southeast-2a
+      - ap-southeast-2b
+      - ap-south-1a
+      - ap-south-1b
+      - sa-east-1a
+      - sa-east-1b
   DbName:
     Type: String
     Description: Initilize a db in rds
diff --git a/cloudformation_templates/ec2-cluster-spark-master.yaml 
b/cloudformation_templates/ec2-cluster-spark-master.yaml
index dfd5a8b..66320d1 100644
--- a/cloudformation_templates/ec2-cluster-spark-master.yaml
+++ b/cloudformation_templates/ec2-cluster-spark-master.yaml
@@ -123,6 +123,34 @@ Mappings:
       HVMebs: ami-00ac27054b887ff5c
     cn-northwest-1:
       HVMebs: ami-0135cb179d33fbe3e
+    us-east-1:
+      HVMebs: ami-0c6b1d09930fac512
+    us-east-2:
+      HVMebs: ami-0ebbf2179e615c338
+    us-west-2:
+      HVMebs: ami-0cb72367e98845d43
+    us-west-1:
+      HVMebs: ami-015954d5e5548d13b
+    eu-west-1:
+      HVMebs: ami-030dbca661d402413
+    ca-central-1:
+      HVMebs: ami-08a9b721ecc5b0a53
+    eu-west-2:
+      HVMebs: ami-0009a33f033d8b7b6
+    eu-central-1:
+      HVMebs: ami-0ebe657bc328d4e82
+    ap-southeast-1:
+      HVMebs: ami-0b5a47f8865280111
+    ap-northeast-2:
+      HVMebs: ami-08ab3f7e72215fe91
+    ap-northeast-1:
+      HVMebs: ami-00d101850e971728d
+    ap-southeast-2:
+      HVMebs: ami-0fb7513bcdc525c3b
+    ap-south-1:
+      HVMebs: ami-00e782930f1c3dbc7
+    sa-east-1:
+      HVMebs: ami-058141e091292ecf0
 
 Conditions:
   NotNullSubnetId:
diff --git a/cloudformation_templates/ec2-cluster-spark-slave-template.yaml 
b/cloudformation_templates/ec2-cluster-spark-slave-template.yaml
index 0e6260c..94c6d4c 100644
--- a/cloudformation_templates/ec2-cluster-spark-slave-template.yaml
+++ b/cloudformation_templates/ec2-cluster-spark-slave-template.yaml
@@ -113,6 +113,34 @@ Mappings:
       HVMebs: ami-00ac27054b887ff5c
     cn-northwest-1:
       HVMebs: ami-0135cb179d33fbe3e
+    us-east-1:
+      HVMebs: ami-0c6b1d09930fac512
+    us-east-2:
+      HVMebs: ami-0ebbf2179e615c338
+    us-west-2:
+      HVMebs: ami-0cb72367e98845d43
+    us-west-1:
+      HVMebs: ami-015954d5e5548d13b
+    eu-west-1:
+      HVMebs: ami-030dbca661d402413
+    ca-central-1:
+      HVMebs: ami-08a9b721ecc5b0a53
+    eu-west-2:
+      HVMebs: ami-0009a33f033d8b7b6
+    eu-central-1:
+      HVMebs: ami-0ebe657bc328d4e82
+    ap-southeast-1:
+      HVMebs: ami-0b5a47f8865280111
+    ap-northeast-2:
+      HVMebs: ami-08ab3f7e72215fe91
+    ap-northeast-1:
+      HVMebs: ami-00d101850e971728d
+    ap-southeast-2:
+      HVMebs: ami-0fb7513bcdc525c3b
+    ap-south-1:
+      HVMebs: ami-00e782930f1c3dbc7
+    sa-east-1:
+      HVMebs: ami-058141e091292ecf0
 
 Conditions:
   NotNullSubnetId:
diff --git a/cloudformation_templates/ec2-cluster-spark-slave.yaml 
b/cloudformation_templates/ec2-cluster-spark-slave.yaml
index ba5a923..b0f2ef7 100644
--- a/cloudformation_templates/ec2-cluster-spark-slave.yaml
+++ b/cloudformation_templates/ec2-cluster-spark-slave.yaml
@@ -119,6 +119,34 @@ Mappings:
       HVMebs: ami-00ac27054b887ff5c
     cn-northwest-1:
       HVMebs: ami-0135cb179d33fbe3e
+    us-east-1:
+      HVMebs: ami-0c6b1d09930fac512
+    us-east-2:
+      HVMebs: ami-0ebbf2179e615c338
+    us-west-2:
+      HVMebs: ami-0cb72367e98845d43
+    us-west-1:
+      HVMebs: ami-015954d5e5548d13b
+    eu-west-1:
+      HVMebs: ami-030dbca661d402413
+    ca-central-1:
+      HVMebs: ami-08a9b721ecc5b0a53
+    eu-west-2:
+      HVMebs: ami-0009a33f033d8b7b6
+    eu-central-1:
+      HVMebs: ami-0ebe657bc328d4e82
+    ap-southeast-1:
+      HVMebs: ami-0b5a47f8865280111
+    ap-northeast-2:
+      HVMebs: ami-08ab3f7e72215fe91
+    ap-northeast-1:
+      HVMebs: ami-00d101850e971728d
+    ap-southeast-2:
+      HVMebs: ami-0fb7513bcdc525c3b
+    ap-south-1:
+      HVMebs: ami-00e782930f1c3dbc7
+    sa-east-1:
+      HVMebs: ami-058141e091292ecf0
 
 Conditions:
   NotNullSubnetId:
diff --git a/cloudformation_templates/ec2-cluster-static-services.yaml 
b/cloudformation_templates/ec2-cluster-static-services.yaml
index 6916c63..d75baf8 100644
--- a/cloudformation_templates/ec2-cluster-static-services.yaml
+++ b/cloudformation_templates/ec2-cluster-static-services.yaml
@@ -113,6 +113,34 @@ Mappings:
       HVMebs: ami-00ac27054b887ff5c
     cn-northwest-1:
       HVMebs: ami-0135cb179d33fbe3e
+    us-east-1:
+      HVMebs: ami-0c6b1d09930fac512
+    us-east-2:
+      HVMebs: ami-0ebbf2179e615c338
+    us-west-2:
+      HVMebs: ami-0cb72367e98845d43
+    us-west-1:
+      HVMebs: ami-015954d5e5548d13b
+    eu-west-1:
+      HVMebs: ami-030dbca661d402413
+    ca-central-1:
+      HVMebs: ami-08a9b721ecc5b0a53
+    eu-west-2:
+      HVMebs: ami-0009a33f033d8b7b6
+    eu-central-1:
+      HVMebs: ami-0ebe657bc328d4e82
+    ap-southeast-1:
+      HVMebs: ami-0b5a47f8865280111
+    ap-northeast-2:
+      HVMebs: ami-08ab3f7e72215fe91
+    ap-northeast-1:
+      HVMebs: ami-00d101850e971728d
+    ap-southeast-2:
+      HVMebs: ami-0fb7513bcdc525c3b
+    ap-south-1:
+      HVMebs: ami-00e782930f1c3dbc7
+    sa-east-1:
+      HVMebs: ami-058141e091292ecf0
 
 Conditions:
   NotNullSubnetId:
diff --git a/cloudformation_templates/ec2-cluster-zk.yaml 
b/cloudformation_templates/ec2-cluster-zk.yaml
index 7d43e8d..f8bd47a 100644
--- a/cloudformation_templates/ec2-cluster-zk.yaml
+++ b/cloudformation_templates/ec2-cluster-zk.yaml
@@ -99,6 +99,34 @@ Mappings:
       HVMebs: ami-00ac27054b887ff5c
     cn-northwest-1:
       HVMebs: ami-0135cb179d33fbe3e
+    us-east-1:
+      HVMebs: ami-0c6b1d09930fac512
+    us-east-2:
+      HVMebs: ami-0ebbf2179e615c338
+    us-west-2:
+      HVMebs: ami-0cb72367e98845d43
+    us-west-1:
+      HVMebs: ami-015954d5e5548d13b
+    eu-west-1:
+      HVMebs: ami-030dbca661d402413
+    ca-central-1:
+      HVMebs: ami-08a9b721ecc5b0a53
+    eu-west-2:
+      HVMebs: ami-0009a33f033d8b7b6
+    eu-central-1:
+      HVMebs: ami-0ebe657bc328d4e82
+    ap-southeast-1:
+      HVMebs: ami-0b5a47f8865280111
+    ap-northeast-2:
+      HVMebs: ami-08ab3f7e72215fe91
+    ap-northeast-1:
+      HVMebs: ami-00d101850e971728d
+    ap-southeast-2:
+      HVMebs: ami-0fb7513bcdc525c3b
+    ap-south-1:
+      HVMebs: ami-00e782930f1c3dbc7
+    sa-east-1:
+      HVMebs: ami-058141e091292ecf0
 
 Conditions:
   NotNullSubnetId:
diff --git a/cloudformation_templates/ec2-or-emr-vpc.yaml 
b/cloudformation_templates/ec2-or-emr-vpc.yaml
index e5c5236..3deb667 100644
--- a/cloudformation_templates/ec2-or-emr-vpc.yaml
+++ b/cloudformation_templates/ec2-or-emr-vpc.yaml
@@ -57,6 +57,51 @@ Mappings:
     cn-northwest-1:
       '1': cn-northwest-1a
       '2': cn-northwest-1b
+    cn-north-1:
+      '1': cn-north-1a
+      '2': cn-north-1b
+    us-east-1:
+      '1': us-east-1a
+      '2': us-east-1b
+    us-east-2:
+      '1': us-east-2a
+      '2': us-east-2b
+    us-west-2:
+      '1': us-west-2a
+      '2': us-west-2b
+    us-west-1:
+      '1': us-west-1a
+      '2': us-west-1b
+    eu-west-1:
+      '1': eu-west-1a
+      '2': eu-west-1b
+    ca-central-1:
+      '1': ca-central-1a
+      '2': ca-central-1b
+    eu-west-2:
+      '1': eu-west-2a
+      '2': eu-west-2b
+    eu-central-1:
+      '1': eu-central-1a
+      '2': eu-central-1b
+    ap-southeast-1:
+      '1': ap-southeast-1a
+      '2': ap-southeast-1b
+    ap-northeast-2:
+      '1': ap-northeast-2a
+      '2': ap-northeast-2b
+    ap-northeast-1:
+      '1': ap-northeast-1a
+      '2': ap-northeast-1b
+    ap-southeast-2:
+      '1': ap-southeast-2a
+      '2': ap-southeast-2b
+    ap-south-1:
+      '1': ap-south-1a
+      '2': ap-south-1b
+    sa-east-1:
+      '1': sa-east-1a
+      '2': sa-east-1b
 
 Resources:
   Ec2InstanceProfile:
diff --git a/constant/yaml_params.py b/constant/yaml_params.py
index cfb7fcf..d921d32 100644
--- a/constant/yaml_params.py
+++ b/constant/yaml_params.py
@@ -38,6 +38,7 @@ class Params(Enum):
     SECURITY_GROUP = 'SecurityGroupId'
     INSTANCE_PROFILE = 'InstanceProfileId'
     SUBNET_GROUP_NAME = 'SubnetGroupName'
+    ZONE = 'Zone'
 
     # Rds params
     DB_HOST = 'DbHost'
diff --git a/instances/aws_instance.py b/instances/aws_instance.py
index cc8b822..53ff742 100644
--- a/instances/aws_instance.py
+++ b/instances/aws_instance.py
@@ -409,6 +409,7 @@ class AWSInstance:
         # update needed params
         params[Params.SUBNET_GROUP_NAME.value] = self.get_subnet_group()
         params[Params.SECURITY_GROUP.value] = self.get_security_group_id()
+        Params[Params.ZONE.value] = self.region + 'b'
         resp = self.create_stack(
             stack_name=self.rds_stack_name,
             file_path=self.path_of_rds_stack,
diff --git a/kylin_configs.yaml b/kylin_configs.yaml
index 18ec304..adf2dbe 100644
--- a/kylin_configs.yaml
+++ b/kylin_configs.yaml
@@ -156,6 +156,7 @@ EC2_RDS_PARAMS:
   Ec2Mode: test
   RDSEngine: mysql
   RDSEngineVersion: 5.7.25
+  Zone: cn-northwest-1b
 
 EC2_STATIC_SERVICES_PARAMS:
   # Note: params details check in related yaml file

Reply via email to