Ritesh Modi
Deep-Dive Terraform on Azure
Automated Delivery and Deployment of Azure Solutions
1st ed.
![Logo of the publisher Ritesh Modi Hyderabad Telangana India ISBN - photo 2](/uploads/posts/book/275575/images/506295_1_En_BookFrontmatter_Figa_HTML.png)
Logo of the publisher
Ritesh Modi
Hyderabad, Telangana, India
ISBN 978-1-4842-7327-2 e-ISBN 978-1-4842-7328-9
https://doi.org/10.1007/978-1-4842-7328-9
Ritesh Modi 2021
This work is subject to copyright. All rights are solely and exclusively licensed by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
This Apress imprint is published by the registered company APress Media, LLC part of Springer Nature.
The registered company address is: 1 New York Plaza, New York, NY 10004, U.S.A.
While writing this book, I grew into a person who has more patience, perseverance, and tenacity. I would like to dedicate the book to the people who mean the world to me. I am talking about my mother, Bimla Modi; my wife, Sangeeta; and my daughter, Avni.
Introduction
Azure has matured as a cloud provider over a period of time. It provides numerous capabilities and helps organizations focus on their core business aspects while automating tasks based on standardization, consistency, and uniformity. Building and managing infrastructure is an important activity on Azure, and Terraform is one of the leading infrastructure-as-code (IaC) frameworks to effectively do so. It is one of the leading IaC platforms for managing a large variety of target environments. Terraform helps in managing the entire lifecycle of the infrastructure, from provisioning to teardown. Terraform and Azure providers are well maintained, are updated on a weekly basis with new resources and bug fixes, and have acceptance from a large community of developers.
Organizations need confidence and a high level of predictability when deploying on Azure. They want to implement changes to environments in a consistent manner, and Terraform helps achieve this using its idempotent deployments and configuration-based language. Terraform provides numerous concepts and artifacts that are used during both development and deployment. It internally manages idempotent deployments using a state file. Its scripting language is quite versatile and helps developers write easy to complex configurations. It is extensible and allows developers to add newer resources and author modular configurations that are generic and reusable across multiple deployments, environments, and solutions.
Bringing Terraform and Azure together is a win-win proposition for organizations and developers. It helps in easily automating the environment provisioning while ensuring that the process is quick, reliable, and cost-effective. This book is an attempt to educate readers about possible approaches for using Terraform alongside Azure. Each chapter builds on the prior chapter and slowly and steadily takes the reader through all the major concepts of Terraform in the context of Azure. After reading this book, readers who are new to Terraform will be able to start writing Terraform configurations, and experienced developers will be able to apply the Terraform best practices and write complex configurations.
This book is meant for both developers and architects to effectively implement and deploy environments using Terraform on Azure.
I hope readers will find this journey fruitful in their quest for learning and employ their newfound knowledge in their solutions and projects.
Happy learning!
Acknowledgments
Writing this book has been a fantastic experience. I owe a lot to the people who motivated me with their encouragement. I would like to thank so many people for making this book happen.
Thank you to the people who inspire me to push myself and who ultimately make everything worthwhile, the three wonderful ladies in my life: my mother, Bimla Modi; wife, Sangeeta Modi; and daughter, Avni Modi.
Thanks, of course, to the Apress team. I would like to thank my editors for providing direction at each stage of the publishing process and guiding me through it. I would also like to thank my technical reviewer who read the book multiple times and gave incredibly useful feedback. Finally, I thank everyone who has helped me learn both Azure and Terraform through numerous discussions and projects. This book wouldnt have been possible without each one of them.
Table of Contents
About the Author
Ritesh Modi
works for Microsoft as a senior engineer. He has served as a Microsoft regional director as well as a regional lead for Microsoft certified trainers in past.
Ritesh is an architect, senior evangelist, cloud architect, published author, speaker, and known leader for his contributions in the areas of blockchain, Ethereum, datacenter, Azure, bots, cognitive services, DevOps, artificial intelligence, and automation. He has more than a decade of experience in building and deploying enterprise solutions for customers. He has contributed multiple times to the open source AzureRM provider.
About the Technical Reviewer
Nicky Saini
is a passionate technology enthusiast with 13+ years of valuable experience in the IT industry. He currently works with UBS as a cloud SRE. He has completed a number of certifications in the cloud and container worlds. He has worked with different tools and technology and has hands-on experience in DevOps methodologies on the cloud platform, deploying and provisioning secure and robust cloud platforms with automation tools. He is a self-learner and likes to explore new tools and technology.
The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
R. Modi Deep-Dive Terraform on Azure https://doi.org/10.1007/978-1-4842-7328-9_1
1. Infrastructure as Code
Ritesh Modi
(1)
Hyderabad, Telangana, India
Before the advent of cloud computing, most infrastructure environments were built manually. Building all the environments including the production environment was done by infrastructure engineers using manual techniques and processes. There was some scripting and automation, but even those scripts were executed manually. The infrastructure would generally not undergo changes and would be exclusively created and maintained by infrastructure engineers. There was not much need to scale the infrastructure, neither were there disruptive changes to it apart from failing hardware. This manual maintenance would work fine in most cases.