Giter Club home page Giter Club logo

cloudformation-sample's Introduction

cloudformation-sample

Overview

The code demonstrate a Wordpress LAMP stack provisioned used Ansible and deployed to a AWS cloud provisioned using AWS's CloudFormation code.

AWS Cloud Provision

AWS VPC cloud has been configured to have one frontend (WEB facing) subnet, one private backend subnet, which can only be accessed on specific ports, ssh and mysql client 3306. The backend subnet access the internet through NAT gateway installed in the frontend subnet and then through the Internet Gateway. AWS cloudformation nested stacks have been used to in the following way:
CF code are separated in 3 component stacks

  • VPC with one public accessible subnet, one private subnet; a egress NAT gateway is in the public subnet to allow private subnet to access internet
  • frontend web server stack
  • backend database server stack
  • organize the CF code to three separate logical component stacks with one top level composer stack to produce final stack.
  • all nested component CF stack with well defined input parameters and output values strongly promote reuse

CF code location

CF overall stack
CF overall stack

CF VPC stack
CF VPC stack

Backend DB Server Provision

A Linux Server has been provisioned by ansible with mysql server.

Frontend Server Provision

A Linux Server has been provisioned by ansible with Apache, PHP and Wordpress. The frontend accesses the backend server through php-sql module. The already provisioned backend EC2 instance IP address (from its stack outputs) are passed to the frontend EC2 provision code through stack input parameters.

Potential improvements

  • further divide the frontend CF stack to web stack (apache reverse proxy) and app stack (php, wp dynamic component, in private subnet)
  • add load balancers to all tiers
  • using EC2 external inventory script to manage the ansible inventory of aws dynamic ip
  • create an provision EC2 instance to run ansible to provision all other EC2 worker instances.

Cloudformation code prefix convention

  • r - resource
  • s - stack
  • p - parameter
  • o - output

cloudformation-sample's People

Contributors

kknd22 avatar

Stargazers

 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.