Score:0

Will AWS Lambda deployed from image pull the ECR image on each new instances get initialised

pt flag

Because of Lambda’s ZIP deployment size limitation I’m changing the way I deploy my Lambda functions to use container image.

The deployed function is located within a VPC, so I have a NAT gateway within that VPC to allow public internet traffic, so I need to know if I need to add a VPC endpoints for the ECR services or not (to minimise the traffics going through the NAT gateway).

I’m not sure how/when the lambda pull the image from ECR. is it a 1-time pull that occur when deploying a new image version, or whenever a new lambda instance initialised (cold start)?

In the following post, it says

Lambda also optimizes the image and caches it close to where the functions runs so cold start times are the same as for .zip archives.

But its not clear whether if it’ll still use ECR to get the image or it’ll uses some dedicated location “close to the lambda” ?

Tim avatar
gp flag
Tim
An ECR endpoint should reduce NAT gateway usage, or eliminate it if it's not used for anything else. I don't know the answer to your other question, you could work it out by pushing an image, running a lambda, then pushing another image with a subtle difference like a print command when it starts.
Amer Sawan avatar
pt flag
Thanks @Tim, I'll check that manually as you mentioned, that will give accurate information about when the image exactly will get pulled.
Amer Sawan avatar
pt flag
To prevent content duplication, I'm removing this question, here is the same question posted on AWS re:post website that contains more detailed information. https://repost.aws/questions/QUUB4mNCLdTVGm_lUeGt8lsg/will-lambda-deployed-from-image-pull-the-ecr-image-on-every-startup
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.