Create Variables File in Terraform with Visual Studio Code on Mac - VicPhanDevOps/mac GitHub Wiki

• Press the command key and spacebar to launch Spotlight Search, type “terminal” and select the “Terminal” application.
image

• Type cd < location of Terraform files > and press the return key to change directory to the location of the Terraform files.
image

• Type touch variables.tf and press the return key to create a blank variables.tf file.
image

• Type open -a “Visual Studio Code.app” variables.tf and press the return key to open the variables.tf file in Visual Studio Code.
image

• Select “Open.”
image

• Type variable “< variable name >” { and press the return key to declare the variable and open its scope.
image

• Type description < align the equal sign > = “< description >” and press the return key set the description.
image

• Type type < align equal sign > = < type > and press the return key to set the type.
image

• Type default < align equal sign > = “< default >” and press the return key to set the default.
image

• Press the shift and tab keys to decrease the indent, type } and press the return key to close scope of the variable.
image

• Press the command and S keys to save the variable.tf file.
image

⚠️ **GitHub.com Fallback** ⚠️