Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 168


terraform apply is failing with the following error. What next step should you take to determine the root cause of the problem?

Error loading state: AccessDenied: Access Denied status code: 403, request id: 288766CE5CCA24A0, host id: FOOBAR

Show Answer
Correct Answer: A

The error message indicates an access denial when attempting to load the state. To determine the root cause of this issue, you would need more detailed information about what Terraform is attempting to do at the moment of failure. Setting TF_LOG=DEBUG will enable detailed logging, which can provide insights into the steps leading up to the error, helping to identify whether the problem is with permissions, configuration, or something else. It is the most direct way to gather detailed information for troubleshooting.

Discussion

7 comments
Sign in to comment
BurakkoOption: A
Mar 2, 2023

Terraform has detailed logs which can be enabled by setting the TF_LOG environment variable to any value. This will cause detailed logs to appear on stderr. You can set TF_LOG to one of the log levels (in order of decreasing verbosity) TRACE, DEBUG, INFO, WARN or ERROR to change the verbosity of the logs.

jednorozec2022
Mar 22, 2023

A A. Set TF_LOG=DEBUG >> only this one sound like correct answear B. Review syslog for Terraform error messages >> firstly you need to turn on terraform logging ref https://www.terraform.io/internals/debugging C. Run terraform login to reauthenticate with the provider >> login is used to connect with Terraform Cloud, Terraform Enterprise, or any other host that offers Terraform services ref https://www.terraform.io/cli/commands/login D. Review /var/log/terraform.log for error messages >> you would have to turn on logging and add path to logging ref https://www.terraform.io/internals/debugging

jjkcoinsOption: C
Mar 19, 2023

Error loading state: AccessDenied: Access Denied status code: 403, request id: 288766CE5CCA24A0, host id: FOOBAR C. Run terraform login to reauthenticate with the provider

Spandrop
Jun 14, 2024

"A" maybe make sense, but why you would like to enable TF_LOG for a message that is crystal clear: ACCESS DENIED?!

RVivekOption: A
Mar 28, 2023

to determine the root cause of the problem , we need to first enable logging

DerekKey
Jun 4, 2023

A Correct C - no - provider is not responsible for managing state

InformationOverloadOption: A
Jun 29, 2023

A makes sense here.