-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Terraform not allowing to pass nested values (like assume_role.role_arn) to the backend.s3 configuration using cli (-backend-config="KEY=VALUE") and config file (-backend-config=PATH) #36911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for this report! |
In case it's somehow useful, a long time ago I wrote Even if that library is not directly useful as an import, I remember there being some interesting design tradeoffs in making that work which might give some ideas on similar tradeoffs to make in solving this for Terraform. In particular, I experimented with a few different ways to deal with a situation where e.g. the CLI says The example I included in the repository uses the very opinionated Offered just in the hope that it's helpful! |
Hi @apparentlymart , thanks for sharing that project! I had a go using it directly but it looks like attributes with |
Ahh hmm yes I suppose I wrote this long enough ago that the idea of using the attribute syntax in a block-like way hadn't happened yet, and so my old implementation doesn't support that... it only wants to allow dotting through block types and their labels. "Overlaying" into attributes is actually likely to be somewhat harder than what I implemented there previously because from HCL's perspective the given expression hasn't been evaluated yet and so it doesn't have any idea what type of value is likely to appear there until someone eventually calls So following a similar implementation approach as what I was using so far would probably mean adding a new wrapping implementation of If it's going to ultimately end up having to do the work in the I'm sorry that it wasn't more helpful! |
Terraform Version
Terraform Configuration Files
Debug Output
not applicable
Expected Behavior
Actual Behavior
Steps to Reproduce
Additional Context
I'm having the same issue when i true to use those exact same values on backend.config file, trying to pass with the
-backend-config=PATH
flag...I noticed this issue after upgrading the Terraform version in our team's Continuous Integration tool from v1.8.5 to v1.11.4. Previously, we were able to provide the
role_arn
programmatically because it was a top-level attribute in thebackend.s3
block. Now that it has to be nested underassume_role
, Terraform throws an error when we try to pass it dynamically.Edit:
I've found out this still works when using a
.hcl
file, passing a value like this one:References
No response
Generative AI / LLM assisted development?
No response
The text was updated successfully, but these errors were encountered: