Hey there, Gurus! Welcome to the lab! This lab will demonstrate how to troubleshoot a Terraform variable interpolation error. We will attempt to go through the different stages of deployment to try and deploy our configuration and work through the interpolation error until we have successfully deployed our resources.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Format Your Terraform Configurations
1) In the terminal, once logged into your instance, change to the
terraform
directory.
2) In theterraform
directory, edit themain.tf
file and add in yourami
,subnet_id
, andvpc
from theresource_ids.txt
file.
3) Run theterraform fmt
command.- Fix the Interpolation Error
1) After running the
terraform fmt
command, you should get an error. Read the error and go to the line in themain.tf
file where the error is.
2) Fix the syntax error for the tag name variable.
3) Runterraform fmt
command. If the error is fixed, then move on to the next stage in your deployment until all of your resources are deployed successfully.
4) Once your resources are deployed without any errors, the lab is then complete.