Giter Club home page Giter Club logo

webapp's Introduction

A two-tier architecture for a single-page application

The purpose of this project is to quickly deploy a simple, two-tier architecture in the AWS cloud for a single-page application using IaC. This architecture reflects best practices when deploying an Application Load Balancer that’s open to the internet as per AWS Prescriptive Guidance. The solution is written in HCL which is Terraform's domain-specific language.

The components involved are the following:

  • VPC
  • EC2
  • Auto-scaling group (ASG)
  • Application load balancer (ALB)
  • Security groups

Architectural diagram

Diagram

Traffic flow

1) HTTP traffic is transmitted from the client to the ALB which is the first point of entry into the infrastructure.

2) The ALB forwards the traffic to the healthy, backend EC2 instances which host the web application.

3) Thanks to the NAT gateway, return traffic from the isolated, private subnets makes its way back to the ALB.

4) The web site is served to the client.

Usage

This code assumes that you have already Terraform installed locally. For instructions on how to install Terraform, please refer to Hashicorp's documentation here.

To deploy this solution, please follow the instructions below.

1) Clone the repository locally:

git clone https://github.com/nick22d/webapp.git

2) Navigate into the repository:

cd webapp/

3) Run the following commands in the order written:

terraform init
terraform apply --auto-approve

4) Verify functionality by browsing to the DNS name of the ALB returned in the output with the command below:

curl $(terraform output -raw alb_dns_name)

webapp's People

Contributors

nick22d avatar

Watchers

 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.