Quick Reminder, the objective of this guide is to design a secure infrastructure for a 3tier architecture and use terraform (infrastructure as code) to spin it all up on AWS. Check through the _first _part**and ****second part **of this tutorial to get a better background of what I am trying to achieve.
Also, feel free to check out the source code via Github Repo at the end of every part of the tutorial
The objective of this part 3 is to set up a terraform backend.
There is a good explanation of what it is here in the documentation https://www.terraform.io/docs/backends/index.html
What we want to be doing-especially in a team is to store our state file remotely, sensitive information is kept off disk. We will use S3 for state storage. You can use other services in fact Hashicorp has its own backend. Some people store state in git repos. However, I prefer to use S3.
We will use dynamodb for state lock. so dynamodb creates a lockID for each operation initiated on your terraform meaning when you make changes or do any work on your tf, it gets locked so no one else would be able to access it until you are done.
Navigate into the env-staging folder like the image below(this is assuming you are following my folder structure from part 2)
#terraform-provider #devops #terraform #automation