Terraform on AWS
Welcome
A practical, first-principles guide to Terraform — what each concept does, how the pieces fit together, when to reach for them, and where the failure modes are. The concepts are universal; AWS is the provider the examples are built on.
About This Course
Terraform has a reputation for being easy to start and hard to run well. Writing a few resources and running apply takes an afternoon. Running it for a team, across environments and accounts, without the state file becoming a source of fear — that is where most of the real learning lives, and where most tutorials stop.
This course covers both ends. It explains Terraform from first principles, in the order that makes the pieces click: what Infrastructure as Code actually buys you, the one idea the whole tool rests on — declarative state reconciled against reality — then resources, the state file, variables, iteration, and modules, then the parts of running Terraform in production that bite you: state operations, drift, testing, CI/CD, and scale.
Every topic follows a consistent structure: what it is, how it works, when to use it, when not to, the common mistakes that cost people real outages and money, and the best practices. Where two approaches compete — count versus for_each, workspaces versus directories, Terraform versus OpenTofu — the course compares them and says when each one fits rather than leaving that work to you.
Who This Is For
Engineers who build or operate cloud infrastructure, and those preparing to. A beginner can read it in order to build a mental model from zero. An experienced engineer can jump to a chapter to fill a gap or settle a decision — and plenty of senior engineers who ship complex systems still have soft spots in the basics, which is normal. It assumes you are comfortable on the command line and have used a cloud console, but it does not assume any prior Terraform.
A Note on Terraform, OpenTofu, and AWS
The course teaches HashiCorp Terraform 1.x. In 2023 HashiCorp changed Terraform's license, and the community forked the last open-source version as OpenTofu, now under the Linux Foundation. The two are almost entirely compatible; where they diverge on a feature, the course says so. Everything you learn about the language, state, and workflow applies to both.
Terraform is provider-agnostic — it manages AWS, Google Cloud, Kubernetes, GitHub, and hundreds more through the same language. But every code example has to target something concrete, so this course uses the AWS provider throughout. The concepts transfer to any provider; AWS is simply the vehicle that makes the examples real instead of abstract.
What You Should Already Know
- Command-line comfort — running commands, environment variables, editing files in a shell
- A basic feel for a cloud provider — what a virtual machine, a network, and a storage bucket are
- Version control with Git at a basic level — commits, branches, and pull requests
- What an API and a JSON document are, at the level of what they do
- No prior Terraform or Infrastructure-as-Code experience required
How the Course Is Built
The thirteen chapters are ordered so the early ones teach the core and the later ones build on it. Foundations and the core workflow come first, then the state file, the language features (variables, iteration, modules), then providers and a chapter of real AWS infrastructure. The later chapters cover organizing large codebases, collaboration and CI/CD, testing, production operations, and the advanced patterns that show up at scale.
A few principles run through every chapter. They are worth stating up front, because they explain why the course is shaped the way it is.
Chapter Map
Disclaimer
This course is an independent educational project created and maintained by Sergey Okinchuk. It is provided for learning and reference purposes only.
No affiliation. This course is not affiliated with, sponsored by, endorsed by, or officially connected to HashiCorp (an IBM company), the OpenTofu project, the Linux Foundation, Amazon Web Services, or any other company or project mentioned. All opinions, interpretations, and recommendations expressed are those of the author.
Trademarks. "Terraform" and "HashiCorp" are trademarks of HashiCorp, an IBM company. "OpenTofu" is a trademark of the Linux Foundation. "AWS" and "Amazon Web Services" are trademarks of Amazon.com, Inc. or its affiliates. All other product names, logos, and brands are the property of their respective owners. Use of these names and marks is for identification and educational purposes only and does not imply any endorsement.
Accuracy and currency. Terraform and the AWS provider evolve quickly — the provider ships releases most weeks, and language features, defaults, and command-line flags drift between versions. Facts in this course reflect the author's understanding at the time of writing and may not be current. Always consult the official Terraform documentation and AWS provider documentation as the authoritative sources before making operational decisions.
No warranty. This material is provided "as is" without warranty of any kind. Configuration and commands are illustrative, not production-ready, and may incur cost if applied to a real cloud account. The author accepts no liability for any loss or damage arising from reliance on the content.