Tutorial for how to use Terraform through Docker Compose -- useful for managing different versions of Terraform across multiple projects.
This is an excerpt from our course: DevOps Deployment Automation with Terraform, AWS and Docker which you can find here:
https://londonapp.dev/devops-aws-terr...
If you prefer text format, find the blog post here: https://londonappdeveloper.com/2021/0...
Before you get started:
1. Clone the starter project: https://github.com/LondonAppDeveloper...
2. Download aws-vault and configure it for your AWS IAM administrator account: https://github.com/99designs/aws-vault
3. Ensure you have Docker Desktop if you're using macOS or Windows, or Docker and docker-compose if using Linux
The finished version of the code is available on this branch: https://github.com/LondonAppDeveloper...
Resources:
- Starter project: https://github.com/LondonAppDeveloper...
- Makefile for shorter commands: https://gitlab.com/LondonAppDev/recip...
- Blog post version of tutorial: https://londonappdeveloper.com/2021/0...
- Finished project code: https://github.com/LondonAppDeveloper...
Timestamps:
- 00:00 Introduction
- 00:06 Why use Terraform via Docker Compose?
- 2:02 Creating Docker Compose file
- 7:18 Authenticate using aws-vault
- 10:04 Initialise Terraform via Docker Compose
- 13:07 Create Terraform resource
- 25:04 Format Terraform
- 26:21 Validate Terraform
- 26:52 Plan Terraform
- 28:51 Apply Terraform
- 33:01 Destroy Terraform
- 35:13 Take the full course