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 9 in Web Development by Abhishek
• 280 points
217 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 by MD
• 23,050 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 in Web Development by Niroj
• 22,790 points

edited Jan 21 by Niroj 52 views
+1 vote
2 answers

How to embed Google map on my website?

1. Search whatever you want to embed. 2. ...READ MORE

answered Jan 17 in Web Development by anonymous
100 views
0 votes
0 answers

Anyone can help me out to understand the semantic of (document.getElementBYId("demo").innerHTML="Hello") ?

Hello guys, Can Someone helps me to find ...READ MORE

Jan 17 in Web Development by anonymous
• 11,290 points
47 views
+1 vote
1 answer

What are the different ways of using angularjs scope?

Hey!! basically there the three ways of using ...READ MORE

answered Jan 21 in Web Development by Niroj
• 22,790 points
39 views
0 votes
1 answer
0 votes
1 answer