Introduction
Keeping Terraform deployments consistent and reliable with state and backends
()
Course tips and set up
()
1. How Terraform State and Backends Ensure Reliable Deployments
Why Terraform state matters for your infrastructure
()
Explore what’s inside a Terraform state file
()
State backends in Terraform
()
Compare local vs. remote state backends
()
Challenge: Parse information from a state file
()
2. Configuring State Backends
Using the local backend
()
Choosing a remote backend
()
Authenticating to a remote backend
()
State locking for remote backends
()
Challenge: Configure and use a PostgreSQL remote backend
()
Solution: Configure and use a PostgreSQL remote backend
()
3. Managing State Files at Scale
Managing Terraform state at scale
()
State and Terraform workspaces
()
Partial backend configuration
()
Organizing multiple state files in a backend
()
Migrating between state backends
()
Sharing state between Terraform configurations
()
Challenge: Migrating state files between backends
()
Solution: Migrating state files between backends
()
4. Terraform State Manipulation
Understanding state manipulations
()
Resource addressing in the state file
()
Interacting with the state file using the Terraform CLI
()
Moving a resource to a new address in the state
()
Removing a resource from the state
()
Importing a resource to the state
()
Bulk-import resources using Terraform search
()
Moving a resource between Terraform configurations
()
Challenge: Refactoring a state file
()
Solution: Refactoring a state file
()
5. Securing the Terraform State File
Methods to secure the state file
()
Network security
()
Authorization: RBAC and ABAC
()
Encrypting the state file
()
Versioning the state file
()
Configure backups and prepare for disaster recovery
()
Keep secrets out of state using ephemeral values and write-only arguments
()
Challenge: Ephemeral values and write-only arguments to remove secrets from state
()
Solution: Ephemeral values and write-only arguments to remove secrets from state
()
6. Troubleshooting State File Issues
Handle state file locking issues
()
Backend authorization errors
()
Managing resource drift
()
Recover a lost state file
()
Challenge: Remediate resource drift
()
Solution: Remediate resource drift
()