I may need someone to help me set up a system in w...
# software-contributors
c
I may need someone to help me set up a system in which a lambda from slackapp (slack_admin) can trigger a lambda from frumfinancecore (respond_slack_lambda) because I am not sure how that is done
m
There are multiple existing examples. @full-wall-37598 can you point to one?
thankyou 1
f
rn we just exposed a rest api and granted the slackapp access to invoke the resource in apigw
that’s the existing pattern and you can add routes there in theory. Alternatively you can invoke it directly with a similar auth pattern
c
@full-wall-37598 That wont work here. The reason we need two lambdas is because one of them needs to return quickly and the second one will be a longer task. so the first one can't wait for the second one to execute before it returns a result
m
Have lambda 1 put a message onto the queue that lambda 2 is subscribed to, then return
f
@curved-bear-18232 it shouldn’t matter. we can have 1 sqs fifo queue and a lambda receiving messages. The message body contains message and slack id. the handler just sends the message
so we can share this lambda in the whole app
c
yeah that all makes sense. I don't really know how to set anything up. Anything I setup inside AWS is only if I copy paste it from somewhere else in the codebase.
m
but the code is readable, no?
so it shoudn't be like copy pasting magic
f
we have examples of making queues in budgetinsightsstack (unless it’s in stateful stack, don’t remember)
c
yes I think so. My point is I need existing examples to work off of. Do we have such examples for this?
m
for sqs to lambda? you can google cdk sqs to lambda
f
we also have event bridge trigger already set up if you want an example
c
Ok I will look for all that. I happen to be especially terrible at JS/TS. But I'll figure it out. Thanks for your help!
💪 1
f
lmk if you can’t find the examples
thank you 1
c
ok sure. I will probably look in the afternoon
is it this @full-wall-37598
m
is this core or slack
f
this is an example of granting cross account access
this is in core granting access to slack and access to anyone to call a public api
although it could be that second statement is redundant