[{"data":1,"prerenderedAt":74},["ShallowReactive",2],{"pattern-apigw-lambda-dynamodb-xray-cdk":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":13,"deploy":15,"description":18,"extension":19,"framework":20,"gitHub":21,"highlight":6,"introBox":27,"language":32,"level":33,"meta":34,"patternArch":35,"resources":59,"s3URL":6,"services":6,"stem":68,"testing":69,"videoId":6,"__hash__":73},"patterns\u002Fpatterns\u002Fapigw-lambda-dynamodb-xray-cdk.json","Amazon API Gateway REST API to AWS Lambda to Amazon DynamoDB with X-Ray",null,{"headline":8,"text":9},"Cleanup",[10,11,12],"1. Delete the stack: \u003Ccode>npx cdk destroy\u003C\u002Fcode>.","2. Confirm the stack has been deleted: \u003Ccode>aws cloudformation list-stacks --query \"StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus\"\u003C\u002Fcode>.","3. You see a message confirming DELETE_COMPLETE.",[14],"content\u002Fcontributors\u002Fguyu-ye.json",{"text":16},[17],"cdk deploy","Create an API Gateway endpoint integrated with Lambda and DynamoDB with X-Ray enabled.","json","AWS CDK",{"template":22},{"projectFolder":23,"repoURL":24,"templateURL":25,"templateFile":26},"apigw-lambda-dynamodb-xray","https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fapigw-lambda-dynamodb-xray","apigw-lambda-dynamodb-xray\u002Fcdk\u002Flib\u002F","cdk\u002Flib\u002Fapigw-lambda-dynamodb-cdk-ts-stack.ts",{"headline":28,"text":29},"How it works",[30,31],"AWS X-Ray records and visualizes requests made by applications, making it a great tool to analyze and debug applications built using a microservices and serverless architecture.","This CDK application demonstrates how to integrate X-Ray SDK in Lambda functions to observe into downstream API calls. This example creates an Amazon API Gateway REST API that uses a Lambda function as the backend to scan a DynamoDB table. The REST API and Lambda function both have X-Ray tracing enabled. X-Ray SDK is also integrated in the Lambda function to observe into the API call to the downstream DynamoDB table.","TypeScript","200",{},{"icon1":36,"icon2":41,"icon3":45,"icon4":49,"line1":53,"line2":57},{"x":37,"y":38,"service":39,"label":40},20,50,"apigw","API Gateway",{"x":42,"y":38,"service":43,"label":44},40,"lambda","AWS Lambda",{"x":46,"y":38,"service":47,"label":48},60,"dynamodb","Amazon DynamoDB",{"x":50,"y":38,"service":51,"label":52},80,"xray","X-Ray",{"from":54,"to":55,"label":56},"icon1","icon2","",{"from":55,"to":58,"label":56},"icon3",{"headline":60,"bullets":61},"Additional resources",[62,65],{"text":63,"link":64},"AWS Docs: Writing Data to a Table","https:\u002F\u002Fdocs.aws.amazon.com\u002Famazondynamodb\u002Flatest\u002Fdeveloperguide\u002FSQLtoNoSQL.WriteData.html",{"text":66,"link":67},"Lambda CDK docs","https:\u002F\u002Fdocs.aws.amazon.com\u002Fcdk\u002Fapi\u002Fv2\u002F\u002Fdocs\u002Faws-cdk-lib.aws_lambda-readme.html","patterns\u002Fapigw-lambda-dynamodb-xray-cdk",{"headline":70,"text":71},"Testing",[72],"See the GitHub repo for detailed testing instructions.","warJb1K6rOzSi-YPlDXbdNyyZ8MTli1DhA8of9yYvSU",1780914906680]