Giter Club home page Giter Club logo

pbf's Introduction

pbf

Set of projects/Terraform scripts to provision environment for a sample node.js todo app which can be found at https://github.com/waiyaki/postgres-express-node-tutorial

Limitations:

Notes: Repository consists of three projects:

  • sample node.js todo app (PEN) - cloned from https://github.com/waiyaki/postgres-express-node-tutorial and modified a bit:
    • read config variables from environment variables
    • expose Swagger API docs (only couple of endpoints annotated)
    • dockerizied
  • terraform project (TFCode) to provision stand-alone EC2 instance (with PEN application deployed as docker container) and RDS DB
    • needed to ensure that application works before creating an AMI image
  • terraform project (TFASG) to provision "production ready" infrastructure which consist of autoscaling group and load balancer

How to make it work:

  • download all projects locally
  • open PEN folder
  • run 'npm install'
  • run 'npm install --save sequelize pg pg-hstore'
  • run 'docker build todos --t <yourname_at_docker.io>/vbdemo'
  • run 'docker login' and login to your docker hub account
  • run 'docker push <yourname_at_docker.io>/vbdemo:latest'
  • review and update /shared/client_cloud_config.template file in both TF projects to use your name in the line 'docker pull <yourname_at_docker.io>/vbdemo
  • install terraform on EC2 instance in AWS [optional]
  • open TFCode folder
  • run 'terraform plan'
  • run 'terraform apply'
  • confirm that EC2 was created properly (navigate to port 8000/api-docs)
  • create AMI out of the EC2 instance and take note of its image_id
  • open TFASG folder
  • update main.tf aws_launch_configuration to use new image_id
  • run 'terraform plan'
  • run 'terraform apply'
  • confirm that environment setup properly by checking <load_balancer_public_URL>:8000/api-docs

P.S. I setup CNAME pbf.tripletee.com to point to ELB URL http://tf-lb-009624fd4c3474bdc9c5bfdbf1-2106718005.us-west-2.elb.amazonaws.com

pbf's People

Contributors

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