Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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??

like image 839
Dekishigrash Avatar asked Jul 01 '26 04:07

Dekishigrash


1 Answers

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.

like image 87
rahimli Avatar answered Jul 05 '26 12:07

rahimli