Hey there, Gurus! Welcome to the lab! This lab will demonstrate how to troubleshoot configuration issues when using Terraform to deploy and manage your infrastructure. You, as an admin, are being asked to troubleshoot multiple issues with an infrastructure deployment to your company’s AWS environment. You will first need to troubleshoot a variable interpolation error when formatting your configuration. You will then run into a couple errors when validating your configuration. You will need to fix a `for_each` error as well as an `output` error before you can finally deploy your infrastructure.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Correct the Variable Interpolation Error
In the Terminal
- Check the format of your Terraform configuration files.
- Correct the interpolation error.
- Re-check the format.
- Correct the Syntax Error for the Resource
In the Terminal
- Initialize your working directory.
- Validate your configuration.
- Correct the syntax error.
- Format your configuration.
- Correct the Region Declaration Error
In the Terminal
- Validate your configuration.
- Correct the region declaration error.
- Format your configuration.
- Correct the Outputs Error
In the Terminal
- Validate your configuration.
- Correct the outputs error.
- Format your configuration.
- Deploy the Infrastructure
In the Terminal
- Validate your configuration.
- Apply your configuration to deploy your infrastructure.
- Confirm your deployment.
- Destroy your infrastructure.