Skip to content

Latest commit

 

History

History
32 lines (18 loc) · 710 Bytes

Variables.md

File metadata and controls

32 lines (18 loc) · 710 Bytes

Using Varibles in Terraform

There are 2 types of variables in Terraform

  • Input Variables: To pass the information to terraform to make resources creation parametrizerd
  • Output Variables; These will help us to get details of the launched resources

Refer the attached main.tf file

Following are glimpses of running this terraform script:

terraform plan -var 'name=value' -var 'name=value'
terraform apply -var 'name=value' -var 'name=value'

The command I used on windows system (Don't forget to replace the command with you ami id) :

terraform apply -var "var1=ami-013e83f579886baeb" -var "var2=t2.mi
cro"

Architecture