https://pulumi.com logo
#getting-started
Title
# getting-started
m

magnificent-soccer-44287

10/15/2023, 9:05 PM
is cross-stack subresource ownership possible? ex.: • I have an ApplicationLoadBalancer defined in "core-infrastructure" github repo / pulumi project • I'd like to load it in a different repo and add a target group to it which that repo / stack owns. or do all target groups need to be created in "core-infrastructure" and then their ARNs exported + StackRef'd
l

little-cartoon-10569

10/15/2023, 10:57 PM
No, there is no concept of sub-resources. You can create a TG in any project and its LoadBalancerID can be from any other project.
You need to be aware of these dependencies, because they make actions like replacements harder to track. But that's all.
m

magnificent-soccer-44287

10/15/2023, 10:58 PM
gotcha. would it be a possible circular though? let's say i got: • project A with ALB • project B with targetGroup B imports ARN from A does A need any awareness of B?
l

little-cartoon-10569

10/15/2023, 10:58 PM
You should absolutely avoid that sort of thing. It is possible through a sequence of deployments, but you shouldn't do it.
m

magnificent-soccer-44287

10/15/2023, 10:59 PM
i figured as much - how do I work around that?
l

little-cartoon-10569

10/15/2023, 10:59 PM
It means you can't destroy either project's stacks without code changes and redeployments
m

magnificent-soccer-44287

10/15/2023, 10:59 PM
yeah
l

little-cartoon-10569

10/15/2023, 10:59 PM
What's the problem that requires a workaround?
m

magnificent-soccer-44287

10/15/2023, 10:59 PM
I'm working on a microstack pattern outlined here -> https://blog.bitsrc.io/managing-micro-stacks-using-pulumi-87053eeb8678 is this a fair resource? I havent found many [n] microstack examples in the pulumi example github
right now the problem is mostly my lack of comprehension 😅
l

little-cartoon-10569

10/15/2023, 11:01 PM
Pulumi introduced Micro-Stacks
I wonder where he got that from. There's nothing called "micro-stacks" in the Pulumi docs, afaik. It's just a project architecture.
m

magnificent-soccer-44287

10/15/2023, 11:01 PM
good to know for starters!
l

little-cartoon-10569

10/15/2023, 11:02 PM
Spend a little time designing your solution. Ensure all your dependencies follow a single direction, and nothing is circular. If you can do that, then you should have fewer problems.
m

magnificent-soccer-44287

10/15/2023, 11:03 PM
i mean yeah the fundamental patterns of sane infra don't change regardless of the tool haha;
just curious about the implementation pattern more than anything
l

little-cartoon-10569

10/15/2023, 11:03 PM
Also, it's not a biggy, but I recommend against using CallbackFunction. In my experience, mushing the app code into the infra codebase isn't terribly helpful and can lead to maintenance problems.
m

magnificent-soccer-44287

10/15/2023, 11:04 PM
um... yeah. just looked it up, that's an antipattern to say the least
i guess its okay to have as an absolute oh 💩 button
l

little-cartoon-10569

10/15/2023, 11:05 PM
It's great for rapid prototyping, it can be ok for infra-specific code.. but for app code, since you often have different devs, different deploy cycles, and different test regimes and requirements, it's just too hard to keep them in one codebase.
If nothing else, the testability goes way down.
2 Views