Trigger a Redwood Function from Another Function


I’ve currently got 2 Redwood JS functions, and my app is deployed to AWS via I’d like to trigger one of the functions when another has finished running, from inside the function.

From what I can gather, this is possible using the '@aws-sdk/client-lambda' package, specifically something like this:

// inside one of my redwood functions...
const command = new InvokeCommand(params); // params to invoke _other_ function
const data = await lambdaClient.send(command);

…however, one of the params I need is the function’s “lambda at edge ARN”. Looking at the configured lambda functions in AWS, neither of my functions appear to be there!

Is there some trickier stuff going on under the hood as far as how Redwood JS functions are deployed in AWS?

Thanks so much!

I delved into Flightcontrol a little as it seemed like a nice way to get used to AWS offerings.

From this part of the docs:
Flight Control service types

The server is a fargate container, which is using ECS with EC2 containers.

AWS Fargate
So you won’t have lambda’s per se but will actually have ec2 containers.

I found them in AWS via searching for Amazon Elastic Container Service, then going → Clusters
Click your cluster name,
Then click the service name
Then click the link next to or under “Target group name:protocol”

That’s where I found the port 8911 in, but it won’t be via the lambda part of the sdk.

1 Like

Thanks for the response @QuinnsCode ! Incidentally I abandoned this approach and went about accomplishing my goals in a different manner entirely, but yes, good to know it’s not actually lambda functions under the hood!