Learn Terraform the Hard Way
This Terraform course has been written to help users to get to a deeper understanding and proficiency in Terraform. It doesn’t aim to make you an expert immediately, but you will be more confident about using it and building your knowledge up from that secure base.
You may well have already played with Terraform a little - maybe inherited some code at work, or hacked something together quickly that does the job. While that’s a great way to get going, a guided course that shows you how the pieces fit together by using it really helps you go further. Understanding these pieces enable you to more creative, solving your own challenges in ways that work for your problem domain.
Introduction
Why ‘The Hard Way’?
The ‘Hard Way’ is a method that emphasises the process required to learn anything. You don’t learn to ride a bike by reading about it, and you don’t learn to cook by reading recipes. Books can help (this one hopefully does) but it’s up to you to do the work.
This book shows you the path in small digestible pieces based on my decades of experience and tells you to actually type out the code. This is as important as riding a bike is to learning to ride a bike. Without the brain and the body working together, the knowledge does not properly seep in.
If you follow this course, you will get an understanding of Terraform that can form the basis of mastery as you use it going forward.
What You Will Get
This course aims to give students:
- A hands-on, quick and practical understanding of Terraform
- Enough information to understand what is going on as they go deeper into Terraform
- A familiarity with advanced Terraform usage
It does not:
- Give you a mastery of all Terraform’s internals
- Give a complete theoretical understanding of all the subtleties and underpinning technologies of Terraform
- Explain everything. There is plenty of time to go deeper and get all the nuances later if you need to. This book will also give you practice in doing your own research to solve your particular challenges
You are going to have to think sometimes to understand what is happening. This is The Hard Way, and it’s the only way to really learn. This course will save you time as you scratch your head later wondering what something means, or why that StackOverflow answer worked. You will also be able to construct your own solution and explain why that StackOverflow answer might not be perfect…
Assumptions
This book assumes some familiarity with very basic shell usage and commands. For those looking to get to that point, I recommend following this set of mini-tutorials:
It also assumes you are equipped with a bash shell and a terminal. If you’re unsure whether you’re in bash, type:
echo $BASH_VERSION
into your terminal. If you get a bash version string output like this then you are in bash:
3.2.57(1)-release
If you are not in bash, then that’s not necessarily a problem, but be aware of it as a possible issue if you stumble (and let me know!).
I also assume you have a relatively up-to-date version of Terraform. The Terraform version on my Mac as I write this is:
Terraform v0.11.7
If you don’t have Terraform, then the best place to download it at the time of writing is at:
You can compare this to yours by typing this on the command line:
terraform version
Again, if you are not in the same version, then that’s not necessarily a problem, but be aware of it as a possible issue if you stumble (and let me know!).
How The Course Works
The course demands that you type out all the exercises to follow it.
Frequently, the output will not be shown in the text, or even described.
Any explanatory text will assume you typed it out. Again, this is The Hard Way, and we use it because it works.
This is really important: you must get used to working in Terraform, and figuring out what’s going on by scratching your head and trying to work it out before I explain it to you. Eventually you will be on our own out there and will need to think for yourself.
Each section is self-contained, and must be followed in full to be sure that it makes sense. To help show you where you are, the shell command lines are numbered 1-n and the number is followed by a $
sign, eg:
1 $ first command2 $ second command
At the end of each section is a set of ‘cleanup’ commands (where needed) if you want to use them.