Book Image

HashiCorp Infrastructure Automation Certification Guide

By : Ravi Mishra
Book Image

HashiCorp Infrastructure Automation Certification Guide

By: Ravi Mishra

Overview of this book

Terraform is a highly sought-after technology for orchestrating infrastructure provisioning. This book is a complete reference guide to enhancing your infrastructure automation skills, offering up-to-date coverage of the HashiCorp infrastructure automation certification exam. This book is written in a clear and practical way with self-assessment questions and mock exams that will help you from a HashiCorp infrastructure automation certification exam perspective. This book covers end-to-end activities with Terraform, such as installation, writing its configuration file, Terraform modules, backend configurations, data sources, and infrastructure provisioning. You'll also get to grips with complex enterprise infrastructures and discover how to create thousands of resources with a single click. As you advance, you'll get a clear understanding of maintaining infrastructure as code (IaC) in Repo/GitHub, along with learning how to create, modify, and remove infrastructure resources as and when needed. Finally, you'll learn about Terraform Cloud and Enterprise and their enhanced features. By the end of this book, you'll have a handy, up-to-date desktop reference guide along with everything you need to pass the HashiCorp Certified: Terraform Associate exam with confidence.
Table of Contents (17 chapters)
1
Section 1: The Basics
4
Section 2: Core Concepts
10
Section 3: Managing Infrastructure with Terraform
14
Chapter 11: Terraform Glossary

Introduction to IaC

Before learning about Terraform, let's try to understand what it basically means for us and how it helps make users' lives easier in the IT industry. The first thing that always comes to consumers' minds is that when they need an IT infrastructure, for example, if they want a virtual machine, they need to raise a ticket on some ticket portal such as ServiceNow, and someone from the backend would log in to that ticketing portal and take that ticket from the queue and deploy the virtual machine for the consumer, either in VMware or a HyperV environment through the management portal using some click jobs. That is the traditional approach for infrastructure deployment, which is somewhat fine if they need to manage infrastructure in their private data center and there is very little possibility of performing scaling of those deployed resources, which means once it gets provisioned, after that no one is requesting further changes to the created resource.

In all these cases, it is fine if they easily go ahead and perform all the operations manually but what about if they need to deploy a very large infrastructure consisting of more repeatable work in the cloud? Then it would be a really tedious job for the administrator to provision those resources manually and also it is a very time-consuming job for them. So, to overcome this challenging situation, most cloud vendors have come up with an approach of IaC, which is mostly an API-driven approach. Most cloud vendors have published APIs for all their resources. Using that API, we can easily get the resource deployed in the cloud.

Nowadays, as most customers are moving toward the cloud, and as we all know, cloud platforms provide us with more elasticity and scalability in terms of their infrastructure, this means you can easily utilize the resources and pay for what you use; you don't need to pay anything extra. Just think down the line of an administrator needing to perform the scaling up and down of resources and how difficult it would be for them. Let's suppose there are 1,000 resources that need to be scaled up during the day and scaled down at night.

In this case, consumers need to raise 1,000 tickets for performing the scale-up and again 1,000 more tickets for scaling down, which means by the end of the day, the system administrator who is managing the infrastructure will get flooded with so many requests and it would be really impossible for them to handle this. So, here we have something called IaC, which is a way of deploying or managing the infrastructure in an automated way. All the resources that need to be managed will be defined in code format and we can keep that code in any source control repository, such as GitHub or Bitbucket. Later, we can apply a DevOps approach to manage our infrastructure easily. There are many advantages of using IaC; we are going to discuss a few of them.