Beta labs problems with env variables and vs code

Hello. I’m using beta labs and in the lab Terraform Import, Tainting Resources and Deubugging, Lab: Taint and Debugging exercise 3

We have a configuration directory called /root/terraform-projects/ProjectA . Enable logging with the log level set to ERROR and then export the logs the path /tmp/ProjectA.log .

Once the environment variables are set, run a terraform init and apply .
It’s OK if this results in an error. Do not change any configuration files before you export the logs!

I did

export TF_LOG=ERROR
export TF_LOG_PATH=/tmp/ProjectA.log
terraform init
terraform apply

iac-server $ tail /tmp/ProjectA.log 
2021/08/04 12:33:35 [ERROR] eval: *terraform.EvalDiff, err: 1 error occurred:
        * error reading Instance Launch Template Id Tag: AuthFailure: AWS was not able to validate the provided access credentials
        status code: 401, request id: 68060716-7f4d-45d6-8487-e02659ba3640

2021/08/04 12:33:35 [ERROR] eval: *terraform.EvalSequence, err: 1 error occurred:
        * error reading Instance Launch Template Id Tag: AuthFailure: AWS was not able to validate the provided access credentials
        status code: 401, request id: 68060716-7f4d-45d6-8487-e02659ba3640

iac-server $ echo $TF_LOG
$TF_LOG       $TF_LOG_PATH  
iac-server $ echo $TF_LOG
ERROR
iac-server $ echo $TF_LOG_PATH 

The check message say
Terraform Debug logs are not exported to /tmp/ProjectA.log

And I don’t like that the the tab defaul tab is vs code. I like how it was before, a default terminal and if we choose you could open a vs code tab. Now we can’t open a terminal in another tab, only in vs code. I use vi/vim I don’t need vs code.

Maybe the error is because the check test isn’t access to enviroment variable. Because it has another context.

Hi @elsebasan , sorry to hear that. Are you still having this problem?

Regards,
Vitor Jr.
KodeKloud Support

yes am having this problem

I’m going to guess “this problem” is how to set the logging environment variables for terraform. If so: the doc is here: Environment Variables | Terraform | HashiCorp Developer