Deploy Lambda

For a Lambda Function you need to create the infrastructure, that is the Lambda resource and connected resources. In the chapter Create a GO Lambda Resource in the AWS Console it is described how to do that in the console. I would recommend automating it. How to do that with the CDK in go is described in the chapter Lambda infrastructure with CDK.

This section is about the deployment of the Lambda function itself. As the CDK is used for almost every infrastrukture in AWS and I use CDK all over this page, these chapters are also covering the CDK constructs.

Overview Lamdba deployment methods

Overview Deployment

1 Direct deployment

Send app code with Lambda CreateFunction API call. See chapter Create a GO Lambda function for details. This should only be used up to 50MB deployment package size.

2 S3 Deployment

Store the deployment package on S3 and reference it in the CreateFunction API call. This is the standard method used by CDK, see chapter Lambda infrastructture with CDK for that.

3 Container images

Here a Docker container image is used. The deployment package can be larger. This does not mean, that Lambda is running a container, its just used for deployment.

See also