2017-08-31 67 views
0

我的第一次嘗試是使用控制檯,它的工作。我有一個新的zip文件,可以在S3中成功上傳到我的存儲桶中。我可以列出存儲桶並在那裏看到兩個文件,但是當我嘗試使用CLI創建Lambda函數時,它會返回「錯誤解析參數--zip文件」:無法加載paramfile「...」沒有這樣的文件或目錄:「AWS CLI創建lambda函數看不到我S3中的zip文件「沒有這樣的文件或目錄」

我期望從文檔中獲得」fileb://path/to/file.zip「意味着存儲桶名稱,但我不確定是否需要區域URL。我嘗試了使用和不使用區域URL的結果。

同樣,如果我使用控制檯創建Lambda,但不能使用CLI,則可以使用這些文件。我錯過了什麼?

[[email protected] ~]$ aws s3 ls s3://uploads.lai 
2017-08-18 10:27:48 60383836 userpermission-1.zip 
2017-08-31 07:43:50 60389082 userpermission-4.zip 
2017-08-18 14:15:43  1171 userpermission.db 
[[email protected] ~]$ aws lambda create-function --function-name awstest01 --zip-file "fileb://uploads.lai/userpermission-4.zip" --runtime java8 --role execution-role-arn --handler app.handler 

Error parsing parameter '--zip-file': Unable to load paramfile fileb://uploads.lai/userpermission-4.zip: [Errno 2] No such file or directory: 'uploads.lai/userpermission-4.zip' 

回答

0

--zip-file標誌是,如果你從本地zip文件上傳功能。

如果您正在使用S3的CLI命令應該是沿着aws create function --code "S3Bucket=string,S3Key=string,S3ObjectVersion=string"

線的東西您可以在此查看參考: http://docs.aws.amazon.com/cli/latest/reference/lambda/create-function.html

+0

這工作。我也有錯誤的角色語法,但修復了它,現在我的函數在Lambda中。 – LinuxGuru

+0

你能選擇我的答案嗎? – MangoBoy

相關問題