CLI with Terraform Cloud
When interacting with Terraform services, Terraform expects to find API tokens in CLI configuration files in credentials blocks, for example, a file named .terraformrc
credentials "app.terraform.io" {
token = "xxxxxx.yyyyyyy.zzzzzzzzzzzzz"
}
The above file .terraformrc would be referenced from an environment variable , for example,
❯ echo $TF_CLI_CONFIG_FILE
/Users/xxxxx/projects/terraform/.terraformrc
When I run a terraform plan I would like to pull the token from 1Password using the CLI if that's possible. It seems I could use op inject to potentially do the work but that essentially results in a config file with the hardcoded token.
Would this scenario be possible using the CLI?
Thanks
1Password Version: 8.7.0
Extension Version: 2.0.0
OS Version: macOS 12.3
