Hey guys, I have a question on exporting sensitive variables for terraform cloud . . .

Yaozhi Lu:
Hey guys, I have a question on exporting sensitive variables for terraform cloud.

In terraform cloud, I have a sensitive environment Workspace variables defined.
And in my local machine, I added a <http://backend.tf|backend.tf> file and did a terraform init . Terraform plan works fine.
I want to do a terraform import but it gives me that sensitive variable is missing.
I couldnt figure out how to export that variable. Can anyone help me?

(I tried: export SOME_VAR = [\"${SOME_VAR}\"] but doesnt work)

John Turner:
For an Environment Variable you do export TF_VAR_SOME_VAR = $SOME_VAR
https://www.terraform.io/language/values/variables#environment-variables

Or you can create a .tfvars file and store the variables there. I typically do that and set my .gitignore file to ignore any *.tfvars file.