Infrastructure-as-Code Automation Using Terraform, Packer, Vault, Nomad and Consul: Hands-on Deployment, Configuration, and Best Practices

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Discover the methodologies and best practices for getting started with HashiCorp tools, including Terraform, Vault, and Packer. The book begins with an introduction to the infrastructure-as-code concept while establishing the need for automation and management technologies. You’ll go over hands-on deployment, configuration, and best practices for Terraform, Packer, Vault, Nomad, and Consul. You’ll then delve deeper into developing automation code using Terraform for automating AWS/Azure/GCP public cloud tasks; advanced topics include leveraging Vault for secrets management and Packer for image management.

Along the way you will also look at Nomad and Consul for managing application orchestration along with network interconnectivity. In each chapter you will cover automated infrastructure and application deployment on the VM/container base ecosystem. The book provides sample code and best-practice guidance for developers and architects to look at infrastructure-as-code adoption from a holistic viewpoint.           

All the code presented in the book is available in the form of scripts, which allow you to try out the examples and extend them in interesting ways. 

What You Will Learn

  • Get an overview of the architecture of Terraform, Vault, Packer, Nomad, and Consul
  • Follow hands-on steps for enabling Terraform, Vault, Packer, Nomad, and Consul
  • Automate various services on the public cloud, including AWS, Azure, and GCP 

Who This Book Is For 

Developers, architects, and administrators who want to learn about infrastructure-as-code automation.

Author(s): Navin Sabharwal, Sarvesh Pandey, Piyush Pandey
Edition: 1
Publisher: Apress
Year: 2021

Language: English
Pages: 257
Tags: automation, infrastructure-as-code, HashiCorp, Terraform, Vault, Packer, cloud, AWS, Azure, GCP

Table of Contents
About the Authors
About the Technical Reviewer
Acknowledgments
Chapter 1: Getting Started with HashiCorp Automation Solutions
Introduction to Infrastructure as Code
Introduction to HashiCorp Automation
Packer
Terraform
Vault
Nomad
Consul
Vagrant
Boundary
Waypoint
Summary
Chapter 2: Getting Started with HashiCorp Terraform
Introduction to HashiCorp Terraform
Terraform CLI (Open Source)
Terraform Cloud
Terraform Enterprise
Comparing the Options
Setting up an AWS Account
Getting Started with Terraform Cloud
Terraform Workflow
Getting Started with Terraform CLI
What’s New in Terraform 0.14
Terraform 0.14 vs. Terraform 0.13
Summary
Chapter 3: Understanding Terraform Programming Constructs
Configuration Language
Arguments, Blocks, and Expressions
Code Organization
Configuration Ordering
Resources
Provider
Input Variables
Environment Variables
Output Values
Local Values
Modules
Creating a Custom Module
Version
count and for_each
depends_on Module
Providers
Provider Version Constraints in Modules
Automatic Installation of Third-Party Providers
Provider Plug-ins in a Local Filesystem
Data Sources
Backend Configuration
Backend Types
Backend Initialization
Provisioners
Creation-Time Provisioners
Destroy-Time Provisioners
Multiple Provisioners
Types of Provisioners
Generic Provisioners
File Provisioners
Local-Exec Provisioners
Remote-Exec Provisioners
Vendor Provisioners
Chef Provisioners
Summary
Chapter 4: Automating Public Cloud Services Using Terraform
Automating the GCP Public Cloud Using Terraform
Creating a VPC and Subnet with Terraform
Creating a Virtual Machine with Terraform
Creating a GCS Bucket with Terraform
Automating the Azure Public Cloud Using Terraform
Summary
Chapter 5: Getting Started with Vault
Introduction to HashiCorp Vault
Understanding Vault’s Logical Architecture
Understanding Vault’s Security Model
Installing Vault CLI and Integration with AWS
Summary
Chapter 6: Getting Started with HashiCorp Packer
Introduction to HashiCorp Packer
Builders
Communicators
Provisioners
Post-Processors
Variables
Using Declared Variables in Templates
Using Environment Variables in Templates
Installing Packer
Hands-on Exercise to Automate AWS AMI
Summary
Chapter 7: Getting Started with HashiCorp Consul
Introduction to HashiCorp Consul
Service Discovery
Configuration Management
Service Mesh and Network Segmentation
Architecture
Agent
Catalog
Anti-Entropy
Consensus Protocol
Gossip Protocol
LAN Gossip Pool
WAN Gossip Pool
Installing Consul
Service Discovery Using Consul
Intention Deletion
Service Registration
DNS and Health Checks Using Consul
Summary
Chapter 8: Getting Started with Nomad
Container Orchestration
Introduction to Nomad
Nomad Architecture
Autoscaling Overview
Dynamic Application Sizing
Horizontal Cluster Autoscaling
Horizontal Application Autoscaling
Installing Nomad
Policy-Driven Governance in Nomad
Namespaces
Resource Quotas
Sentinel Policies
Nomad ACLs
Tokens
Policies
Rules
Capabilities
Container Application Deployment Using Nomad
Summary
Index