Git Product home page Git Product logo

terraform-state-store's Introduction

Terraform: AWS Remote State configuration

Create a terraform state and lock store (terraform.io) using S3/DynamoDB backends

How to use this module

module "store" {
  source = "github.com/developmentseed/terraform-state-store"

  region = "${var.region}"

  table_name  = "${var.table_name}"
  bucket_name = "${var.bucket_name}"
}

Inputs

Name Description Required Default
region The AWS region yes
table_name The name of the dynamoDB table yes
bucket_name The name of the s3 bucket yes

Outputs

Name Description
table_name The name of the dynamoDB table.
bucket_name The name of the s3 bucket.

Deployment

Install terraform

$ brew install terraform

Init terraform config

โš ๏ธ Set ${AWS_ACCESS_KEY_ID} and ${AWS_SECRET_ACCESS_KEY} in your env

$ terraform init

Deploy stack (create s3 bucket and dynamoDB table)

$ terraform apply \
  --var region=us-east-1 \
  --var bucket_name=my-bucket-terraform-state \
  --var table_name=my-table-terraform-lock

Terraform Backend configuration

Include this block in your terraform file (or in a terraform.tf file)

# terraform.tf

terraform {
  backend "s3" {
    bucket         = "my-bucket-terraform-state"
    key            = "my-project/terraform.tfstate"
    region         = "us-east-1"
    dynamodb_table = "my-table-terraform-lock"
  }
}

terraform-state-store's People

Contributors

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