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
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"
}
No requirements.
Name | Version |
---|---|
aws | n/a |
No modules.
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 |
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 |
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 |