Terraform in Action
eBook - ePub

Terraform in Action

Scott Winkler

Condividi libro
  1. 408 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Terraform in Action

Scott Winkler

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

"An outstanding source of knowledge for Terraform enthusiasts of all levels." - Anton Babenko, Betajob Terraform in Action shows you how to automate and scale infrastructure programmatically using the Terraform toolkit. Summary In Terraform in Action you will learn: Cloud architecture with Terraform
Terraform module sharing and the private module registry
Terraform security in a multitenant environment
Strategies for performing blue/green deployments
Refactoring for code maintenance and reusability
Running Terraform at scale
Creating your own Terraform provider
Using Terraform as a continuous development/continuous delivery platform Terraform in Action introduces the infrastructure-as-code (IaC) model that lets you instantaneously create new components and respond efficiently to changes in demand. You'll use the Terraform automation tool to design and manage servers that can be provisioned, shared, changed, tested, and deployed with a single command. Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. About the technology Provision, deploy, scale, and clone your entire stack to the cloud at the touch of a button. In Terraform, you create a collection of simple declarative scripts that define and manage application infrastructure. This powerful infrastructure-as-code approach automates key tasks like versioning and testing for everything from low-level networking to cloud services. About the book Terraform in Action shows you how to automate and scale infrastructure programmatically using the Terraform toolkit. Using practical, relevant examples, you'll use Terraform to provision a Kubernetes cluster, deploy a multiplayer game, and configure other hands-on projects. As you progress to advanced techniques like zero-downtime deployments, you'll discover how to think in Terraform rather than just copying and pasting scripts. What's inside Cloud architecture with Terraform
Terraform module sharing and the private module registry
Terraform security in a multitenant environment
Strategies for performing blue/green deployments About the reader For readers experienced with a major cloud platform such as AWS. Examples in JavaScript and Golang. About the author Scott Winkler is a DevOps engineer and a distinguished Terraform expert. He has spoken multiple times at HashiTalks and HashiConf, and was selected as a HashiCorp Ambassador and Core Contributor in 2020. Table of Contents PART 1 TERRAFORM BOOTCAMP
1 Getting started with Terraform
2 Life cycle of a Terraform resource
3 Functional programming
4 Deploying a multi-tiered web application in AWS
PART 2 TERRAFORM IN THE WILD
5 Serverless made easy
6 Terraform with friends
7 CI/CD pipelines as code
8 A multi-cloud MMORPG
PART 3 MASTERING TERRAFORM
9 Zero-downtime deployments
10 Testing and refactoring
11 Extending Terraform by writing a custom provider
12 Automating Terraform
13 Security and secrets management

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Terraform in Action è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Terraform in Action di Scott Winkler in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Ciencia de la computación e Ciencias computacionales general. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Editore
Manning
Anno
2021
ISBN
9781638350316

Part 1 Terraform bootcamp

The pace of part 1 starts slowly but ramps up quickly. Think of these first few chapters as your personal bootcamp for using Terraform. By the end of chapter 4, you will have a solid grasp of the technology and be well prepared for the advanced topics coming in later chapters. Here’s what’s ahead.
Chapter 1 is a basic introduction to Terraform. We cover all the usual topics, such as why Terraform was created, what problems it solves, and how it compares to similar technologies. The chapter ends with a simple example of deploying an EC2 instance to AWS.
Chapter 2 is a deep dive into Terraform: resource lifecycle and state management. We examine how Terraform generates and applies execution plans to perform CRUD operations on managed resources and see how state plays a role in the process.
Chapter 3 is our first look at variables and functions. Although Terraform's expressiveness is inhibited by it being a declarative programming language, you can still do some pretty interesting things with for expressions and local values.
Chapter 4 is the capstone project that brings together all the previous learning. We deploy a complete web server and database using Terraform and walk through how to structure Terraform configuration with nested modules.

1 Getting started with Terraform

This chapter covers
  • Understanding the syntax of HCL
  • Fundamental elements and building blocks of Terraform
  • Setting up a Terraform workspace
  • Configuring and deploying an Ubuntu virtual machine on AWS
Terraform is a deployment technology for anyone who wants to provision and manage their infrastructure as code (IaC). Infrastructure refers primarily to cloud-based infrastructure, although anything that could be controlled through an application programming interface (API) technically qualifies as infrastructure. Infrastructure as code is the process of managing and provisioning infrastructure through machine-readable definition files. We use IaC to automate processes that used to be done manually.
When we talk about provisioning, we mean the act of deploying infrastructure, as opposed to configuration management, which deals mostly with application delivery, particularly on virtual machines (VMs). Configuration management (CM) tools like Ansible, Puppet, SaltStack, and Chef are extremely popular and have been around for many years. Terraform does not supplant these tools, at least not entirely, because infrastructure provisioning and configuration management are inherently different problems. That being said, Terraform does perform many of the functions once reserved by CM tools, and many companies find they do not need CM tools after adopting Terraform.
The basic principle of Terraform is that it allows you to write human-readable configuration code to define your IaC. With configuration code, you can deploy repeatable, ephemeral, consistent environments to vendors on the public, private, and hybrid clouds (see figure 1.1).
CH01_F01_Winkler

Figure 1.1 Terraform can deploy infrastructure to any cloud or combination of clouds.
In this chapter, we start by going over the distinguishing features of Terraform. We talk about the comparative advantages and disadvantages of Terraform in relation to other IaC technologies and what makes Terraform the clear winner. Finally, we look at the quintessential “Hello World!” of Terraform by deploying a single server to AWS and improving it by incorporating some of Terraform’s more dynamic features.

1.1 What makes Terraform so great?

There’s been a lot of hype about Terraform recently, but is any of it justified? Terraform isn’t the only IaC technology on the block—plenty of other tools do the same thing. How is it that Terraform, a technology in the highly lucrative software deployment market space, can compete with the likes of Amazon, Microsoft, and Google? Six key characteristics make Terraform unique and give it a competitive advantage:
  • Provisioning tool—Deploys infrastructure, not just applications.
  • Easy to use—For all of us non-geniuses.
  • Free and open source—Who doesn’t like free?
  • Declarative—Say what you want, not how to do it.
  • Cloud-agnostic—Deploy to any cloud using the same tool.
  • Expressive and extendable—You aren’t limited by the language.
Table 1.1 compares Terraform and other IaC tools.
Table 1.1 A comparison of popular IaC tools
...
Name
Key features
Provisioning tool
Easy to use
Free and open source
Declarative
Cloud-agnostic
Expressive and extendable

Indice dei contenuti