Terraform is an Infrastructure-as-Code tool. Terraform configuration can be written in HCL (HashiCorp Configuration Language) or other supported languages. Also see Terraform best practices.
- General workflow
terraform init
: Required to acquire the providers for all modules used. You need to run this again when you change/add/delete a provider.terraform plan -out <plan-file>
: Process the configuration and outputs a plan with what needs to be changed in the infrastructure.terraform apply <plan-file>
: Apply the plan file. If the plan does not match the current infrastructure (e.g. if someone else has updated the infrastructure after you ranplan
), thenapply
will abort. Do not runterraform apply
by itself.
- Terraform repository organization
- automating Terraform deployment