Create Variables File in Terraform with Visual Studio Code on Windows - DevPops-Inc/windows GitHub Wiki

• Press the Windows key, type “git bash” and select “Open.”
image

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

• Type code variables.tf and press the Enter key to create a new variables.tf file in Visual Studio Code.
image

• Select “Open.”
image

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

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

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

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

• Press the Shift and Tab keys to decrease the indent, type } and press the Enter key to close scope of variable.
image

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

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