Use of environment variables in TF files - Terraform cloud


I would like to use environment variables in my TF files. How can I mention them in those files?

I use Terraform cloud and define the variables in here:

I didn’t find any answer to this in forums nor in documentation.

Thanks !

Environment variables in this case are not really designed for the purpose of referencing in tf files. They are more to provide a mechanism to parse provider credential details to terraform for it to authenticate with your chosen provider. If you want to parse sensitive variables in terraform, you can set a variable to secret in the UI or alternatively, you can use Vault for secrets or any secrets stored provided by your chosen cloud provider using data sources. Hope this helps clarify things