Multi-tenant API with AWS Lambda tenant isolation

Amazon API Gateway REST API → AWS Lambda

This sample project demonstrates the tenant isolation mode of AWS Lambda functions.

Amazon API Gateway receives the HTTP GET request with tenant id in the header x-tenant-id.
The API Gateway triggers either the standard or the tenant isolated Lambda functions depending on the URI.
Observe the counter variable value between standard and tenant isolation mode enabled Lambda function as you invoke the APIs for different tenant.

< 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/apigw-lambda-tenant-isolation

Deploy

sam buildsam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sam delete.

Created by:

Biswanath Mukherjee

Biswanath Mukherjee

Sr. Solutions Architect working at AWS India.

Follow on LinkedIn