diff --git a/python/lambda-from-container/README.md b/python/lambda-from-container/README.md index 1f6c56e6d5..12f984da04 100644 --- a/python/lambda-from-container/README.md +++ b/python/lambda-from-container/README.md @@ -10,7 +10,7 @@ Lambda Function from Container * The **Container Image** is defined in `app.py`. - * If `use_pre_existing_image` is **True**, then it is expected that a **Container Image** was **created elsewhere** and will be used by this CDK code. + * If `use_pre_existing_image` is **True**, then it is expected that a **Container Image** was **created elsewhere** and will be used by this CDK code and that the image_name is the ECR Repo name. * If `use_pre_existing_image` is **False**, then a new container will be created using the `Dockerfile` from the the `lambda-image` sub-directory. * After deploying the **Lambda Function**, go to the **Lambda Dashboard**, open the **Lambda Function**, and **configure a test event**. diff --git a/python/lambda-from-container/app.py b/python/lambda-from-container/app.py index 5e98e7a1a0..42403e0961 100644 --- a/python/lambda-from-container/app.py +++ b/python/lambda-from-container/app.py @@ -35,7 +35,7 @@ def __init__(self, scope: Construct, id: str, **kwargs) -> None: ## ecr_repository = aws_ecr.Repository.from_repository_attributes(self, id = "ECR", - repository_arn ='arn:aws:ecr:{0}:{1}'.format(Aws.REGION, Aws.ACCOUNT_ID), + repository_arn ='arn:aws:ecr:{0}:{1}:repository/{2}'.format(Aws.REGION, Aws.ACCOUNT_ID, image_name), repository_name = image_name ) ## aws_ecr.Repository.from_repository_attributes