I took the idea of separating it into business dom...
# typescript
g
I took the idea of separating it into business domains that you can logically deploy separately from the team at A Cloud Guru. During the last serverless conference they spoke about their journey. While they use CloudFormation, the same ideas are valid 🙂 (at least that’s the way it works for me)
w
That makes some sense, but how would you pass dependencies around between resources in different domains?
That's what I'm conceptually hung up on
g
I create resources in a single domain. For example, my DynamoDB table or SQS queues, and those resources follow a specific naming standard (like payment-requestqueue-dev, where
payment
and
dev
are the part of the stack name). I export either the ARN or the name, based on what I need to allow other resources access. In my Payment domain, I need my Lambdas to access the SQS queues, so one of the first things I do is call out to the stack variables of the other stack to get the names (or ARNs) of those resources.
w
Call out to the stack variables, that is, go through the main stack object?
Mind if I ask for more detail about what your .ts module hierarchy would look like in that instance?
g
In my case, I’ve split them out as separate stacks (so splitting at the infra level)
w
so you force every resource for a given stack into one file?
that seems much more granular than we'd been treating a stack
and would lead in our case to very, very large pulumi .ts files
g
and that’s where it makes sense to split them into reusable components and have those as modules (as you suggested in the main thread 🙂 )
w
which brings us back to my original question of how to organize those within a single stack 🙈 I guess. Thanks for the discussion
g
My code, while written in Go, is all on GitHub. This is the main repo https://github.com/retgits/acme-serverless and each of the business domains have their won repos (linked in the README)