
Terraform with remote state in S3
tl;dr: You can use S3 to store your Terraform state file remote. To migrate a local state file, add a backend "s3" {} block to your Terraform configuration and run terraform init -migrate-state. You no longer need to use DynamoDB for state locking, as S3 now has native support for this with use_lockfile = true. Table of Contents What is remote state? State locking Set AWS as a Terraform backend Migrating local state to S3 Conclusion What is remote state? When you run terraform apply, terraform will create a state file. When ever you make a change to your terraform configuration and apply it, terraform will check the difference between the config and the state before makeing the needed changes. ...