Skip to content

Commit abb5af6

Browse files
docs(ecr-assets): fixes documentation for cross-account access to dockerImageAsset ECR repository (#29766)
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* ### Issue # (if applicable) #13327 (Only a docs update, does not fix the underlying issue) ### Reason for this change In cdkv2, it is no longer possible to add permissions on the repository for `dockerImageAsset`, but the docs were not updated. ### Description of changes Updates documentation for aws-ecr-assets. Mentions that it is no longer possible to grant repository permissions on `dockerImageAsset` for cross-account access and provides possible alternate routes. ### Description of how you validated changes Rebuild the affected doc. No, docs change only ### Checklist - [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent f1fd56a commit abb5af6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/aws-cdk-lib/aws-ecr-assets/README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,7 @@ method. This will modify the IAM policy of the principal to allow it to
207207
pull images from this repository.
208208

209209
If the pulling principal is not in the same account or is an AWS service that
210-
doesn't assume a role in your account (e.g. AWS CodeBuild), pull permissions
211-
must be granted on the __resource policy__ (and not on the principal's policy).
212-
To do that, you can use `asset.repository.addToResourcePolicy(statement)` to
213-
grant the desired principal the following permissions: "ecr:GetDownloadUrlForLayer",
210+
doesn't assume a role in your account (e.g. AWS CodeBuild), you must either copy the image to a new repository, or
211+
grant pull permissions on the resource policy of the repository. Since the repository is managed by the CDK bootstrap stack,
212+
the following permissions must be granted there, or granted manually on the repository: "ecr:GetDownloadUrlForLayer",
214213
"ecr:BatchGetImage" and "ecr:BatchCheckLayerAvailability".

0 commit comments

Comments
 (0)