2

I am unable to update my AWS Lambda function using the CLI command,
I created a .zip file and uploaded the .zip to the Lambda function via the AWS Console and it worked,
But the same file I am not able to upload using the AWS CLI,

I am getting the following error while, trying to use the cli command -

Error parsing parameter '--zip-file': Unable to load paramfile fileb:

Command used to update the function -

aws lambda update-function-code --function-name test --zip-file "fileb://$deployableName"

File trying to upload -
enter image description here

I am referring the following links -
1. https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html
2. AWS lambda update-function-code with jar package via AWS CLI
3. How can I create an AWS Lambda function using the AWS CLI?

2 Answers 2

3

I was able to resolve this by specifying the absolute path of the .zip file, to the --zip-file option.

aws lambda update-function-code --function-name test --zip-file "fileb:///home/user/poc/lambda/Monday-17-Jun-2019-1560756274.zip"
Sign up to request clarification or add additional context in comments.

Comments

0

The error

Error parsing parameter '--zip-file': Unable to load paramfile fileb:

Indicates that the given file can not be found. Are you sure that:

  • The variable is being correctly replaced by a value?
  • The file exists? Check Relative/Absolute paths

6 Comments

Yes was able to upload the file - Monday-17-Jun-2019-1560756274.zip using console.
What I mean is, are you 100% sure $deployableName is replaced by Monday-17-Jun-2019-1560756274.zip?
When I echo $deployableName, it's displaying Monday-17-Jun-2019-1560756274.zip
But that still does not give any certainty it is replaced on that specific location. Try adding --debug and see if that output helps
ran the command using the --debug option, aws --debug lambda update-function-code --function-name test --zip-file "fileb://$deployableName", Shared O/P on question
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.