Simple method to trigger other Serverless functions inside one function

I have one function that checks to see what other functions need to run. How do I make a call to run the other Serverless function inside my own project.

The only solution I found was sns but the documentation on actual implementation is sparse.

You can totally use SNS, but you would have to set up a SNS Topic, subscribe to it, etc.

The easiest way is to just Invoke (linking the JS SDK, but all have it) your function from your original function. SNS also doesn’t allow you to pass much data in a message, so Invoke is better for that too.

The Lambda runtime environment always includes the AWS SDK, so you don’t need to package/include it with your function. You will need to make sure your function has the right IAM privileges e.g. lambda:InvokeAsync, lambda:InvokeFunction, etc.

1 Like

Ok thanks for the info. Seems like a good topic for documentation.