-
Notifications
You must be signed in to change notification settings - Fork 626
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
Add cloudflare_client_config data source #650
Comments
How does this differ from using variables and referencing them in other resources? I’m struggling to see what we’re getting by adding this as a data source. |
The big difference is that you don't have to know in advance how things like the API token, account ID, etc., are being passed in. For example, they could be set using Terraform vars, or they could be set using Without this, you're left having to ensure that the same variable name is used everywhere. And you have no way of accessing the token if it's passed using an env var. Another example of this pattern is |
There is a bit of nuance in here as the only case that wouldn't use the variable is if you're using the environment variable directly. Other than that, passing in variables (either using the I'm not totally sold on it yet but will leave it here for some consideration. |
It's true that the only case where there is absolutely no other way is if you're using the environment variable directly. For now, I'm just passing in a variable and using it in multiple places. However, I think having this data source would also make things less error-prone. For example, let's say you change from using Being able to say reference something like |
I'm going to close this one off for now as I don't really have a firm case for why someone would use this over the existing variable reference measures. This isn't to say it's not important, just that right now there isn't a big enough push for it to require further action. If we get more requests for something like this or new information, I'm happy to reopen and reassess from there. |
Just as another data point, this is becoming a pretty common feature among various providers: |
…gurable-for-account-level-resources virtualdns: allow support for account level resources
A
cloudflare_client_config
data source for accessing the configuration of the Cloudflare provider would be very helpful. This would be analogous to thegoogle_client_config
data source from the Google provider.It would allow exporting the current Cloudflare config to other resources.
Expected Behavior
Example of what this could look like:
Another use case would be putting the current Cloudflare API token into a Kubernetes secret.
The text was updated successfully, but these errors were encountered: