Troubleshooting a Terraform Cycle Error

30 minutes
  • 3 Learning Objectives

About this Hands-on Lab

This lab will demonstrate how to troubleshoot a Terraform cycle error. You will attempt to go through the different stages of deployment to try and deploy the configuration and work through the cycle error until you have successfully deployed the resources.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Initialize Your Working Directory
  1. In the terminal, once logged in to your instance, change to the terraform directory.
  2. In the terraform directory, edit the main.tff file and add in your ami ,subnet_id, and vpc from the resource_ids.txt file.
  3. Run the terraform fmt command.
  4. Initialize the working directory.
Fix the Cycle Error
  1. After running the terraform init command, you should get an error. Read the error and go to the line in the file where the error is.
  2. Fix the cycle error you get due to the security groups expecting the other to be already created.
  3. Check the formatting of your code, and then initialize your working directory again. If the error is fixed, move on to the next step in your deployment.
Deploy Your Resources

Once you have worked past the error and successfully inilized your working directory, validated your code, and ran the plan, deploy your resources.

Additional Resources

You are an admin who supports one of the largest online comic book retailers in the world. You are one of a handful of admins who have been assigned to use Terraform to manage the company's cloud deployments. You are being asked to start to create a new dev environment to test out new features of the company's site. You have your configuration that will create app servers for the site. You have started to get things ready and you are ready to use the code to deploy your resources, but you have run into a cycle error. Fix the error and successfully deploy your app server in AWS using Terraform to complete this lab.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?