,Mastering Terraform
Copyright © 2024 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, without the prior written permission of the publisher,
except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information
presented. However, the information contained in this book is sold without warranty, either express or
implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for
any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and
products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot
guarantee the accuracy of this information.
Group Product Manager: Preet Ahuja
Publishing Product Manager: Surbhi Suman
Book Project Manager: Ashwin Kharwa
Senior Editor: Runcil Rebello
Technical Editor: Nithik Cheruvakodan
Copy Editor: Safis Editing
Proofreader: Runcil Rebello
Indexer: Subalakshmi Govindhan
Production Designer: Joshua Misquitta
DevRel Marketing Coordinator: Rohan Dobhal
First published: July 2024
Production reference: 1120724
,Published by Packt Publishing Ltd.
Grosvenor House
11 St Paul’s Square
Birmingham
B3 1RB, UK
ISBN 978-1-83508-601-8
www.packtpub.com
To my Mom and Dad, thank you for investing in a family PC, recognizing my talent, believing in me,
and giving me a gentle push in the right direction.
Foreword
Cloud computing has transformed the way applications are built and delivered. In the early days of
the public cloud, the services available were generally low-level infrastructure. Today, the
hyperscalers provide a broad range of services, including specialized data stores, application
middleware, and many compute platforms for virtual machines, containers, and functions.
Applications can be quickly built by composing together services. Scaling with demand becomes
totally elastic without complex capacity planning.
While building applications is easier, our infrastructure is now more complex than ever. Infrastructure
as Code is broadly adopted to manage the complexity of cloud infrastructure by allowing users to
simply codify the resources required to support their application. HashiCorp Terraform is the de facto
standard for Infrastructure as Code, driven by an extensible ecosystem that supports thousands of
integrations spanning public cloud providers, Software as a Service (SaaS), hardware systems, and
more.
This new book on Terraform provides a pragmatic, hands-on approach covering real-world scenarios.
The author, Mark Tinderholt, deeply understands cloud environments as a principal architect at
Microsoft Azure. For readers new to Terraform, the book provides a foundational overview to
understand Terraform, the HashiCorp Configuration Language (HCL), and how to use the
extensible providers. From there, the author covers the key concepts needed for cloud-based
applications and patterns such as GitOps and CI/CD.
Going from the basic concepts, the author then dives into real-world examples of using Terraform to
manage virtual machines, containers, and functions across AWS, Azure, and GCP. This takes the core
, concepts and applies them, to enable you to quickly do the same. This hands-on approach enables
you to better understand how to apply Terraform outside of simple examples.
The book ends by providing guidance on best practices in production environments, how to adopt
Terraform for existing infrastructure using the import mechanisms, and finally, how to continue
learning through Terraform certifications. There are multiple levels of Terraform certifications, with
tens of thousands of people certified. The certifications are useful both to test your knowledge and
competence with Terraform and to share with prospective employers.
This book is a great resource for anybody hoping to learn more about Infrastructure as Code with
HashiCorp Terraform and quickly get an understanding of how to use it to build applications in the
major cloud providers. The author brings a depth of understanding as a senior engineer with a first-
hand understanding of how cloud providers are built, having spent years working with Terraform.
Armon Dadgar
Co-Founder and CTO of HashiCorp
Contributors
About the author
Mark Tinderholt has over two decades of experience as a software developer and architect. With a
solid foundation in application development and a pioneering role in cloud technology adoption, he
has led diverse teams across numerous industry verticals on multiple cloud platforms. As an expert in
cloud technology, Mark embraced Terraform early on to empower his development teams with
greater control over their application environments. He organizes his local HashiCorp User Group
(HUG) and is a HashiCorp ambassador. He also hosts a popular YouTube channel called Azure
Terraformer.