Skip to content

awsfanboy/aws-terraform-s3-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform S3 Backend with DynamoDB State lock

This Terraform script creates the S3 Backend for your Terraform code where you can store the State file. And creates the DynamoDB to lock the State file.

Prerequisites

Setup AWS profiles

For the dev account aws cli configure --profile dev

Initial installation

  • initate the terraform : terraform init
  • create a terraform workspace for dev : terraform workspace new dev. Use this if you have more than one workspaces.
  • plan the terraform for the dev account : terraform plan -var-file=dev.tfvars
  • apply the changes : terraform apply -var-file=dev.tfvars

Once deployed successfully now you can enable the s3 backend in backend.tf file.

  • Now we can re-configure the terrafrom init with new backend
  • run terraform init -backend-config="dev-be.conf" -reconfigure
  • check the dev-be.conf file.

Now you S3 back end is ready use in your terraform resources.

Authors

About

Set of terraform templates with examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages