GithubHelp home page GithubHelp logo

isabella232 / multi-region-application-architecture Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws-solutions/multi-region-application-architecture

0.0 0.0 0.0 4.3 MB

License: Apache License 2.0

Shell 5.14% JavaScript 18.33% TypeScript 74.39% CSS 1.48% HTML 0.65%

multi-region-application-architecture's Introduction

Multi Region Application Architecture

Many Amazon Web Services (AWS) customers have business requirements that require expedient recovery from regional failure with little-to-no application data loss. To help demonstrate an active/passive serverless architecture with easy failover to a backup region, AWS offers Multi-Region Application Architecture.

This reference architecture leverages Amazon Simple Storage Service (Amazon S3) Cross-Region replication and Amazon DynamoDB Global Tables to asynchronously replicate application data between the primary and secondary AWS Regions. A sample photo-sharing web application is also included and can be deployed after the solution has finished its deployment. The web application will serve as a visual demonstration of the solution’s back-end layers and to verify that regional failover is working.

On this Page

Architecture Overview

Architecture

The AWS CloudFormation template uses CloudFormation StackSets to deploy the routing layer and back-end infrastructure in both the primary and secondary (failover) AWS Regions. An optional second CloudFormation template can be deployed after the solution’s main template has finished its deployment. The second template will deploy an AWS Amplify sample web application hosted in an Amazon Simple Storage Service (Amazon S3) bucket, an Amazon CloudFront distribution to deliver the web application to users, and Amazon Cognito user and identity pools to enable users to sign in to the web application and access the routing layer & back-end infrastructure resources.

When the web application is loaded, it queries the solution’s routing layer for the current state of the application (active, fenced, failover), and configures AWS Amplify to target the solution’s resources in the correct Region. The state of the application is also retrieved when the user uploads a new photo or adds a comment. Depending on the state of the application, a message may be displayed to the user indicating certain actions are unavailable or prompt them to refresh the application. For more information, see Application States.

For more information, please see the solution's implementation guide.

Creating a custom build

The solution can be deployed through the CloudFormation template available on the solution home page. To make changes to the solution, download or clone this repo, update the source code and then run the deployment/build-s3-dist.sh script to deploy the updated Lambda code to an Amazon S3 bucket in your account.

Prerequisites:

1. Create an Amazon S3 Bucket

The CloudFormation templates are configured to pull the Lambda deployment packages from Amazon S3 buckets in the regions the templates are being launched in. The region in which you deploy the template will be referred to as the primary region. When deploying, you will supply the secondary region (which will serve as the disaster recovery region) as a CloudFormation stack parameter.

Create buckets in the desired regions with the region name appended to a common prefix (eg: my-bucket). For us-east-1 as the primary region and ap-northeast-1 as the secondary, create buckets named: my-bucket-us-east-1 and my-bucket-ap-northeast-1.

aws s3 mb s3://my-bucket-us-east-1 --region us-east-1
aws s3 mb s3://my-bucket-ap-northeast-1 --region ap-northeast-1

2. Create the deployment packages

Build the distributable:

chmod +x ./build-s3-dist.sh
./build-s3-dist.sh my-bucket multi-region-application-architecture my-version

Notes: The build-s3-dist script expects the bucket prefix as one of its parameters, and this value should not include a region suffix

Deploy the distributable to the Amazon S3 bucket in your account:

aws s3 sync ./regional-s3-assets/ s3://my-bucket-us-east-1/multi-region-application-architecture/my-version/ 
aws s3 sync ./global-s3-assets/ s3://my-bucket-us-east-1/multi-region-application-architecture/my-version/ 
aws s3 sync ./regional-s3-assets/ s3://my-bucket-ap-northeast-1/multi-region-application-architecture/my-version/ 
aws s3 sync ./global-s3-assets/ s3://my-bucket-ap-northeast-1/multi-region-application-architecture/my-version/ 

3. Launch the CloudFormation template.

  • Get the link of the multi-region-application-architecture.template uploaded to your Amazon S3 bucket in the primary region.
  • Deploy the Multi Region Application Architecture Solution to your account by launching a new AWS CloudFormation stack using the S3 link of the multi-region-application-architecture.template in the primary region.

Collection of operational metrics

This solution collects anonymous operational metrics to help AWS improve the quality and features of the solution. For more information, including how to disable this capability, please see the implementation guide.

License

  • This project is licensed under the terms of the Apache 2.0 license. See LICENSE.

multi-region-application-architecture's People

Contributors

aassadza avatar amazon-auto avatar beomseoklee avatar dependabot[bot] avatar georgebearden avatar jpeddicord avatar tomnight avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.