This repository provides the source code and automation for deploying an AWS Lambda function using an image from the ECR Public Gallery, leveraging AWS CDK and CloudFormation. It automates pulling the image from the public ECR and pushing it to a private ECR repository using CodeBuild and a CloudFormation custom resource.
For a detailed explanation of this process, check out the accompanying blog post: How to Deploy AWS Lambda with an Image from ECR Public Gallery using CDK & CloudFormation.
The architecture for this solution involves pulling an image from the ECR Public Gallery, pushing it to a private ECR repository, and deploying an AWS Lambda function. Below is the high-level architecture diagram:
Make sure you have the following installed:
npm install
npx cdk deploy