How to upload zip from the S3 bucket to lambda function using AWS CLI

0 votes
How to upload zip from the  S3 bucket or build target folder to lambda function using AWS CLI. I am using CLI in bamboo plan.

Something like below. In my bucket have multiple files. so only want to upload zip file. And every time file name get change. So don't want hard code the file name. That is why want to use *.zip

aws lambda update-function-code --function-name prod-prediction --zip-file fileb://./data/stage/target/*.zip
Apr 10, 2020 in Web Development by Abhishek
• 280 points
5,413 views

1 answer to this question.

0 votes

Hi@Abhishek,

You want to upload your zip file from s3 bucket to aws lambda function, for that you can use the bellow syntax.

To create one lambda function.

$ aws lambda create-function 
--function-name "awslambdausingcli" 
--runtime "pthon3.6" 
--role "arn:aws:iam::625297745038:role/lambdaapipolicy" 
--handler "awscli.handler" 
--timeout 5 
--memory-size 256 
--zip-file "fileb://awscli.zip"

To update that lambda function.

$ aws lambda
update-function-code
--function-name <value>
[--zip-file <value>]
[--s3-bucket <value>]
[--s3-key <value>]
[--s3-object-version <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Try with this once.

answered Apr 10, 2020 by MD
• 95,440 points
But as I already described that each time file name get change. So I don't want hard code the file name. That is why want to use *.zip. Will this solution work? I don't think so. Kindly suggest.
If you don't want to replace file name, then remove previous file and call the function with the same file name.

Related Questions In Web Development

+1 vote
1 answer

How to access the Angularjs scope of a particular html element from our console?

Hello, You should follow the below steps:-- 1.Compile and ...READ MORE

answered Jan 21, 2020 in Web Development by Niroj
• 82,880 points

edited Jan 21, 2020 by Niroj 2,478 views
0 votes
0 answers

How to get the Australian Time Zone using Javascript?

I am trying to help a friend ...READ MORE

Jul 19, 2022 in Web Development by gaurav
• 23,260 points
912 views
0 votes
0 answers

How to get mobile number from facebook login using jquery?

I am trying to work facebook login ...READ MORE

Jul 19, 2022 in Web Development by gaurav
• 23,260 points
654 views
0 votes
1 answer

How to change the jquery mobile flip switch state from code

I've examined the page you posted and ...READ MORE

answered Aug 1, 2022 in Web Development by rajatha
• 7,640 points
462 views
0 votes
0 answers

Using jQuery to countdown from 90 seconds beginning on the click of an element

Hi I was wondering if anyone can ...READ MORE

Aug 22, 2022 in Web Development by gaurav
• 23,260 points
353 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP