Skip to the content.
terraform -install-autocomplete

terrafrprm fmt

terraform state list

docker_container.nginx[1]

terraform apply -replace "docker_container.nginx[1]"
  
curl $(terraform output -raw public_ip):8080

Debug

Lifecycle

Locals

local values are often referred to as just “locals” when the meaning is clear from context. A local value assigns a name to an expression, so you can use it multiple times within a module without repeating it.

Input

variables are like function arguments.

Output

values are like function return values.

Data

sources allow Terraform to use information defined outside of Terraform, defined by another separate Terraform configuration, or modified by functions.

Depends on

Complex types

Meta arguments

Internal functions

Expressions

Providers

Dep lock file

Dependencies

Plugins

State

  1. Is a database to map TF config to the real world
  2. each TF resource is mapped to exactly one object in the cloud
  3. also tracks metadata as dependencies, to amke a graph, based on which it decides the order of the changes, when applying

Lock

State file

State drift

Backend management

Partial configuration

Terraform Cloud

Infrastructure as a Code (IaaC)