Created
October 15, 2020 18:46
-
-
Save karthikeayan/b5f36fd23fecd0c941302a9f90105370 to your computer and use it in GitHub Desktop.
Allow other AWS Accounts to pull images from ECR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Account A needs to pull images on Account B: | |
On Account A: | |
* Create a role in Account A | |
* Add policy which as ECR read access | |
On Account B: | |
* Create ECR Repository | |
* Add policy to the ECR Repository as below under permissions and replace <AccountA_ID> | |
{ | |
"Version": "2008-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowPull", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": [ | |
"arn:aws:iam::<AccountA_ID>:root" | |
] | |
}, | |
"Action": [ | |
"ecr:BatchCheckLayerAvailability", | |
"ecr:BatchGetImage", | |
"ecr:DescribeRepositories", | |
"ecr:GetAuthorizationToken", | |
"ecr:GetDownloadUrlForLayer", | |
"ecr:GetRepositoryPolicy", | |
"ecr:InitiateLayerUpload", | |
"ecr:ListImages" | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment