Replies: 1 comment 3 replies
-
Hello @jplitza! I have a few follow-up questions to understand what you want to achieve better. The configuration implicitly uses non-aliased default aws provider to fetch |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Imagine I have a root module that creates stuff like virtual datacenters and k8s clusters, and inside that I have a module called "environment" that I include using
for_each
for each environment. Now each environment has its own set of credentials, which I generate inside the environment module. But because providers can only be declared at the global level, I have to use the resources from inside the module - which causes a cyclic dependency.This hopefully captures everything relevant:
However,
tofu plan
yields:What am I missing? It feels like the resources belong inside the module, because otherwise I would have a bunch of resources in the root module that all share the same
for_each
expression. Is there any way to break the implicit dependency of the aws_iam_user resource on the module it's contained in?(Note this is a toy example and I'm not even using AWS. So while I'm not against learning cool tricks of the AWS provider and could try requesting them for the providers I use, I'd be more interested solving this on the opentofu side)
Beta Was this translation helpful? Give feedback.
All reactions