Create Outputs 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 terraform init and press the return key to initialize Terraform.
image

• Type terraform apply and press the return key to apply the configuration.
image

• Type yes and press the return key to confirm.
image

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

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

• Type output “< output 1 >” { and press the return key to define the output 1 block and open its scope.
image

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

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

• Press the shift and tab keys to decrease the indent, type } and press the return key twice to close scope of the output “< output 1 >” { block.
image

• Type output “< output 2 >” { and press the return key to define the output 2 block and open its scope.
image

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

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

• Press the shift and tab keys to decrease the indent, type } and press the return key to close the scope of the output “< output 2 >” block.
image

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

• Type terraform apply and press the return key to apply configuration.
image

• Type yes and press the return key to confirm.
image

• Type terraform output and press the return key to get the outputs.
image

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