AWS Lambda to AWS Lambda

AWS Lambda function → AWS Lambda function

Create Lambda function that sychronously invokes another Lambda function.

In this pattern SAM will deploy two Lambda functions, LambdaRequest and LambdaResponse. The LambdaRequest will call the LambdaResponse synchronously, and will wait for the response from the LambdaResponse function. The LambdaResponse will return an JSON payload.
The SAM template contains all the information to deploy AWS resources and also the permission required by these service to communicate.
You will be able to create and delete the CloudFormation stack using the CLI commands.
This is fully functional example developed in Java 11.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/lambda-lambda-sam-java

Deploy

sam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: sam delete --stack-name STACK_NAME.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus"

Created by:

Razvan Minciuna

Razvan Minciuna

Software Architect.

Follow on LinkedIn