How can I create an AWS Lambda function using the AWS CLI?

前端 未结 3 1964
心在旅途
心在旅途 2021-02-07 09:56

I am trying to create an AWS Lambda function using the command

aws lambda create-function \\
  --function-name foo\\
  --runtime nodejs\\
  --role lambda_basic_e         


        
3条回答
  •  隐瞒了意图╮
    2021-02-07 10:34

    You have an extra colon ':' in the file spec.

    $ aws lambda create-function --function-name foo --runtime nodejs --role lambda_basic_execution --handler asdf --zip-file "fileb:://boom.zip"
    
    --zip-file must be a file with the fileb:// prefix.
    Example usage:  --zip-file fileb://path/to/file.zip
    
    $ aws lambda create-function --function-name foo --runtime nodejs --role lambda_basic_execution --handler asdf --zip-file "fileb://boom.zip"
    
    Error parsing parameter '--zip-file': Unable to load paramfile fileb://boom.zip: [Errno 2] No such file or directory: 'boom.zip'
    

提交回复
热议问题