Terraform Named Profiles are Unable to use Environment Variables to Store Secrets


Issue

Attempting to use Environmental Variables to store secrets (e.g. TF_VAR_<tokenname>) with Named Profiles creates an issue where the credentials cannot be processed. 

An error is returned that No Valid Credentials Found is provided as an error message

Cause

Named Profiles in Terraformer does not currently support Environment Variables

Solution

An upcoming update from Armory Engineering in 2.24.x will allow Terraformer to support Environmental Variables for Named Profiles. 

In the mean time, users should look to use Encrypted Files or Secret Stores.  A good starting point to these workarounds and how to use them can be found at the following website:

https://blog.gruntwork.io/a-comprehensive-guide-to-managing-secrets-in-your-terraform-code-1d586955ace1#bebe


Please note that Armory did not design this solution, and we advise that any customers looking to implement this solution perform their due diligence on this solution, including testing on a pre-production environment before implementing

As Tested On Version

2.21.x