Terraform in Depth

by Robert Hafner

Cloud Computing

Book Details

Book Title

Terraform in Depth

Author

Robert Hafner

Publisher

Manning Publications Co

Publication Date

2025

ISBN

9781633438002

Number of Pages

832

Language

English

Format

PDF

File Size

3.8MB

Subject

devops

Table of Contents

  • Terraform in Depth
  • Copyright
  • Dedication
  • Contents
  • Front Matter
  • Part 1. Getting started with Terraform
  • Chapter 1: A brief overview of Terraform
  • 1.1 Infrastructure as code
  • 1.2 Terraform overview
  • 1.3 Declarative languages
  • 1.4 Terraform deployment flow
  • 1.5 What are people using this for?
  • 1.6 Terraform and OpenTofu
  • Summary
  • Chapter 2: Terraform HCL components
  • 2.1 Hello World
  • 2.2 Block syntax
  • 2.3 Terraform settings
  • 2.4 Providers
  • 2.5 Resources
  • 2.6 Data sources
  • 2.7 Meta arguments
  • 2.8 Modules
  • 2.9 Import, moved, and removed
  • Summary
  • Chapter 3: Terraform variables and modules
  • 3.1 Modules
  • 3.2 Input, output, and local variables
  • 3.3 Input variables
  • 3.4 Outputs
  • 3.5 Locals
  • 3.6 Value types
  • 3.7 Validating inputs
  • 3.8 A reusable instance module
  • Summary
  • Chapter 4: Expressions and iterations
  • 4.1 Expanding our module
  • 4.2 Operators and conditionals
  • 4.3 Functions
  • 4.4 Strings and templates
  • 4.5 Regular expressions
  • 4.6 Type conversion
  • 4.7 Try and can
  • 4.8 count and for_each
  • 4.9 For
  • 4.10 Dynamic blocks
  • Summary
  • Chapter 5: The Terraform plan
  • 5.1 Directed acyclic graphs
  • 5.2 The Terraform resource graph
  • 5.3 Plan
  • 5.4 Root-level module input variables
  • 5.5 Apply
  • 5.6 Apply and plan options
  • 5.7 Common pitfalls and errors
  • Summary
  • Part 2. Terraform in production
  • Chapter 6: State management
  • 6.1 Purpose of state
  • 6.2 Important considerations
  • 6.3 Dissecting state
  • 6.4 Storing state
  • 6.5 Manipulating state
  • 6.6 State drift
  • 6.7 Accessing state across projects
  • 6.8 State-only resources
  • Summary
  • Chapter 7: Code quality and continuous integration
  • 7.1 Continuous integration practices
  • 7.2 Local development
  • 7.3 Tools for maintaining quality
  • 7.4 Validating security
  • 7.5 Custom policy enforcement
  • 7.6 Automating chores
  • 7.7 Enforcing quality with CI systems
  • Summary
  • Chapter 8: Continuous delivery and deployment
  • 8.1 Delivering modules
  • 8.2 Deploying infrastructure
  • 8.3 GitOps
  • 8.4 Project structures
  • 8.5 Managing secrets
  • 8.6 CD platform features
  • 8.7 CD platform overview
  • Summary
  • Chapter 9: Testing and refactoring
  • 9.1 The theory of IaC testing
  • 9.2 Testing IaC in practice
  • 9.3 Terratest
  • 9.4 Terraform testing framework
  • 9.5 Refactoring
  • 9.6 External refactoring
  • Summary
  • Part 3. Advanced Terraform topics
  • Chapter 10: Advanced Terraform topics
  • 10.1 Names and domains
  • 10.2 Network management
  • 10.3 Provisioners
  • 10.4 External provider
  • 10.5 Local provider
  • 10.6 Checks and conditions
  • 10.7 OpenTofu and Terraform compatibility
  • 10.8 When Terraform isn’t appropriate
  • Summary
  • Chapter 11: Alternative interfaces
  • 11.1 Wrapping Terraform
  • 11.2 Using JSON instead of HCL
  • 11.3 Cloud Development Kit for Terraform
  • Summary
  • Chapter 12: Terraform providers
  • 12.1 Design
  • 12.2 Developer environment
  • 12.3 Terraform Plugin Framework features
  • 12.4 Provider interface
  • 12.5 Data source
  • 12.6 Resources
  • 12.7 Functions
  • 12.8 Publishing
  • Summary
  • Index