AWS Lambda Container Support Example

Hello,

Can somebody provide an example of AWS Lambda using Container Support as documented here:

I created a Lambda function using AWS CDK as:

const listMusicFunction = new lambda.DockerImageFunction(this, ‘listMusicFunction’,{
functionName: ‘listMusicFunction’,
code: lambda.DockerImageCode.fromImageAsset(path.join(__dirname, ‘…/src/music-service’), {
cmd: [ “list.list” ],
entrypoint: ["/lambda-entrypoint.sh"],
}),
environment: {
DYNAMODB_TABLE: this.table.tableName
},
});

Do you have a Serverless sample of this code snippet?

Regards.

Hello,
you can start with this boilerplate I just made.

You should be able to define additional ressources in your serverless.yml as usual.

https://github.com/pretty-fun-therapy/serverless-lambda-container-boilerplate

1 Like

Thanks for the effort. Do you have a sample that has two lambda functions deployed using one container image?

I’m not sure you can do that, as you’re image point to a single handler.
Or maybe with parameters…

In my example, it sits behing an api gateway, and it has a http router behind, so you can access different controllers depending of the method and path you use.