AWS lambda update-function-code with jar package v

2019-08-18 03:03发布

问题:

I'm trying to update my lambda function code with jar from my local machine via AWS CLI. The aws lambda has commands to update function code for zip file but not for jar. I can upload by using s3 bucket, but I need to update from local itself.

I know following are the way to update from S3 bucket and for zip:

  1. aws lambda update-function-code --function-name --s3-bucket --s3-key
  2. aws lambda update-function-code --function-name --zip-file "fileb://"

I want to ask is there similar command exist for uploading jar as well?

回答1:

You're probably missing the "fileb://" part for the jar.

aws lambda update-function-code --function-name my-lambda-name --zip-file fileb://./target/my-lambda-jar.1.0-SNAPSHOT.jar