Stack/project organizational best-practices questi...
# getting-started
b
Stack/project organizational best-practices question. Say I have a several-to-many situation I want to organize. I have multiple
foo
resources (auth providers) and multiple
bar
stacks (application environments). Each
bar
needs to talk to one and only one
foo
, and thus needs access to
foo
exported values. Each
foo
may have multiple `bar`s talking to it, but doesn't need to know anything about them. The `bar`s exist today,
foo
is new. How would folks organize this?
foo
-specific project? My ideal would be when creating a new
bar
that does not yet have an associated
foo
pulumi would magically create it, however I also don't want to risk the first
foo
being deleted and taking the
bar
with it unless all the `bar`s using
foo
were also gone.
p
There are two things you need to consider about • change ratio of resource • and resource lifecycle I can understand you don’t want to delete all bars unless all the bars using foo were also gone, actually I don’t think we should imitate infrastructure components as behaviorally with software components, let’s say, you can’t( actually you can but you gonna add just too much complexity into your iac codebase) use a bucket algorithm( this is just for example) so if bucket is empty then delete all bars, if it is not empty then it means there are foo. So I’d rather go one-to-one and ship the all foo with their own bars
So it will be easier to manage and you don’t have to consider about whether all foo s are gone or not
And also you should consider about its change ratio, if it is a resource that requires updates each they, I’d not ship it with resources that doesn’t require updates each day
Sometimes duplication is just making much more sense instead of putting such complexity or abstraction)
This is my idea though, maybe there are others think differently than me
b
Ah. I clearly left out that a) we cannot have a 1:1 in this case b) these are all super long lived, on the order of years. We'll update them all periodically, some frequently, but they're more pets than cattle.