Dinu
Dinu

Reputation: 21

Deploy at once multiple aws netcore lambda functions

Is there any solution with Serverless Framework or with AWS CloudFormation template to publish multiple lambda that are located each in an individual visual studio .proj and in an individual visual studio .sln

Any example I can find contains lambda function in the same class or proj.

Upvotes: 2

Views: 1390

Answers (1)

JeffR
JeffR

Reputation: 1792

I looked into this a while back. From what I remember I think you can deploy multiple lambda functions using the same CloudFormation template in one of two ways.

  1. Manually create separate zip packages for each function, load them into S3, and then reference that package explicitly in the CloudFormation template for each Lambda function.
  2. Combine the files from all the published projects into the same folder (CloudFormation template must be in the same folder too), then use the "aws cloudformation package" command which will create the zip, load it to S3, and then update the template with the S3 path to the package. I'm not sure if you'd even be able to have nested folders for each project due to how Lambda calls the methods.

The issue with #1 is that it's a lot more of a manual process, or a lot more scripting that has to be done.

The issue with #2 is that each Lambda function that's created will contain the files for all functions that are part of that package, even though you're only accessing one Function handler. Also, file conflicts are possible if different versions of the same assembly are used in different projects. There's also a limit on the package size that can be loaded for Lambda functions (50MB compressed, 250MB uncompressed) so that may also be a factor for some people.

Due to these added complexities & potential issues we just decided to have a separate CloudFormation template & stack for each Lambda function.

Lambda limits - see "AWS Lambda Deployment Limits"

Upvotes: 2

Related Questions