Terraform in Action
eBook - ePub

Terraform in Action

Scott Winkler

Compartir libro
  1. 408 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Terraform in Action

Scott Winkler

Detalles del libro
Vista previa del libro
Índice
Citas

Información del 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

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Terraform in Action un PDF/ePUB en línea?
Sí, puedes acceder a Terraform in Action de Scott Winkler en formato PDF o ePUB, así como a otros libros populares de Informatique y Sciences générales de l'informatique. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Editorial
Manning
Año
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

Índice