GithubHelp home page GithubHelp logo

miteshsharma / terraformwiths3backend Goto Github PK

View Code? Open in Web Editor NEW
14.0 4.0 34.0 3 KB

Terraform configuration files with S3 backend and dynamo DB as locking mechanism

License: MIT License

HCL 100.00%
terraform s3 dynamodb remote-backends infrastructure-as-code

terraformwiths3backend's Introduction

Terraform with S3 backend and dynamo DB locking

Terraform helps us build, evolve, and manage our infrastructure using its configuration files across multiple providers. When we are building infrastructure with terraform configuration, a state file gets generated in the local workspace directory named "terraform.tfstate". This state file contains information about the provisioned infrastructure which terraform is managing. Whenever we do changes in terraform configuration, Terraform automatically determines which part of your configuration is already deployed and which needs to be changed with help of state file. State helps provides immutability to terraform as it already knows if one resource is present and prevent it to be deployed again when the same configuration executes.

Steps to run this code:

Step 1: Clone this repository

Step 2: Replace "ACCESS_KEY_HERE" with aws access key and "SECRET_KEY_HERE" with aws secret key. These keys can be generated from IAM module of aws.

Step 3: Go to s3 folder and execute terraform from below mentioned steps. This is going to create an S3 bucket which is used to store terraform state.

Step 4: Go to dynamoDB folder and execute terraform from below mentioned steps. This is going to create a dynamo DB table which is used for locking terraform configuration execution.

Step 5: Go back to the main folder and execute terraform to create EC2 instance with S3 as backend and DynamoDB as a locking mechanism.

Steps to execute any terraform code:

Step 1: Run command "terraform init" to init configuration workspace

Step 2: Run command "terraform plan" to see output which is going to be executed.

Step 5: Run command "terraform apply" to actually create terraform resources

Step 6: Run command "terraform destroy" to destroy created resources.

terraformwiths3backend's People

Contributors

miteshsharma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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