Code Storage - Does it reuse a deployment package?

0

Hello,

I have several functions using same deployment package, like this:

...
    "DeleteDashuserLambdaFunction": {
      "Type": "AWS::Lambda::Function",
      "Properties": {
        "Code": {
          "S3Bucket": "dev.eu-west-1.serverless.deploys.em.com",
          "S3Key": "serverless/user-service-ts/dev/1554451324595-2019-04-05T08:02:04.595Z/user-service-ts.zip"
        },
...
    "InviteDashuserLambdaFunction": {
      "Type": "AWS::Lambda::Function",
      "Properties": {
        "Code": {
          "S3Bucket": "dev.eu-west-1.serverless.deploys.em.com",
          "S3Key": "serverless/user-service-ts/dev/1554451324595-2019-04-05T08:02:04.595Z/user-service-ts.zip"
        },
...

Will the lambda reuse the deployment package? What's more effective from the code storage perspective: use one zip (say 10MB) for several functions or split into smaller zips (10 packages 5 MB each)?

질문됨 5년 전214회 조회
1개 답변
0
수락된 답변

Hi there!

Will the lambda reuse the deployment package?

Lambda will not reuse the same deployment package. When the Lambda function is deployed, it creates a copy of the code referenced in the S3 bucket for each function.

What's more effective from the code storage perspective: use one zip (say 10MB) for several functions or split into smaller zips (10 packages 5 MB each)?

It is always recommended to have a smaller deployment package for each Lambda function. While there is no direct advantage with respect to code storage, this provides multiple advantages such as reduced cold start times and the ability to edit code inline. More details can be found here:
https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html

AWS
답변함 5년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠