Giter VIP home page Giter VIP logo

infrastracture-as-code-cloudformation's Introduction

Infrastructure as code (IaC) - Cloudformation

Description

This repo contains AWS cloudformation YAML code for deploying a high-availability web application in AWS.

The architecture contains an internet gateway attached and a load balancer attached to a VPC, the web application is deployed across two availability zones for high availability. Each availability zone has public and private subnets, the application servers are in the private subnet and the jumpbox/bastion server and the NAT gateway are part of the public subnet. The application servers are auto-scaled.

Technologies used

  • AWS
  • AWS cloudformation

Architecture diagram

arch-1

Getting started

  1. Setup command line access to your AWS account with AWS CLI link.
  2. In the project.json file set the values for AMIforServer, AMIforJumpBox, KeyPairNameForServer, KeyPairNameForJumpBox. The values AMI can be from the free tier,and the KeyPair can be created from the EC2 console
  3. The index.html file is zipped and uploaded to a s3 bucket as index.zip, the URL to the s3 bucket is part of the launch configuration on line 260 and has to be changed with the URL of your s3 bucket.
  4. There are two helper scripts in the /scripts directory, check the usage section below.
  5. After the cloudformation stack is successfully created go to the load balancer DNS name to view the web page rendered by index.html.

Usage

  1. Create the cloudformation stack using script create.sh
./scripts/create.sh {stack_name} {template} {parameters} 

Eg-

./scripts/create.sh stack1 project.yaml project.json 
  1. Update the cloudformation stack using script update.sh
./scripts/update.sh stack1 project.yaml project.json 

The cloudformation stack must already exist

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023 Nikhil Bhaskar

infrastracture-as-code-cloudformation's People

Contributors

nikhil-31 avatar

Watchers

 avatar  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.