[{"data":1,"prerenderedAt":70},["ShallowReactive",2],{"pattern-xray-lambdalayers-cdk-python":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":13,"deploy":16,"description":19,"extension":20,"framework":21,"gitHub":22,"highlight":6,"introBox":31,"language":35,"level":36,"meta":37,"patternArch":38,"resources":51,"s3URL":6,"services":63,"stem":64,"testing":65,"videoId":30,"__hash__":69},"patterns\u002Fpatterns\u002Fxray-lambdalayers-cdk-python.json","AWS Lambda function 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,15],"content\u002Fcontributors\u002Femmanuel-saliu.json","content\u002Fcontributors\u002Fmark-lyon.json",{"text":17},[18],"cdk deploy","Create a Lambda function using Lambda layers to enable X-Ray.","json","AWS CDK",{"template":23,"payloads":28},{"projectFolder":24,"repoURL":25,"templateURL":26,"templateFile":27},"xray-lambdalayers-cdk-python","https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fxray-lambdalayers-cdk-python","lambda_layer_x_ray_stack","lambda_layer_x_ray_stack\u002Flambda_layer_x_ray_stack_stack.py",[29],{"headline":30,"payloadURL":30},"",{"headline":32,"text":33},"How it works",[34],"This CDK example sets up AWS X-Ray for a Lambda function that uses Lambda Layers. The example demonstrates the use of the folder structure for a Lambda layer written in Python, and using constructs for deploying and using the layer and X-Ray.","Python","100",{},{"icon1":39,"icon2":44,"line1":48},{"x":40,"y":41,"service":42,"label":43},20,50,"xray","X-Ray",{"x":45,"y":41,"service":46,"label":47},80,"lambda","AWS Lambda",{"from":49,"to":50,"label":30},"icon1","icon2",{"headline":52,"bullets":53},"Additional resources",[54,57,60],{"text":55,"link":56},"Amazon Web Services Cloud Development Kit(AWS CDK) framework.","https:\u002F\u002Faws.amazon.com\u002Fcdk\u002F",{"text":58,"link":59},"Creating and sharing Lambda layers","https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Fconfiguration-layers.html",{"text":61,"link":62},"AWS X-Ray SDK for Python","https:\u002F\u002Fdocs.aws.amazon.com\u002Fxray\u002Flatest\u002Fdevguide\u002Fxray-sdk-python.html",{"from":42,"to":46},"patterns\u002Fxray-lambdalayers-cdk-python",{"headline":66,"text":67},"Testing",[68],"See the GitHub repo for testing instructions.","AlHZMRoynu2y9n6xTYBhYyvasbgj5CHhGe3_l1mRBoY",1778846888694]