Skip to content

infraspecdev/terraform-aws-s3-dynamodb-backend

Repository files navigation

Terraform Module for S3 and DynamoDB for Terraform State Locking

This module creates an S3 bucket and a DynamoDB table, which can be used to store Terraform state files and lock state files to prevent concurrent modifications.

Usage

To use this module, include it in your Terraform configuration like this:

module "tf_state_backend" {
  source = "github.com/infraspecdev/terraform-aws-s3-dynamodb-backend?ref=main"

  s3_bucket_name          = "unique-s3-bucket-name"
  dynamodb_table_name     = "unique_dynamodb_table"
  dynamodb_read_capacity  = 21
  dynamodb_write_capacity = 21
  dynamodb_table_tags = {
    Environment = "dev"
    Project     = "backend"
  }
  s3_bucket_tags = {
    Environment = "dev"
    Project     = "backend"
  }
}

Requirements

Name Version
terraform >= 1.4.6
aws >= 4.65.0

Providers

No providers.

Modules

Name Source Version
dynamodb_tf_state_lock ./modules/dynamodb_table n/a
tf_state_s3_bucket ./modules/s3 n/a

Resources

No resources.

Inputs

Name Description Type Default Required
dynamodb_read_capacity (Optional) Number of read units for this table. number 20 no
dynamodb_table_name (Required) Unique Table name within a region name of the table string n/a yes
dynamodb_table_tags (Optional) A map of tags to populate on the created table. map(string) {} no
dynamodb_write_capacity (Optional) Number of write units for this table. number 20 no
s3_bucket_name Name of the bucket. If omitted, Terraform will assign a random, unique name. string n/a yes
s3_bucket_tags (Optional) Map of tags to assign to the bucket. map(string) {} no

Outputs

No outputs.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages