Hacker News new | ask | show | jobs
by OJFord 1048 days ago
What do you mean by 'dynamically render providers'?

I assume you're aware you can instantiate multiple versions (different params) of a provider and pass them to child modules, e.g. you can instantiate a module once for each of a several AWS regions/accounts?

Do you mean that something like the region/account param would be set on the basis of a computed value from some other resource (because we created the account, say, or listed all regions satisfying some filter with a data source)?

2 comments

Let's say you need to configure a provider for 3 different regions. The natural way you want to do this is store the regions in a variable, and iterate over the variable using "for_each".

What you are referring to are called "provider aliases" and they work well for _avoiding_ using terragrunt (not very DRY though).

providers do not support `for_each` or `count`