change lambda to no longer use zip deployment package

0

I have a lambda function that had been using a zip file deployment package in order to include some python modules. I have added a layer that includes the required packages so I only need my source code in the console editor. How can I remove the deployment package and have my function source in the editor window?

gefragt vor 2 Jahren1086 Aufrufe
2 Antworten
0

Hi there

I understand you want to remove a layer on your lambda function, please run this command on your aws CLI "aws lambda delete-layer-version --layer-name my-layer --version-number 1" Note when you delete a layer version, you can no longer configure a Lambda function to use it. However, any function that already uses the version continues to have access to it.

Hope this helps.

References:

https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-delete

beantwortet vor 2 Jahren
  • Thanks for the quick response. I may not have been clear. I want to delete the zip deployment package, not the layer. I created another function with a zip deployment package, no layers. When I do a "aws lambda list-functions" no layers are shown for this new function. I don't see anything in the cli docs that lets me add or delete the zip package.

0

What you can do is create a ZIP file with only one file in it - the one containing your code. Update the Lambda function with that ZIP file as you have previously been doing. Then your file will show up in the Lambda console code editor.

profile pictureAWS
EXPERTE
beantwortet vor 2 Jahren
  • @Brettski@AWS is correct, however, using the console to edit code is not really recommended. I would recommend that you use SAM CLI and SAM Templates to define your functions and deploy them.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen