Teamwork – sharing Terraform infrastructure state
You probably work with a team, and now you're using Terraform to manage your infrastructure, you'll face an issue: how does your team work together on infrastructure-as-code? There're many answers to that, and one crucial question to address is: how is transmitted or synchronized the Terraform state?
We'll see here how we can share the state using Git (a version control system where developers can store code), AWS S3 (an Amazon Web Services storage system using HTTP) or Consul (a tool for service discovery and a key-value store), chosen among many other solutions.
Getting ready
To step through this recipe, you will need the following:
A working Terraform installation
An AWS account with an SSH key configured in Terraform (refer to the Chapter 2, Provisioning IaaS with Terraform recipes)
A working Docker installation for the Consul simulation solution (optional)
An Internet connection
How to do it…
Let's start by having an initial infrastructure running...