I have two stacks that point to the same folder fo...
# sst
l
I have two stacks that point to the same folder for lambda functions/api routes. The
Auth
stack uses a function in the singers module, because it creates a singer from the user record in the Cognito UserPool in the
postConfirmation
Cognito trigger. The
Singers
stack points to the singers module, too, because it handles the rest of the singers functionality. This wasn't an issue back in my Node days, but now seems to be a hassle with Python. Since Python uses
srcPath
to point to the folder, and then the route just points to the lambda file itself, it seems that
Auth
stack is claiming all the lambda files in the singers folder, and then when the
Singers
stack tries to claim the remainder of the lambda files, it can't have any because:
Copy code
Building Lambda function src/services/singers/KAR_SNG_get_singer_by_id.handler
Error: Asset is already associated with another stack 'test-karaoke-auth'. Create a new Code instance for every stack
I could create a separate folder for that one function that Auth needs, and I will if I have to, but it feels like a bit of a hack. Is there a configuration refinement I can use to not let
Auth
be greedy and steal all the lambdas in
Singers
?
f
Hey Luke, I opened an issue. Let me take a look at this. I think there’s something we can do to handle this on the framework side.
@Luke Wyman fixed this in v0.40.4. Give it a try and let me know if it works!
l
Thanks, Frank. Will check it out!
Just upgraded to
v0.40.4
. Has cleaned up the shared python lambdas folder nicely - no technical debt/hacks here! Thanks, @Frank!
f
Awesome!