https://pulumi.com logo
#typescript
Title
# typescript
g

green-morning-1318

05/07/2020, 12:02 AM
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

wooden-lighter-66320

05/07/2020, 12:12 AM
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

green-morning-1318

05/07/2020, 12:16 AM
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

wooden-lighter-66320

05/07/2020, 12:20 AM
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

green-morning-1318

05/07/2020, 12:21 AM
In my case, I’ve split them out as separate stacks (so splitting at the infra level)
w

wooden-lighter-66320

05/07/2020, 12:22 AM
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

green-morning-1318

05/07/2020, 12:24 AM
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

wooden-lighter-66320

05/07/2020, 12:25 AM
which brings us back to my original question of how to organize those within a single stack 🙈 I guess. Thanks for the discussion
g

green-morning-1318

05/07/2020, 12:25 AM
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)