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

Support provider_override #1302

Open
maxexcloo opened this issue May 16, 2024 · 4 comments
Open

Support provider_override #1302

maxexcloo opened this issue May 16, 2024 · 4 comments
Labels
✨ enhancement New feature or request

Comments

@maxexcloo
Copy link

Is your feature request related to a problem? Please describe.
Currently I need to define a provider for each server, I would like to be able to do this on a resource level.

Describe the solution you'd like
Add a provider_override tag into a resource and have that override the provider defaults for that resource, options would be the same as the provider options.

Describe alternatives you've considered
Manually creating every provider, leads to a ton of duplication and is quite messy.

Additional context
An example is here: https://registry.terraform.io/providers/TelkomIndonesia/linux/latest/docs#provider-override

@maxexcloo maxexcloo added the ✨ enhancement New feature or request label May 16, 2024
@bpg
Copy link
Owner

bpg commented May 16, 2024

Hi @maxexcloo! 👋🏼

Your response is clear and informative. Here's a minor refinement for clarity:

I'm not quite sure what problem you're trying to solve with this enhancement. Is it about deploying different resources to different nodes in a cluster? If that's the case, the node_name should suffice for the provider. However, you may need to configure additional node name mapping if your node names aren't resolvable in your LAN by DNS (with the default domain).

Regardless of that, the provider expects all nodes in the cluster to have the same authentication configuration for the SSH connection (SSH user, password, or SSH key), and this is unlikely to change.

Let me know if that helps, or if you'd like to discuss this feature further.

@bpg bpg added the ⌛ pending author's response Requested additional information from the reporter label May 16, 2024
@maxexcloo
Copy link
Author

Unfortunately as my servers are in different geographic locations I can’t use clusters and as such I need to use a new provider per server currently - as I have many servers this means huge duplication throughout my code (unfortunately Terraform has not supported dynamic providers for several years…)

@bpg bpg removed the ⌛ pending author's response Requested additional information from the reporter label May 16, 2024
@bpg
Copy link
Owner

bpg commented May 23, 2024

Hi @maxexcloo, have you tried provider aliases?

@maxexcloo
Copy link
Author

I have and they work, unfortunately I can’t use them in a programmatic way and as I have a lot of servers I end up having to manually duplicate everything out (if there were provider overrides it would be a simple for_each).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants