# AWS Lambda Container Support Example

**URL:** <https://forum.serverless.com/t/aws-lambda-container-support-example/13414>\
**Category:** Serverless Framework\
**Tags:** aws, lambda\
**Created:** [December 16, 2020, 11:47pm UTC](https://forum.serverless.com/t/aws-lambda-container-support-example/13414 "2020-12-16T23:47:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Irshad](https://avatars.discourse-cdn.com/v4/letter/i/8797f3/32.png) [@Irshad](https://forum.serverless.com/u/Irshad)\
**Post date:** [December 16, 2020, 11:47pm UTC](https://forum.serverless.com/t/aws-lambda-container-support-example/13414/1 "2020-12-16T23:47:36Z")

</div>

Hello,

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

> **[Creating Lambda container images - AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html)**

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.

---

<div class="post-metadata">

**Author:** ![coulonxyz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/coulonxyz/32/4917_2.png) [@coulonxyz](https://forum.serverless.com/u/coulonxyz)\
**Post date:** [December 22, 2020, 4:52pm UTC](https://forum.serverless.com/t/aws-lambda-container-support-example/13414/2 "2020-12-22T16:52:21Z")

</div>

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](https://github.com/pretty-fun-therapy/serverless-lambda-container-boilerplate)

---

<div class="post-metadata">

**Author:** ![Irshad](https://avatars.discourse-cdn.com/v4/letter/i/8797f3/32.png) [@Irshad](https://forum.serverless.com/u/Irshad)\
**Post date:** [December 22, 2020, 6:01pm UTC](https://forum.serverless.com/t/aws-lambda-container-support-example/13414/3 "2020-12-22T18:01:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![coulonxyz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/coulonxyz/32/4917_2.png) [@coulonxyz](https://forum.serverless.com/u/coulonxyz)\
**Post date:** [December 23, 2020, 5:04pm UTC](https://forum.serverless.com/t/aws-lambda-container-support-example/13414/4 "2020-12-23T17:04:57Z")

</div>

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.
