# Terraform Remote State Creates an S3 bucket and a dynamodb table for terraform remote state storage. ## Table of Contents 1. [Usage](#usage) 1. [Requirements](#requirements) 1. [Providers](#Providers) 1. [Inputs](#inputs) 1. [Outputs](#outputs) ## Usage ### First Time Creation If this is your first time using this module, remove the `backend.tf` file, then create fresh via: ``` terraform apply ``` 1. Save the output config as `backend.tf` 1. Edit `backend.tf` and copy the `bucket` name to the `key` name. 1. Run `terraform init`. Answer YES to whether to copy the backend.tf 1. If it was successful, run `rm terraform.tfstate*` 1. Run a final `terraform apply` ### Later usage Run `terraform output` to get the config, and copy it as a `backend.tf` in your other projects. Be careful not to reuse the key. ### Making Changes Once you've migrated the backend to s3, you probably do not want to make changes. Do so at your own risk. ## Requirements | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | | [aws](#requirement\_aws) | ~> 4.0 | ## Providers | Name | Version | |------|---------| | [aws](#provider\_aws) | 4.34.0 | ## Modules No modules. ## Resources | Name | Type | |------|------| | [aws_dynamodb_table.lock_table](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/dynamodb_table) | resource | | [aws_s3_bucket.state_storage](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource | | [aws_s3_bucket_acl.state_storage](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_acl) | resource | | [aws_s3_bucket_lifecycle_configuration.state_storage](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_lifecycle_configuration) | resource | | [aws_s3_bucket_public_access_block.state_storage](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_public_access_block) | resource | | [aws_s3_bucket_server_side_encryption_configuration.state_storage](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_server_side_encryption_configuration) | resource | | [aws_s3_bucket_versioning.state_storage](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_versioning) | resource | ## Inputs No inputs. ## Outputs | Name | Description | |------|-------------| | [backend\_tf](#output\_backend\_tf) | n/a |