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.
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"
}
}
Name | Version |
---|---|
terraform | >= 1.4.6 |
aws | >= 4.65.0 |
No providers.
Name | Source | Version |
---|---|---|
dynamodb_tf_state_lock | ./modules/dynamodb_table | n/a |
tf_state_s3_bucket | ./modules/s3 | n/a |
No resources.
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 |
No outputs.