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