Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
The Terraform Book
The Terraform Book
0.1 Who is this book for?
0.2 Credits and Acknowledgments
0.3 Technical Reviewers
0.3.1 Jennifer Davis
0.3.2 Thom May
0.3.3 Peter Miron
0.3.4 James Nugent
0.3.5 Paul Stack
0.4 Editor
0.5 Author
0.6 Conventions in the book
0.7 Code and Examples
0.8 Colophon
0.9 Errata
0.10 Disclaimer
0.11 Copyright
0.12 Version
1 Introduction
1.1 Infrastructure as Code
1.1.1 Wait … what’s infrastructure?
1.2 Introducing Terraform
1.3 So why not a configuration management tool?
1.4 So why not CloudFormation et al?
1.5 So what can you use Terraform for?
1.5.1 Multi-tier applications
1.5.2 Self-service infrastructure
1.5.3 Production, development, and testing environments
1.5.4 Continuous delivery
1.5.5 Managing your management tools
1.6 What’s in the book?
1.7 Links and information
2 Installing and introducing Terraform
2.1 Installing Terraform
2.1.1 Installing Terraform on Linux
2.1.2 Installing Terraform on Microsoft Windows
2.1.3 Alternative Microsoft Windows installation
2.1.4 Alternative Mac OS X installation
2.2 Getting started with Terraform
2.2.1 Adding some configuration
2.2.2 Terraform configuration files
2.2.3 Setting up Amazon Web Services
2.2.4 Our first configuration file
2.2.5 Building our first resource
2.2.6 Terraform state
2.2.7 Showing our resource
2.2.8 Adding a second resource
2.2.9 Outputting plans
2.2.10 Targeting resources
2.2.11 Failed plans
2.2.12 Showing all the resources
2.2.13 Viewing the Terraform graph
2.2.14 Destroying infrastructure
2.3 Summary
3 Building an application stack with Terraform
3.1 Our application stack
3.2 Parameterizing our configuration
3.2.1 Variables
3.2.2 Maps
3.2.3 Lists
3.2.4 Variable defaults
3.2.5 Populating variables
3.3 Starting our stack
3.3.1 Using AWS shared credentials
3.4 First resources
3.5 Modules
3.5.1 Defining a module
3.5.2 Module structure
3.6 Using our module
3.6.1 Getting our module
3.6.2 Moving our module to a repository
3.7 Counts and counting
3.7.1 Sets of counted resources using splat
3.7.2 Setting values with count indexes
3.7.3 Wrapping counts with the element function
3.7.4 Conditionals
3.7.5 Locals
3.8 Provisioning our stack
3.9 Finishing up our stack
3.10 Committing our configuration
3.11 Validating and formatting
3.12 Initializing Terraform
3.13 Planning our stack
3.14 Applying our stack
3.15 Graphing our stack
3.16 Seeing the results
3.17 Destroying the web stack resources
3.18 Summary
4 Provisioning with Terraform
4.1 What does a provisioner do?
4.2 Provisioning an instance
4.2.1 Connection block
4.2.2 The file provisioner
4.2.3 Remote execution provisioning
4.2.4 Destroying the old web stack resources
4.2.5 Provisioning our web stack
4.2.6 Failed execution of a provisioner
4.3 Summary
5 Collaborating with Terraform
5.1 Terraform state
5.2 Remote state
5.2.1 No state protection
5.2.2 Not all backends have locking
5.3 Creating an S3 remote state backend
5.3.1 Creating a module for an S3 remote state
5.3.2 Planning the remote state module
5.3.3 Applying our remote state module
5.3.4 Uploading the remote state module
5.4 Configuring Terraform to use remote state
5.4.1 Setting the remote state
5.4.2 Disabling remote state
5.5 Using and sharing remote state
5.5.1 Sharing state between users
5.5.2 Externally loading remote state backends
5.5.3 Using remote state data
5.5.4 Moving our base state remote
5.5.5 Adding the data source to the base configuration
5.6 State and service discovery
5.6.1 Creating a Consul cluster
5.6.2 Using Consul and remote state
5.7 Other tools for managing Terraform state
5.8 Summary
6 Building a multi-environment architecture
6.1 Creating a data center
6.1.1 Creating a directory structure
6.2 Workflow
6.2.1 Develop
6.2.2 Plan
6.2.3 Apply in development
6.2.4 Automation and testing
6.2.5 Deploy to production
6.3 The development environment
6.3.1 Getting our VPC module
6.3.2 Adding some outputs for the development environment
6.3.3 Planning the development environment
6.3.4 Applying the development environment
6.3.5 Configuring remote state
6.4 Adding the web service
6.4.1 The web module
6.4.2 Using a data source in the web module
6.4.3 Web instances
6.4.4 A Cloudflare record
6.4.5 Committing our module
6.4.6 Getting our web module
6.4.7 Planning our web service
6.4.8 Applying the web service
6.4.9 Testing our web service
6.4.10 Removing our web service
6.5 Adding the API service
6.5.1 The API module
6.5.2 API instances
6.5.3 The API service outputs
6.5.4 Getting our module
6.5.5 Planning the API service
6.5.6 Applying the API service
6.5.7 Testing our API service
6.6 Adding a production environment
6.6.1 Adding services to production
6.7 State environments
6.8 Other resources for Terraform environments
6.9 Summary
7 Infrastructure testing
7.1 Test Kitchen
7.1.1 InSpec
7.1.2 How Test Kitchen works
7.1.3 Prerequisites
7.1.4 Creating a test configuration
7.1.5 Creating our first control
7.1.6 Decorating controls with metadata
7.1.7 Adding another test to our control
7.1.8 Setting up a Test Kitchen instance
7.1.9 Running the controls
7.1.10 Adding a new control
7.1.11 Building custom InSpec resources
7.2 Alternative infrastructure testing frameworks
7.3 Summary
← Prev
Back
Next →
← Prev
Back
Next →