Introduction to Terraform
Helpful Commands
DevOps Engineer that wears multiple hats.
One of the best things about Terraform is that you can use it everywhere - AWS, Azure, GCP, and many more cloud providers. This helps prevent having to learn the nuances that the underlying API will have. You can just learn HCL (HashiCorp Configuration Language). Start with installing Terraform using your OS of choice.
Getting Started
- From your working directory initialize Terraform - this will download the plugin for the cloud provider you intend on using:
terraform init Lint your code with a validate:
terraform validateReview HCL with a plan:
terraform planWrite the plan to an out file for the apply to consume:
terraform plan -out out.terraformApply the Terraform code:
terraform applyApply the code using a plan:
terraform apply out.terraformShow current state:
terraform showYou can also read the Terraform state file:
cat terraform.tfstate





