Skip to content

Add optional support for passing env variables into provider#121

Open
kuzaxak wants to merge 1 commit intocarlpett:masterfrom
x-qdo:support_env
Open

Add optional support for passing env variables into provider#121
kuzaxak wants to merge 1 commit intocarlpett:masterfrom
x-qdo:support_env

Conversation

@kuzaxak
Copy link

@kuzaxak kuzaxak commented Jun 21, 2024

Needed to support dynamic auth as described in issue, as we are using sops dependency which is using native aws sdk, it will read such configuration from env variables of the process.

Additionally, I upgraded deprecated terraform SDK such as replacing Read into ReadContext and added

Needed to support dynamic auth as described in [issue][1], as we are
using sops dependency which is using native aws sdk, it will read such
configuration from env variables of the process.

Additionally, I upgraded deprecated terraform SDK such as replacing
`Read` into `ReadContext` and added

[1]: carlpett#112
@kuzaxak
Copy link
Author

kuzaxak commented Jun 27, 2024

@carlpett hey, could you please have a look?

@carlpett
Copy link
Owner

Hi @kuzaxak,
Apologies for the slow response, I'm on parental leave and have quite limited time at the moment. Do you think you could split the SDK update into a separate PR so it is easier to validate in isolation? I recall giving it a quick try back when it was initially released and running into some issue, but that might be fixed now?

@kuzaxak
Copy link
Author

kuzaxak commented Jun 27, 2024

Hi @kuzaxak, Apologies for the slow response, I'm on parental leave and have quite limited time at the moment.

That's amazing! Hope you have a great time :)

Do you think you could split the SDK update into a separate PR so it is easier to validate in isolation? I recall giving it a quick try back when it was initially released and running into some issue, but that might be fixed now?

@carlpett Sure, will do. Could you give me a hint what kind of issues you faced?

@carlpett
Copy link
Owner

carlpett commented Jul 5, 2024

Ooops, apparently didn't press the "Comment" button, so this has been sitting in a tab a week 🤦

Thank you for the well wishes! :) I sadly don't remember what didn't work, as it's been a few years. I can't find any old issues that would indicate I actually made a release with it, so it was probably something quite obvious. Tests or even compilation failing, or something like that.

@nikaro
Copy link

nikaro commented Mar 15, 2025

Hello @kuzaxak any chance that you intend to finish the work on this PR? 😇

@nahuelarq
Copy link

This PR would be very useful for us, too.

devholic added a commit to trillion-labs/terraform-provider-sops that referenced this pull request Oct 26, 2025
To support dynamic auth as described in
carlpett#112,
this commit adds a new `env` attribute to allow users to pass
environment variables to provider.

Resolves:

- carlpett#112
- carlpett#121

Signed-off-by: Sunghoon Kang <sunghoon.kang@trillionlabs.co>
@binlab
Copy link

binlab commented Nov 7, 2025

Just wanted to share that I’ve been exploring a similar idea in a separate implementation — focusing on handling env = {} at the resource level instead of only through the provider block.
It addresses the same configuration flexibility issue discussed here, but from a slightly different angle.

You can see the concept, practical examples, and details on which problems this approach tries to solve here:

Might be useful for comparison or future design discussions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants