Skip to content
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

TF_VAR in environment should override config files to avoid need for temporary edits to config #197

Closed
jeliker opened this issue Oct 31, 2019 · 6 comments
Labels
SDK Issue pertains to the SDK itself and not specific to any service

Comments

@jeliker
Copy link

jeliker commented Oct 31, 2019

func DefaultConfigProvider() ConfigurationProvider {

Configuration is processed by first examining config file then, if needed, environment. Thus, to temporarily use another configuration one must remove or edit the config file. I propose the environment values TF_VAR_etc. should override anything found in the config file if set.

@jodoglevy jodoglevy added the SDK Issue pertains to the SDK itself and not specific to any service label Nov 1, 2019
@jasonyin
Copy link
Contributor

jasonyin commented Nov 5, 2019

hi @jeliker what're the TF_VAR you were referring here? Are they terraform configs, if yes, you might want to check here: https://github.com/terraform-providers/terraform-provider-oci

In general, if you want to use different configs and avoid edit config files you can do either of followings:

  1. add new profile in your config and switch different profiles in your code;
  2. write your own ConfigurationProvider with the customized logic you need;

@jeliker
Copy link
Author

jeliker commented Nov 5, 2019 via email

@jasonyin
Copy link
Contributor

jasonyin commented Nov 6, 2019

Thanks @jeliker for the reply.

From SDK perspective, we don't know what kind of TF env variables are and TF will have full control about use the variable in config file or via env variable. And that's the reason we give control to customers to provide their own ConfigurationProvider to do customization instead of changing the default behavior for it.

As I recommended before for the two approaches, TF can use either one to achieve this. Thoughts?

@jasonyin
Copy link
Contributor

jasonyin commented Dec 2, 2019

Hi @jeliker I am closing this issue, let me know if you still have questions, thanks!

@jasonyin jasonyin closed this as completed Dec 2, 2019
@jeliker
Copy link
Author

jeliker commented Dec 2, 2019 via email

@MPV
Copy link

MPV commented Sep 7, 2021

FYI I opened #318 (somewhat related to this issue, in case you'd be interested)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDK Issue pertains to the SDK itself and not specific to any service
Projects
None yet
Development

No branches or pull requests

4 participants