Code Monkey home page Code Monkey logo

terraform-aws's Introduction

Terraform Nginx Deployment

** Requirement

  • A ~/.terraformrc file on user HOME, with the path to plugin directory

  • AWS Plugin module for terraform

  • AWS access, secret key & SSH keys which must be setup in 'terraform.tfvars' file

  • Preferable Terraform version v0.11.7

How to execute

First understand plan of execution by running following command

  • terraform plan --var-file="terraform.tfvars" --out plan_out

The command reads any file with extension '.tf' as for applying new or set desired state change to your infra. The plan_out file is the binary file which terraform uses to apply the infrastructure or any changes.

Apply the terraform plan on your setup by running

  • terraform apply "plan_out"

This would trigger the infrastructure deployment along with a lock file on the run path to lock the config changes that you are applying. A state file is also created after successful run to record the current state before further modification to the infrastructure

How to Update the infrastructure

To update the state of infra, just modify your original '.tf' file & repeat the step from the start without the '--out' option

  • terraform plan --var-file="terraform.tfvars"

    • terraform apply --var-file="terraform.tfvars"

This would refresh the state & generate back-up file of the state file that was created from previous execution as an insurance (roll-back) before applying the modification. It will also create lock file.

Reference

terraform-aws's People

Contributors

calshankar avatar

Watchers

James Cloos 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.