Download an already uploaded Lambda function

前端 未结 4 1451
北恋
北恋 2020-12-01 08:57

I created a lambda function in AWS (Python) using \"upload .zip\" I lost those files and I need to make some changes, is there is any way to download that .zip?

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 09:31

    Update: Added link to script by sambhaji-sawant. Fixed Typos, improved answer and script based on comments!

    You can use aws-cli to download the zip of any lambda.

    First you need to get the URL to the lambda zip $ aws lambda get-function --function-name $functionName --query 'Code.Location'

    Then you need to use wget/curl to download the zip from the URL. $ wget -O myfunction.zip URL_from_step_1

    Additionally you can list all functions on your AWS account using

    $ aws lambda list-functions

    I made a simple bash script to parallel download all the lambda functions from your AWS account. You can see it here :)

    Note: You will need to setup aws-cli before using the above commands (or any aws-cli command) using aws configure

    Full guide here

提交回复
热议问题