'Deploy new repository image to lambda by aws cli command?

I have three lambda , and each uses the image from ECR.

Every time I push the image in ECR,

I go to the lambda console then -> deploy new image -> select container image from popup.

It is a bit bothersome procedure for repeating for every lambda.

Is there any good way to do this in aws cli??

I have checked the aws cli lambda command and guess that aws lambda update-function-code is close to my purpose.

However I cant find the precise answer.

How can I deploy the latest tagged image in repository to the lambda image??



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source