• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

securitywing

How to Enable AWS Cross Account ECR Image Replication

by wing

Docker image hosted in ECR in  a AWS account can be replicated into another AWS account by enabling the cross account replication setup. For example, you host a docker image in AWS account A and you have a ECS cluster where you need to deploy the docker image.  

aws cross account ECR repository replication

The steps require to enable cross account replication are:

1.Settings in the ECR host account:

  • Enable cross account replication by specying the destination account name and region.

 

2.Settings in the replicaiton account

  • Add a JSON permission policy with “CreateRepository” and “ReplicaiteImage” action. Also, specify the the ECR host repository ARN.

 

ECR host account settings

Click on the ECR registry

aws ecr registry

 

                             Select the private registry.

 

ECR replication account settings:

Go to the ECR registry and then select private and click on “Permissions”.

Next, add the below JSON policy. You need to replace the account ID in the Principal section by the account ID of your AWS ECR host account ID. In the “Resource” section of the policy you need to specify the account ID of the replicaiton account and replace repositoyr name “myrepo” by you reposityr name that is in the ECR host acount.

{
  "Sid": "replication-id",
  "Effect": "Allow",
  "Principal": {
    "AWS": "arn:aws:iam::xxxxxxxxxxx1:root"
  },
  "Action": [
    "ecr:CreateRepository",
    "ecr:ReplicateImage"
  ],
  "Resource": "arn:aws:ecr:eu-west-1:xxxxxxxxxxx2:repository/myrepo"
}

Finally, push a docker image in the account A, and you will in the Account B a new ECR repository with the exact  same name of the account B.

Related posts:

  1. How to Install Boto3 for AWS SDK using Anaconda in Windows
  2. How to Resolve Route 53 Privated Hosted zone from a VPC in a different AWS account
  3. How to Install AWS CLI and Terraform in Jenkins Docker Container
  4. Top 10 Actions to Prevent Cyber Defence Evasion on AWS Cloud

Filed Under: AWS Tagged With: AWS, ecr

Primary Sidebar

Please help us sharing

Categories

  • AWS
  • Basics
  • Containers
  • Cryptocurrency
  • Cyber
  • Internet Security and Safety
  • IS Audit
  • IT Security Exams
  • Law & Human Rights
  • Network Security Tips
  • Off Track
  • Social Media Governance
  • Tech Comparisons
  • Tech Stack Suitability
  • Telecom
  • Tutorial

CISSP Sample Test

Take a CISSP Sample Test

CISA Sample Test

CISA IT governance Sample test

Please Follow Us

Contact us for Ads

Go to Contact Form

Search

Footer

Copyrights

Protected by Copyscape Duplicate Content Detection Software

Securitywing.com reserves the copyrights of all of its published articles.No contents of this site is permitted to be published to anywhere else in the Internet.If any contents are found in any other websites, securitywing reserves the rights to file a DMCA complaint. But you have the right to use the link of any relevant article of this site to point from your website if you consider that it might improve the quality of your article.

Tags

audit AWS backup basics browser check cisco cloud computer configuration cyber data database email gmail hsrp ids iis informaiton internet kubernetes linux load balancing malware microsoft network protection redundancy risk router security security tips server social media SSL switch test tools vpn vrrp web webserver website windows wordpress

Copyright © 2010-2025 ·All Rights Reserved · SecurityWing.com