R2 Backend Environment Variable References #4815
Labels
kind/bug
Categorizes issue or PR as related to a bug.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
triage/debug-log-attached
Indicates an issue or PR has a complete Terraform debug log.
Confirmation
Terraform and Cloudflare provider version
Affected resource(s)
backend
Terraform configuration files
Link to debug output
https://gist.github.com/soudaburger/7af5dd12d8155b2716c18a994f3044ce
Panic output
No response
Expected output
Basically, if you don't specify
access_key
andsecret_key
in the backend reference, I appear to get a "no valid credential sources found" error. I expect to be able to set the proper env vars to get this to work without specifying theaccess_key
andsecret_key
so I don't have to hardcode credentials in plaintext.Actual output
Initializing the backend...
Initializing modules...
╷
│ Error: No valid credential sources found
│
│ Please see https://www.terraform.io/docs/language/settings/backends/s3.html
│ for more information about providing credentials.
│
│ Error: failed to refresh cached credentials, no EC2 IMDS role found,
│ operation error ec2imds: GetMetadata, access disabled to EC2 IMDS via
│ client option, or "AWS_EC2_METADATA_DISABLED" environment variable
Steps to reproduce
Using
export TF_VAR_R2_ACCESS_KEY_ID
andexport TF_VAR_R2_SECRET_ACCESS_KEY
in a.env
before the tf command is called. I use 1Password to store my credentials and the OP binary and op reads the.env
before theop
binary is called.Then you can run
tf init
with theaccess_key
andsecret_key
set. TF works.Removing those two fields throws that missing credential error.
Additional factoids
What are the proper/expected environment variables I should be using to get it to work? The documentation for what exactly the R2 environment variables should be, especially with relation to the TF backend, seems extremely sparse or nonexistent.
I am certain this is either unsupported (environment variables for secret/access keys) or it's simply the wrong environment variables. I'm just trying to confirm what I'm supposed to be using to validate my assumptions.
References
No response
The text was updated successfully, but these errors were encountered: