Skip to content

Latest commit

 

History

History
64 lines (43 loc) · 2.56 KB

File metadata and controls

64 lines (43 loc) · 2.56 KB

AWS S3 Terraform State

Introduction

This is a public and open source module that allows you to create all the necesary AWS Infrastructure to have your Terraform state stored and encrypted in S3.

Read more on how to hook this up with your current Terraform project:

https://developer.hashicorp.com/terraform/language/settings/backends/s3

Example Usage

To use this module, place this code in your Terraform:

module "s3_terraform_state" {
  source  = "michael-ortiz/s3-terraform-state/aws"
  version = "~> 1.0"

  # Optional Bucket Names to store state in multiple buckets
  state_bucket_names = ["MY_S3_STATE_BUCKET_NAME"]

  # Optional DynamoDB Lock Name
  state_lock_table_name = "MY_S3_STATE_BUCKET_NAME"
}

Requirements

No requirements.

Providers

Name Version
aws n/a

Modules

No modules.

Resources

Name Type
aws_dynamodb_table.state_lock resource
aws_s3_bucket.state_bucket resource
aws_s3_bucket_server_side_encryption_configuration.state_bucket resource
aws_s3_bucket_versioning.state_bucket resource
aws_caller_identity.current data source

Inputs

Name Description Type Default Required
state_bucket_names A list of S3 bucket to create to store terraform state list(string) null no
state_lock_table_name The name of the DynamoDB table to create to store Terraform state lock string null no

Outputs

Name Description
state_bucket_names The names of the S3 buckets that store Terraform state
state_lock_table_name The name of the DynamoDB table that stores Terraform state lock