Code Monkey home page Code Monkey logo

two-tier-web-automation's Introduction

Cloud Automation and Control Systems

Project: Two-Tier web application automation with Terraform, Ansible, and GitHub Actions

Collaborators

Name GitHub Profile
Aanchal Thakur aanchalthakur28
Manickavasagam Arunachalam mvasu745
Neethu Paul npaul1909
Nisal Chandana Ekanayake NisalC
Solip Kim solipkimm

Architecture

image

Overview

The project focuses on building a robust two-tier web application automation solution using Terraform, Ansible, and GitHub Actions, specifically designed for the Amazon Web Services (AWS) environment. The architecture comprises 6 Virtual Machines (VMs) distributed across 4 Public and 2 Private Subnets in distinct availability zones.

Features

  • Network Architecture: The infrastructure comprises four Public Subnets for accessibility and two Private Subnets for enhanced security. Webserver (VM #2) plays a crucial role as a Bastion host, facilitating secure access to VMs (#5 and #6) residing in Private subnets.
  • Ansible Configuration Management: Utilizing Ansible Playbooks and Dynamic Inventory, the configuration of WebServers 3 and 4 in the Public Subnet involves comprehensive checks, including connectivity verification, service status validation, and patch updates.
  • GitHub Collaboration: The entire project, encompassing both Terraform and Ansible code, is hosted on GitHub to ensure version control, collaboration, and traceability.
  • GitHub Actions: GitHub Actions is used to perform security scan on each push to staging branch and when pull request is open to merge code into prod branch. Also it is employed to Automate future deployment of Terraform code for provisioning the Infrastucture resources and the first two Webservers.

Getting Started

To get started with the Two-Tier Web Application Automation framework, follow these simple steps:

  1. Clone the repository in Cloud9:

    git init
    git clone https://github.com/solipkimm/two-tier-web-automation.git
  2. Create S3 Bucket in AWS for Terraform State

  3. Update Backend S3 configuration in the below files.

    • Network/config.tf
    • Webserver/config.tf
    • Webserver/main.tf
  4. Create SSH key pairs for Prod (Make sure to have a public key in Prod/Webserver/)

    ssh-keygen -t rsa -f ~/.ssh/projectkey
  5. Deploy the network infrastructure:

    alias tf=terraform
    cd Prod/Network
    tf fmt
    tf validate
    tf plan
    tf apply -auto-approve
  6. Deploy the webserver infrastructure:

    cd Prod/Webserver
    tf fmt
    tf validate
    tf plan
    tf apply -auto-approve
  7. Install Ansible and required dependencies:

    sudo yum install โ€“y ansible
    sudo pip2.7 install boto3
  8. Update ansible configuration:

    sudo vim /etc/ansible/ansible.cfg

    Add the following line inside the config file and save.

    enable_plugins = aws_ec2
  9. Run the Ansible playbook:

    cd Ansible
    ansible-playbook -i aws_ec2.yaml playbook.yaml
  10. GitHub Actions for Automation

    • Push to 'staging' branch and Pull request to 'prod' branch will scan security.
    • Pull request to 'prod' branch will deploy terraform.

two-tier-web-automation's People

Contributors

solipkimm avatar 178597217-myseneca avatar nisalc avatar mvasu745 avatar 119917227-mysenca avatar

Watchers

 avatar

Forkers

alarasen

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.