[{"data":1,"prerenderedAt":72},["ShallowReactive",2],{"pattern-lambda-ddb-tenant-isolation-terraform":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":11,"deploy":13,"description":17,"extension":18,"framework":19,"gitHub":20,"highlight":6,"introBox":26,"language":30,"level":31,"meta":32,"patternArch":33,"resources":62,"s3URL":6,"services":6,"stem":67,"testing":68,"videoId":6,"__hash__":71},"patterns\u002Fpatterns\u002Flambda-ddb-tenant-isolation-terraform.json","Multi-tenant API with Amazon API Gateway and AWS Lambda Tenant Isolation",null,{"text":8},[9,10],"terraform destroy","terraform show",[12],"content\u002Fcontributors\u002Farchana-v.json",{"text":14},[15,16],"terraform init","terraform apply","This pattern implements a serverless multi-tenant API using Amazon API Gateway, AWS Lambda and Amazon DynamoDB to demonstrate tenant isolation.","json","Terraform",{"template":21},{"repoURL":22,"templateURL":23,"projectFolder":24,"templateFile":25},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Flambda-ddb-tenant-isolation-terraform","serverless-patterns\u002Flambda-ddb-tenant-isolation-terraform","lambda-ddb-tenant-isolation-terraform","main.tf",{"headline":27,"text":28},"How it works",[29],"This solution works by exposing two API Gateway endpoints, \u002Fstandard and \u002Fisolated, each backed by a separate Lambda function. When a request hits the \u002Fstandard endpoint, the Lambda function increments a single shared counter row in DynamoDB, meaning all tenants read and write the same value. When a request hits the \u002Fisolated endpoint with an x-tenant-id header, API Gateway maps the header to the Lambda execution context, ensuring a dedicated execution environment per tenant, and the Lambda function increments a tenant-specific counter row in DynamoDB, keeping each tenant's data completely separate.","Python","200",{},{"icon1":34,"icon2":39,"icon3":43,"icon4":45,"icon5":49,"line1":50,"line2":54,"line3":57,"line4":60},{"x":35,"y":36,"service":37,"label":38},15,50,"apigw","Amazon API Gateway",{"x":36,"y":40,"service":41,"label":42},20,"lambda","AWS Lambda",{"x":36,"y":44,"service":41,"label":42},70,{"x":46,"y":40,"service":47,"label":48},80,"dynamodb","Amazon DynamoDB",{"x":46,"y":44,"service":47,"label":48},{"from":51,"to":52,"label":53},"icon1","icon2","\u002Fstandard",{"from":51,"to":55,"label":56},"icon3","\u002Fisolated",{"from":52,"to":58,"label":59},"icon4","",{"from":55,"to":61,"label":59},"icon5",{"bullets":63},[64],{"text":65,"link":66},"Lambda Tenant Isolation","https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Ftenant-isolation.html","patterns\u002Flambda-ddb-tenant-isolation-terraform",{"text":69},[70],"See the GitHub repo for detailed testing instructions.","84YHdJ_MBMLueOgxzYB4pqhzT8MUpI9CSvDIlmPjhkI",1778846885925]