DevOps Classroomnotes 19/Mar/2023

Terraform Contd

Hashicorp Configuration Language (HCL) for Terraform

  • For Specification Refer Here
  • Provider Refer Here
  • The terraform block helps in configuring the provider with version of the provider from registry Refer Here
  • Specify which version of terraform you should be using use required_version. To specify constraints Refer Here
  • Refer Here for changes

Parametrizing Terraform

Input Variables

  • Refer Here for input variables official docs
  • For inputs terraform supports the following types
    • number
    • string
    • boolean
    • list()
    • set()
    • map()
    • object({ = , … })
    • tuple([, …])
  • To pass variables while executing commands we have two options
    • -var
    • -var-file
  • using -var Refer Here
    • terraform apply -var "region=ap-south-2" -var "ntier-vpc-range=10.10.0.0/16"
  • Refer Here for the changes to use variables
  • using variable definitions Refer Here, example terraform apply -var-file values.tfvars
  • Refer Here for the changes in azure terraform template

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner