Giter Club home page Giter Club logo

terraformdemo's Introduction

Basic Infrastructure for awsredrive app

how to run the terraform script? Requirements

1)enviroment configured with an AWS Account 
2)Latest Terraform version
3)key pairs of working machine must be generated (required by ssh ) 

update the terraform-dev.tfvars/terraform-stage.tfvars with your preference
please dont forget to change the my_ip_adress in tfvars!!! (if you forget it, its ok it will work, but its not safe longterm)
run

terraform apply -var-file terraform-dev.tfvars -lock=false #for dev env
or
terraform apply -var-file terraform-stage.tfvars -lock=false #for stage env




#   terraform-dev.tfvars example
*#   env settings
*#   xe_vpc_cidr_block="10.0.0.0/16" //setting vpc ip range
*#   xe_subnet_cidr="10.0.10.0/24"//setting subnet  ip range
*#   env_prefix="dev" //enviroment? is it dev? prod?
*#   avail_zone="eu-west-3a" // az
*#   my_ip_adress="79.131.133.23/32" // source ip which ssh will permited
*#   instance_type="t2.micro" // main server type
*#   my_public_key_loc="~/.ssh/id_rsa.pub"  // location of public rsa pair
*#   my_private_key_loc="~/.ssh/id_rsa"// location of private rsa pair
*#   region="eu-west-3" //select region to deploy

*#   stream_numbers=4 // used by sqs sns blue print to create the right number of pairs
*#
*#   //app settings
*#   RedriveUrl="http://nohost.com/" //app config
*#   Timeout="10000" //app config
*#   ServiceUrl="https://www.google.com"//app config

**code summary

  • The main.tf contains the basic stracture, in particular**
  1. Declares the working region

  2. Creates networking infrastracture using the subnet module >>using myapp-subnet module

  3. Creates the sns sqs pairs (as many as we have declared in tfvars) and also create the IAM policy for the ec2 server >> using sqssnspairs module

  4. Creates the ec2 server, attach in the IAM policy created before, creates the security group for ssh and http, uploads always the latest version of the awsredrive app

  5. Demonizes the app and sets up to start on ec2 startup and generates a basic app config.json >> using webserver module

  6. Sets up a CloudWatch Alarm to check on ec2 health and reboot it if needed >> Open source Package used: module "ec2_instance_health_check"

>Open source Package used: module "ec2_instance_health_check"

github.com/terrablocks/aws-ec2-health-check.git this module creates a CloudWatch Alarm -making health checks to the ec2 - recover for system health check alarm and reboot for instance health check alarm github.com/terrablocks/aws-ec2-health-check.git"

terraformdemo's People

Contributors

litsakis avatar

Watchers

 avatar

terraformdemo's Issues

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.