Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Preface
Who Should Read This Book
Why I Wrote This Book
What You Will Find in This Book
What You Won’t Find in This Book
Open Source Code Examples
Using the Code Examples
Conventions Used in This Book
O’Reilly Safari
How to Contact O’Reilly Media
Acknowledgments
1. Why Terraform
The Rise of DevOps
What Is Infrastructure as Code?
Ad Hoc Scripts
Configuration Management Tools
Server Templating Tools
Server Provisioning Tools
Benefits of Infrastructure as Code
How Terraform Works
How Terraform Compares to Other Infrastructure as Code Tools
Configuration Management Versus Provisioning
Mutable Infrastructure Versus Immutable Infrastructure
Procedural Language Versus Declarative Language
Master Versus Masterless
Agent Versus Agentless
Large Community Versus Small Community
Mature Versus Cutting Edge
Conclusion
2. Getting Started with Terraform
Set Up Your AWS Account
Install Terraform
Deploy a Single Server
Deploy a Single Web Server
Deploy a Configurable Web Server
Deploy a Cluster of Web Servers
Deploy a Load Balancer
Cleanup
Conclusion
3. How to Manage Terraform State
What Is Terraform State?
Shared Storage for State Files
Locking State Files
Isolating State Files
File Layout
Read-Only State
Conclusion
4. How to Create Reusable Infrastructure with Terraform Modules
Module Basics
Module Inputs
Module Outputs
Module Gotchas
File Paths
Inline Blocks
Module Versioning
Conclusion
5. Terraform Tips and Tricks: Loops, If-Statements, Deployment, and Gotchas
Loops
If-Statements
Simple If-Statements
More Complicated If-Statements
If-Else-Statements
Simple If-Else-Statements
More Complicated If-Else-Statements
Zero-Downtime Deployment
Terraform Gotchas
Count Has Limitations
Zero-Downtime Deployment has Limitations
Valid Plans Can Fail
Refactoring Can Be Tricky
Eventual Consistency Is Consistent…Eventually
Conclusion
6. How to Use Terraform as a Team
Version Control
A Repository for Modules
A Repository for Live Infrastructure
The Golden Rule of Terraform
Automated Tests
Prepare Your Code
Write the Test Code
Use Multiple Types of Automated Tests
Coding Guidelines
Documentation
File Layout
Style Guide
Workflow
Plan
Staging
Code Review
Production
Some Types of Terraform Changes Can Be Automated
Some Types of Terraform Changes Lead to Conflicts
Larger Teams May Need to Use a Development Pipeline
Conclusion
A. Recommended Reading
Books
Blogs
Talks
Newsletters
Online Forums
Index
← Prev
Back
Next →
← Prev
Back
Next →