Skip to content

Commit 90b7e2f

Browse files
committed
added new region-list parameter.
1 parent 53afa43 commit 90b7e2f

File tree

2 files changed

+160
-126
lines changed

2 files changed

+160
-126
lines changed

README.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,38 +32,46 @@ Follow the instructions below in order to deploy from this repository:
3232
```
3333

3434

35-
>**_NOTE:_**
36-
You will have to execute the following commands multiple times, passing the region name every time. You will do this for all regions of your global database. For example if your global database is deployed in us-east-1 and us-west-2, then you will have to execute the commands twice with the region parameter as us-east-1 and then again with region parameter as us-west-2.
37-
38-
39-
2. In the root directory, from the command line, run following command, for each region of the global database.
35+
2. In the root directory, from the command line, run following command. Please make sure you pass **all regions** where your global database clusters are deployed.
36+
This command will execute the cloudformation template and create all required resources in all passed regions.
4037

4138
```bash
42-
aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM --template-body file://managed-gdb-cft.yml --stack-name <stackname> --region <region name>
43-
44-
example:
45-
aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM --template-body file://managed-gdb-cft.yml --stack-name managed-gdb --region us-east-1
39+
usage:
40+
python3 buildstack.py [--template-body <'managed-gdb-cft.yml'>] <--stack-name 'stackname'> [--consent-anonymous-data-collect <'yes/no'>] <--region-list 'regionlist'>
4641

42+
example:
43+
python3 buildstack.py --template-body 'managed-gdb-cft.yml' --stack-name 'gdb-managed-ep' --consent-anonymous-data-collect 'yes' --region-list 'us-east-1,us-west-1'
4744
```
48-
This command will execute the cloudformation template and create all required resources in the region.
45+
46+
**What do these parameters mean?**
47+
48+
The script takes following parameters:
49+
50+
**-t OR --template-body**: CloudFormation template file. Defaults to managed0gdb-cft.yml. **(Optional)**
51+
**-r OR --region-list**: List of regions separated by commas, where the stack will be deployed. **(Required)**
52+
**-a OR --consent-anonymous-data-collect**: Opt-in or out of anonymous one time data collection.(yes/no). Only collects region name, creation time, stack name and uuid portion of the stack id (for uniqueness). Defaults to accept. **(Optional)**
53+
**-s OR --stack-name**: CloudFormation Stack Name. **(Required)**
54+
55+
>**_NOTE:_**
56+
You will have to execute the following command multiple times, passing the region name every time. You will do this for all regions of your global database. For example if your global database is deployed in us-east-1 and us-west-2, then you will have to execute the commands twice with the region parameter as us-east-1 and then again with region parameter as us-west-2.
4957

5058

5159
3. Once the cloudformation finishes building resources in all regions, execute the following command, for each region of the global database.
5260

5361
```bash
54-
python3 create_managed_endpoint.py --cluster-cname-pair='{"<global database clustername>":"<desired writer endpoint >"} [,"<global database clustername>":"<desired writer endpoint>"},...]' --hosted-zone-name=<hosted zone name> --region<aws region name>
62+
python3 create_managed_endpoint.py --cluster-cname-pair='{"<global database clustername>":"<desired writer endpoint >"} [,"<global database clustername>":"<desired writer endpoint>"},...]' --hosted-zone-name=<hosted zone name> --region-list <'regionlist'>
5563

5664
example:
57-
python3 create_managed_endpoint.py --cluster-cname-pair='{"gdb-cluster1":"writer1.myhostedzone.com" ,"gdb-cluster2":"writer2.myhostedzone.com"}' --hosted-zone-name=myhostedzone.com --region us-east-1
65+
python3 create_managed_endpoint.py --cluster-cname-pair='{"gdb-cluster1":"writer1.myhostedzone.com" ,"gdb-cluster2":"writer2.myhostedzone.com"}' --hosted-zone-name=myhostedzone.com --region-list 'us-east-1,us-west-1'
5866
```
5967

6068
**What do these parameters mean?**
61-
69+
6270
The script takes following parameters:
6371

6472
**-c OR --cluster-cname-pair** : Cluster and writer endpoint pair in '{\"cluname\":\"writer\"}' format. **(Required)**
6573
**-z OR --hosted-zone-name** : Name of the hosted zone. If one doesn't exist, it will be created. **(Required)**
66-
**-r OR --region** : Region Name. If no region is provided, default region will be used. **(Optional)**
74+
**-r OR --region-list** : List of regions separated by commas, where the stack will be deployed. **(Required)**
6775
**-sv OR --skip-vpc** : Skips adding vpcs in the hosted zone, if using an existing hosted zone. **(Optional)**
6876

6977
If you made any mistakes, no worries. You can just re-run it. The script is idempotent. And when you are ready to add a new global cluster, you can just re-run it with the new global-cluster and CNAME pair.

0 commit comments

Comments
 (0)