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

Advantages of IaC

Let's discuss a few of the advantages of using IaC.

Simple and speedy

Using IaC, you would able to spin up a complete infrastructure architecture by simply running a script.

Suppose you need to deploy infrastructure in multiple environments, such as development, test, preproduction, and production. It would be very easy for you to provision it with just a single click. Not only this, but say you need to deploy the same sort of infrastructure environments in other regions where your cloud provider supports backup and disaster recovery.

You can do all this by writing simple lines of code.

Configuration consistency

The classical approach of infrastructure deployment is very ugly because the infrastructure is provisioned and managed using a manual approach that helps to maintain some consistency in the infrastructure deployment process. But it always introduces human error, which makes it difficult to perform any sort of debugging.

IaC standardizes the process of building and managing the infrastructure so that the possibility of any errors or deviations is reduced. Definitely, this will decrease any incompatibility issues with the infrastructure and it will help you to run your application smoothly.

Risk minimization

When we were managing infrastructure manually, it was observed that only a handful of Subject Matter Experts (SMEs) knew how to do it and the rest of the team members remained blank, which introduces dependency and security risks for the organization. Just think of a situation where the person who is responsible for managing the complete infrastructure leaves the organization; that means whatever they knew they might not have shared with others or they may not have updated the documents. At the end of the day, risk has been introduced to the organization because that employee is leaving. Many times, in such cases, the organization needs to undergo some reverse engineering to fix any issues.

This challenging situation can be controlled by using IaC for the infrastructure. IaC will not only automate the process, but it also serves as a form of documentation for your infrastructure and provides insurance to the company in cases where employees leave the company with institutional knowledge. As you know, we generally keep IaC to source control tools such as Azure Repos or GitHub. So, if anyone makes any configuration changes to the infrastructure, they will get recorded in the source control repository. So, if anyone leaves or goes on vacation, it won't impact the manageability of the infrastructure because the version control tool will have kept track of the changes that have been performed on the infrastructure and this would definitely reduce the risk of failure.

Increased efficiency in software development

Nowadays, with the involvement of IaC for infrastructure provisioning and managing, developers get more time to focus on productivity. Whenever they need to launch their sandbox environments to develop their code, they are easily able to do so. The quality analyst (QA) will be able to have a copy of the code and test it in separate environments. Similarly, security and user acceptance testing can also be done in different staging environments. With a single click, both the application code and infrastructure code can be done together following Continuous Integration and Continuous Deployment (CI/CD) techniques.

Even if we want to get rid of any infrastructure, we can include an IaC script that will spin down the environments when they're not in use. This will shut down all the resources that were created by the script. So, we won't end up performing a cleanup of the orphan resources that are not in use. All this would help to increase the efficiency of the engineering team.

Cost savings

IaC would definitely help to save costs for the company. As we mentioned earlier, IaC script can help us create and automate the infrastructure deployment process, which allows engineers to stop doing manual work and start spending more time in performing more value-added tasks for the company, and because of this, the company can save money in terms of the hiring process and engineers' salaries.

As we mentioned earlier, IaC script can automatically tear down environments when they're not in use, which will further save companies cloud computing costs.

After getting a fair understanding of IaC and the benefits of using it, let's move ahead and try to learn some details about one IaC technology – Terraform.