In order to build Docker images for Lambda functions with CDK on ARM or other non-Intel platforms, but want the Lambda to be on an x8664 platform, use the platform parameter…
Posts for: #Lambda
Fixing Runtime Exited Without a Reason Errors in AWS Lambda
This happens sometimes with Dockerized Lambdas. I have no idea why, but fixing it usually consists of rebuilding and re-pushing the docker image, redeploying it to the Lambda,…
Deploying an Updated Image to Lambda Function
Redeploying a CDK stack with a Lambda function that relies on a Docker image in ECR won’t necessarily update the function with a newly pushed image. Instead, use the Lambda…
Raising Exceptions from Lambda to API Gateway Caller
You can send exception feedback from a Lambda to an API Gateway API either by raising a Python exception and handling it via a mapping template, or return a specific set of…
Including Assets from Parent Directories in Dockerized Lambda Functions with CDK
If you have a Docker based Lambda that is defined in some directory and there are assets that the Lambda needs in the parent directory, fromimageasset() takes directory and…
Asynchronous Lambda Invocation
In order to invoke a Lambda asynchronously, pass InvocationType=“Event” to the invoke call. This is useful for, among other things, a hub/message routing Lambda that calls…
AWS Lambda Return Values for API Triggering
A Lambda triggered by an API has to return a dictionary with certain keys and values in order to not cause an error in execution (e.g. “malformed lambda proxy response”). These…
Passing Secrets into Lambdas in CDK
same: AWS Lambda Return Values for API Triggering, To Build a Lambda from a Dockerfile in CDK
To Build a Lambda from a Dockerfile in CDK
To set up a Dockerfile for a Lambda function that relies on non-AWS base images, you have to include the Python package awslambdaric in your requirements and install it. Then,…