Primary (Active) Region

Deploying the Amazon CloudFormation Template

1.1 Deploy the application to the primary region (us-east-1) by launching this CloudFormation Template .

1.2 Specify the stack parameters.

Leave isPrimary and LatestAmiId as the default values

1.3 Click Next

1.4 Leave Configure stack options page as all defaults

1.5 Click Next

1.6 Scroll to the bottom of the page, click the checkbox to acknowledge IAM role creation, and then click Create stack.

1.7 Wait until the stack’s status reports CREATE_COMPLETE. Then navigate to the Outputs tab and record the values of the APIGURL, WebsiteURL, and WebsiteBucket outputs. You will need these to complete future steps.

You must wait for the stack to successfully be created before moving on to the next step.

We are going to configure DynamoDB global tables replicating from AWS Region N. Virginia (us-east-1) to AWS Region N. California (us-west-1).

Deploying Amazon DynamoDB Global Tables

2.1 Navigate to DynamoDB in the console.

2.2 Click on the Tables link on the left-hand side.

2.3 Find the unishophotstandby table, and click into the configuration settings.

2.4 Under the Global Tables table, click the Create replica button.

2.5 Select the US West (N. California) region under Available replication Region, and then click the Create replica button.

2.5 Wait for the US WEST (N. California) region’s status to be Active.

Configure the Active-Primary Website

3.1 Change your console ’s region to N. Virginia (us-east-1) using the Region Selector in the upper right corner.

You will need the Amazon CloudFormation output parameter values from the Active-Primary stack to complete this section.

3.2 Using your favorite editor, create a new file named config.json file. Initialize the document to the template provided below. Next, set the host property equal to the APIGURL output value from the Active-Primary CloudFormation stack. Remove the trailing slash (/) if one is present. Finally, set the region property to us-east-1.

    "host": "{{Replace with your APIGURL copied from above}}",
    "region": "us-east-1"

Your final config.json should look similar to this example.

    "host": "",
    "region": "us-east-1"

Upload the configuration to Amazon S3

4.1 Navigate to S3 in the console.

4.2 Find the bucket that begins with active-primary-uibucket-. It will have a random suffix from the Amazon CloudFormation deployment.

4.3 Next, click into the bucket and then click the Upload button.

4.4 Click the Add Files button and specify the config.json file from the previous step.

4.5 Scroll down to Permissions Section section. Select the Specify Individual ACL permissions radio button. Next, check the Read checkbox next to Everyone (public access) grantee.

4.6 Enable the I understand the effets of these changes on the specified objects. checkbox. Then click the Upload button to continue.

Congragulations! Your Primary Region and DynamoDB Global Tables are working!