Skip to content

Commit 4aa4d9a

Browse files
author
Michael Kaiser
committed
Fix(py/lambda-from-container): Fixes #715 for ecr repo arn
1 parent 4770ee5 commit 4aa4d9a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

python/lambda-from-container/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Lambda Function from Container
1010

1111

1212
* The **Container Image** is defined in `app.py`.
13-
* 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.
13+
* 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.
1414
* If `use_pre_existing_image` is **False**, then a new container will be created using the `Dockerfile` from the the `lambda-image` sub-directory.
1515

1616
* After deploying the **Lambda Function**, go to the **Lambda Dashboard**, open the **Lambda Function**, and **configure a test event**.

python/lambda-from-container/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self, scope: Construct, id: str, **kwargs) -> None:
3535
##
3636
ecr_repository = aws_ecr.Repository.from_repository_attributes(self,
3737
id = "ECR",
38-
repository_arn ='arn:aws:ecr:{0}:{1}'.format(Aws.REGION, Aws.ACCOUNT_ID),
38+
repository_arn ='arn:aws:ecr:{0}:{1}:repository/{2}'.format(Aws.REGION, Aws.ACCOUNT_ID, image_name),
3939
repository_name = image_name
4040
) ## aws_ecr.Repository.from_repository_attributes
4141

0 commit comments

Comments
 (0)