Terraform

Krishna Neupane

About

Terraform is an infrastructure as code tool that enables you to safely and predictably provision and manage infrastructure in any cloud.

Terraform cheatsheet

CLI commands

CommandDescription
terraform initInitialize Terraform
terraform planCreate a plan
terraform applyApply the plan
terraform destroyDestroy the infrastructure
terraform import [resource_name] [resource_id]To import an existing infrastructure
terraform showTo see the state of the infrastructure
terraform state listTo list all the resources that Terraform is managing
terraform state show [resource_name]To get detailed information about a specific resource
terraform validateTo validate the syntax of the Terraform files
terraform providersTo see a list of all the available Terraform providers
terraform versionTo see the version of Terraform currently installed
terraform apply -var '[variable_name]=[value]To override a variable value from the command line
CommandDescription
terraform initInitialize Terraform
terraform planCreate a plan
terraform applyApply the plan
terraform destroyDestroy the infrastructure
terraform import [resource_name] [resource_id]To import an existing infrastructure
terraform showTo see the state of the infrastructure
terraform state listTo list all the resources that Terraform is managing
terraform state show [resource_name]To get detailed information about a specific resource
terraform validateTo validate the syntax of the Terraform files
terraform providersTo see a list of all the available Terraform providers
terraform versionTo see the version of Terraform currently installed
terraform apply -var '[variable_name]=[value]To override a variable value from the command line

Follow me on : Medium Linkedin Researchgate