简体   繁体   English

通过 aws cli 命令将新的存储库映像部署到 lambda?

[英]Deploy new repository image to lambda by aws cli command?

I have three lambda , and each uses the image from ECR .我有三个lambda ,每个都使用来自ECR的图像。

Every time I push the image in ECR ,每次我在ECR中推送图像时,

I go to the lambda console then -> deploy new image -> select container image from popup.然后我转到 lambda 控制台 -> 部署新图像 -> 从弹出窗口中选择容器图像。

It is a bit bothersome procedure for repeating for every lambda .为每个lambda重复是一个有点麻烦的过程。

Is there any good way to do this in aws cli ??aws cli中有什么好的方法吗?

I have checked the aws cli lambda command and guess that aws lambda update-function-code is close to my purpose.我检查了 aws cli lambda 命令并猜测aws lambda update-function-code接近我的目的。

However I cant find the precise answer.但是我找不到确切的答案。

How can I deploy the latest tagged image in repository to the lambda image??如何将存储库中的latest标记图像部署到lambda图像?

Try this尝试这个

aws lambda update-function-code --function-name $MY_FUNC --image-uri $(aws lambda get-function --function-name $MY_FUNC | jq -r '.Code.ImageUri')

You must have correct env setup though.你必须有正确的环境设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM