Infrastructure Automation with Terraform
eBook - ePub

Infrastructure Automation with Terraform

Automate and Orchestrate your Infrastructure with Terraform Across AWS and Microsoft Azure

Ankita Patil

Partager le livre
  1. English
  2. ePUB (adapté aux mobiles)
  3. Disponible sur iOS et Android
eBook - ePub

Infrastructure Automation with Terraform

Automate and Orchestrate your Infrastructure with Terraform Across AWS and Microsoft Azure

Ankita Patil

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

Use Terraform and Jenkins to implement Infrastructure as Code and Pipeline as Code across multi-cloud environments

Key Features
? Step-by-step guidelines for managing infrastructure across multiple cloud platforms.
? Expert-led coverage on managing Pipeline as Code using Jenkins.
? Includes images demonstrating how to manage AWS and Azure resources using Terraform Modules.

Description
This book explains how to quickly learn and utilize Terraform to incorporate Infrastructure as Code into a continuous integration and continuous delivery pipeline. The book gives you the step-by-step instructions with screenshots and diagrams to make the learning more accessible and fun.This book discusses the necessity of Infrastructure as a Code (IaC) and the many tools available for implementing IaC. You will gain the knowledge of resource creation, IAM roles, EC2 instances, elastic load balancers, and building terraform scripts, among other learnings. Next, you will explore projects and use-cases for implementing DevOps concepts like Continuous Integration, Infrastructure as Code, and Continuous Delivery. Finally, you learn about the Terraform Modules and how to establish networks and Kubernetes clusters on various cloud providers. Installing and configuring Jenkins and SonarQube in Cloud Environments will also be discussed.As a result of reading this book, you will be able to apply Infrastructure as Code and Pipeline as Code principles to major cloud providers such as AWS and Azure.

What you will learn
? Create, manage, and maintain AWS and Microsoft Azure infrastructure.
? Using Packer, create AMIs and EC2 instances.
? Utilize Terraform Modules to create VPC and Kubernetes clusters.
? Put the Pipeline and Infrastructure as Code principles into practice.
? Utilize Jenkins to automate the application lifecycle management process.

Who this book is for
This book will primarily help DevOps, Cloud Operations, Agile teams, Cloud Native Developers, and Networking Professionals. Being familiar with the fundamentals of Cloud Computing and DevOps will be beneficial.

Table of Contents
1. Setting up Terraform
2. Terraform Basics and Configuration
3. Terraform Provisioners
4. Automating Infrastructure Deployments in the AWS Using Terraform
5. Automating Infrastructure Deployments in Azure Using Terraform
6. Terraform Modules
7. Terraform Cloud
8. Terraform and Jenkins Integration
9. End-to-End Application Management using Terraform

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Infrastructure Automation with Terraform est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Infrastructure Automation with Terraform par Ankita Patil en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Cloud Computing. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2022
ISBN
9789355510907

CHAPTER 1

Setting Up Terraform

"Believe in yourself! Have faith in your abilities! Without humble but reasonable confidence in your powers, you cannot be successful or happy."
—Norman Vincent Peale
Application delivery and the activities involved in it have changed a lot after cloud computing and DevOps practices gained the attention of different organizations. Everything as code is a new norm where your automation or CI/CD pipeline is also part of version control - pipeline as code. High availability, disaster recovery, and business continuity have become crucial considering the competitive market. Terraform helps us write and execute code to define, deploy, update, and destroy your infrastructure in different cloud environments; hence, we don’t need to learn cloud specific tools. Terraform is an open-source Infrastructure as Code tool that codifies cloud APIs into declarative configuration files to make managing different environments easier.
In this chapter, we will install and configure Terraform in different operating systems as well as in Docker container. We will use Docker Desktop to create a container that has Terraform installed on it. We will also understand the details for AWS and Azure accounts and Command line (CLIs). It will help us in the upcoming chapters when using Terraform to create infrastructure in AWS and Microsoft Azure cloud environment.

Structure

We will discuss the following topics in this chapter:
  • Installing and configuring Terraform on Windows using Chocolatey
  • Installing and configuring Terraform on Mac
  • Installing and configuring Terraform on Ubuntu
  • Installing and configuring Terraform on CentOS
  • Terraform IAC Development and IDE
  • Creating Microsoft Azure Account
  • Installing and Configuring Azure CLI
  • Creating AWS Account
  • Installing and Configuring AWS CLI

Objectives

After studying this unit, you should be able to install and configure Terraform in different operating systems or different types of platform, such as Docker container. You should also be able to understand how to create AWS and Azure accounts and installing CLIs.

Installing and configuring Terraform on Windows using Chocolatey

Terraform open-source project and Terraform plugins are written in GO programming language. We can use Terraform to create infrastructure resources across different cloud service providers such as Amazon Web Services (AWS) and Azure as well as other cloud deployment models and virtualization platforms. In this book, we are going to use AWS and Microsoft Azure. We will install and configure Terraform, AWS CLI, Azure CLI, and editors. This environment creation will help us write Terraform files to create resources in different cloud platforms.
Chocolatey is a small piece of wonder for all those who hate struggling with the installation of different packages on Windows. It helps make installation easier and can be done from your command-line. Its features include management of dependencies and version control, and it offers ease of use for handling different packages on Windows. Chocolatey is an open-source package management tool, but it has a commercial edition. Chocolatey is in a similar pool of yum, apt, and Homebrew. In simple words, Chocolatey is a Windows Package Manager that makes your life easy with simplicity, efficiency, power, and flexibility.
Note: Terraform doesn’t require GO as a pre-requisite for installation or any GO programming skills.
Here are the pre-requisites to install Chocolatey:
  • Windows 7+ / Windows Server 2003+
  • PowerShell v2+ (the lowest version is v3 for install from this website due to TLS 1.2 requirement)
  • .NET Framework 4+ (the installation will attempt to install .NET 4.0 if you do not have it) (the lowest version is 4.5 for install from this website due to TLS 1.2 requirement)
Let’s try to install Chocolatey using the following commands:
We will install it with PowerShell:
  1. With PowerShell, execute the "Get-ExecutionPolicy" command first. Here’s the explanation of the output of the execution of this command:
    • If output is restricted, run Set-ExecutionPolicy AllSigned Or Set-ExecutionPolicy Bypass -Scope Process
      If output is AllSigned, then go to Step 2.
      Visit https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.1 for more details on execution policies.
  2. Execute the following command to install Chocolatey. Visit the official website for more details on Chocolatey installation.
    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(‘https://chocolatey.org/install.ps1’))
  3. Type choco or choco -?. You are ready to install packages using Chocolatey. Chocolatey is installed in following screenshot:
    Figure 1.1: Install Chocolaty on Windows using PowerShell
  4. Verify environment variables after installing Chocolatey as per the following screenshot. Visit https://chocolatey.org/install for advanced installation of Chocolatey.
    Figure 1.2: Environment vari...

Table des matiĂšres