Terraform for Google Cloud Essential Guide
Learn how to provision infrastructure in Google Cloud securely and efficiently
Bernd Nordhausen
BIRMINGHAMMUMBAI
Terraform for Google Cloud Essential Guide
Copyright 2022 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: Rahul Nair
Publishing Product Manager: Niranjan Naikwadi
Content Development Editor: Sujata Tripathi
Technical Editor: Nithik Cheruvakodan
Copy Editor: Safis Editing
Project Coordinator: Sean Lobo
Proofreader: Safis Editing
Indexer: Tejal Daruwale Soni
Production Designer: Aparna Bhagat
Senior Marketing Coordinator: Nimisha Dua
Marketing Coordinator: Gaurav Christian
First published: January 2023
Production reference: 1161222
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-80461-962-9
www.packt.com
Contributors
About the author
Bernd Nordhausen is an independent cloud consultant and Google Cloud trainer. He is a seasoned cloud architect with over 25 years of experience working with industry leaders such as Intel and Accenture. He holds over a dozen cloud certifications from all three major cloud service providers.
Bernd was previously the technical lead for the Google Cloud practice at Accenture Southeast Asia. In that role, he developed and implemented several large-scale deployments on Google Cloud using Terraform.
In a different century, Bernd received his B.Sc. in mathematics from the University of Alabama, and his M.Sc. and Ph.D. in computer science from the University of California, Irvine. When his head is not in the cloud, Bernd is an aspiring woodworker and trail runner. He also has a website where he talks more about his work, expertise, services and life at https://www.nordhausenconsulting.com/
Id like to thank Packt for reaching out and encouraging me to write this book, and then for the great people they brought in to help. I particularly want to thank Radek Simko for his excellent feedback. His input made this book what it is.
About the reviewer
Radek Simko is a senior software engineer at HashiCorp. He has been involved in various parts of the Terraform ecosystem for the last 5 years. He has contributed to maintaining the AWS provider, created the official Kubernetes provider, and bootstrapped the initial decoupled version of the plugin SDK. Since early 2020, he has been focusing on improving support for Terraform in editors via a dedicated language server. Prior to HashiCorp, he worked at Time Inc. for over 3 years, where he pioneered Terraform and proposed a number of bug fixes and features externally as an open-source contributor. Radek was born and raised in the Czech Republic, but he calls the UK his second home and enjoys traveling in his free time.
Preface
Google Cloud has adopted Terraform as the standard Infrastructure-as-Code (IaC) tool. Thus, a good understanding of Terraform is essential for any cloud architect and engineer working on Google Cloud. Yet no specific resources are available that focus on how to use Terraform on Google Cloud.
This book is the first book that teaches the reader about Terraform specifically for Google Cloud. We will take you on a journey from the basic concepts to deploying complex architectures using Terraform. Using easy-to-understand code examples, we will show you how to authenticate Terraform in Google Cloud, teach you all the essential concepts of the Terraform language as applied to Google Cloud, and deploy complete working architectures at the push of a button. We will also show you how to improve your Terraform workflow using Google Cloud-native and third-party tools.