Hey guys, I'm trying to trigger one of our lambdas...
# help
j
Hey guys, I'm trying to trigger one of our lambdas from cloudtrail events, specifically IAM events. These events only come through on the global region (us-east-1), and so my event bus and pattern needs to be in this region. However the main region for my stacks are in eu-west-1. Any tips on if/how I can achieve this in SST within the same app? With CDK I would just pass in a different region in the env when creating the stack that contains my event bus. Is this possible at all in SST? Or do I need to deploy a separate app for my us-east-1 resources. Thanks.
f
Hey @James, yeah currently all stack in an SST app are deploy to the same region.
But let me loop in the team, @thdxr @Jay should we relax this requirement and allow stacks to be deployed to different regions?
t
I personally don't think so, it's a lot cleaner to think of a deployment as a set of stacks all in one region. You can always conditionally exclude stuff by checking what region it's deployed to
j
Yeah for now the conditional is the best way? But this is something we should talk about internally.
f
@James we probably need to discuss and design this a bit more internally. For now, there is a “non-official” way to do this within the same app. We are enforcing the region in
sst.Stack
, but you can use
cdk.Stack
and set it to a differrent region.
I haven’t tried this.. so I’m not sure if this would cause any conflict with the SST console.
I wouldn’t put a lot of resources into this stack 🙂
j
Thanks guys, I'm currently just conditionally deploying the stack as a work around - but i'll try the cdk stack construct and see if that works / looks cleaner. The stack literally consists of a couple of event rules and lambdas, I'd love to have them in the one region but aws decided to only emit certain cloudtrail events in the us-east-1 region. I had a similar issue a few months back with Lambda@edge functions in CDK, which are only deployed to us-east-1 region, but they have a EdgeFunction construct for this which makes it a lot easier to provision from another region. So there are certainly a few use cases for this, I'll keep an eye on the issue - thanks.
i
hi guys, any update on the topic I'm going into a similar issue and I don't know what's the best way to solve it
j
@Islam Salem can I get you to post this again in the #help channel with what you are looking for? You can link to this thread there. It helps us better keep track of things. Thanks!