Code Monkey home page Code Monkey logo

terraform-aws's Introduction

# Terraform-AWS
Multi-tier architecture postgreSQL deployment on AWS using ansible, packer and terraform.

Base OS AMI : Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ami-835b4efa
File information:
  1: ansible.yml: Ansible script to 
        •	install postgresql-9.5
        •	Change listening port to 9988
        •	Create database
        •	Create 3 users
  2: template.json: Packer template to
        •	Install python2.7
        •	Install ansible2.0
        •	Build an AWS AMI and run the ansible playbook to install and configure postgresql server
        •	Repack the configuration onto new AWS AMI
  3: main.tf : Terraform configuration file to
        •	Manage credentials required for building AWS resources
        •	Module to build VPC
        •	Module to build Bastion host for public access
        •	Security groups to configure for bastion host
        •	Security groups to configure for private instances
        •	Resource to build postgresql private instances
  4: access.tfvars: Terraform configuration file to contain AWS_ACCESS_KEY and AWS_SECRET_KEY
        
Required installations:
  1. Packer
        •	Wget https://releases.hashicorp.com/packer/1.0.3/packer_1.0.3_freebsd_amd64.zip
        •	Unzip and mv /usr/local
        •	Set linux environment path
        •	Packer validate template.json # To validate the template
             		o https://jsonlint.com/ to validate the json format.
        •	Packer build template.json (Executes ansible and builds an AMI stored in AWS account-AMI’s owned by me)
  2. Terraform
        •	Wget https://releases.hashicorp.com/terraform/0.9.11/terraform_0.9.11_linux_amd64.zip
        •	Mv /opt/terraform and unzip
        •	Set linux environment path
        •	Terraform import aws_key_pair.<key_name> <key_name> # for existing key pair to avoid key conflict
        •	Terraform get # To get all the module dependencies
        •	Terraform plan # to view the infrastructure to be built
        •	Terraform apply # to apply the template and build the infrastructure
        •	Terraform destroy # to tear down the infrastructure.
  3. SSH forwarding to access private instances.
        •	Ssh-add –K yourpemfile.pem
        •	Ssh –A Ubuntu@Bastion IP
        •	Ssh Ubuntu@instance_private IP
        

terraform-aws's People

Contributors

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