[ECR] [request]: Cross Region Replication for Repositories
Tell us about your request Cross region replication for images and tags in ECR Repositories
Which service(s) is this request for? ECR
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? We have containers deployed in multiple regions. We would like to rely on AWS to replicate the containers across regions, just like we do for S3 Objects in an S3 Bucket.
With this feature - we will easily be able to use AWS PrivateLink for ECR in each region we run containers in VPCs without internet access.
In the absence of this feature, we can build our own solution to copy images to multiple regions with each build or pay the costs (per GB and latency) involved in pulling images from a single region to another. This will also remove a single point of failure, ECR in a single region, from our current setup.
Are you currently working around this issue? Currently pulling from a single region.
This would be an amazing feature. I have been trying to build a Pipeline with cross-region deploy and ECR has been a stopper for me. It's a bit annoying to get ECR on all desired region and have just one (the pipeline region) pushing to all regions before running a cross region deploy.
@RyPeck is part of a team in my organization that we provide infrastructure/container services for. This would be a very useful feature.
Cross region replication for images and tags in ECR Repositories
Yes or what would be even better is just a global ECR option. i.e. ecr.aws/my-org/my-image. And this would be transparently replicated in the same way a CDN is. This is how Google's GCR does it and it's much simpler.
Defiantly want to see thing getting worked on soon.
ECR is a single point of failure in the ECS design. ideally a global endpoint where the images are pulled and pushed from but are cached at region level ECS / EKS / Fargate that are the closed to you with the ability to pull from different regions if there are any timeout issues ect.
we are using azure container registry just now as it has the feature.
Thanks for your input, everyone. Before I joined AWS, I worked on a team that had to build cross region replication on top of ECR, too!
I'm going to leave this as Proposed only because it's not on the top of our priority list yet. In the meantime, it would be useful to hear more about what folks want:
- When do you want to replicate an image? Is it sufficient to replicate all images, or do you want some control over which images are replicated?
- Do you want to replicate across accounts?
- What are the primary problems you're trying to solve with cross region replication? For example, you might be trying to speed up image pulls, reduce your data transfer bill, build another region for disaster recovery, etc.
- How much control do you really want to have over referring to an image? Today, ECR includes a "region" part in the registry URL: https://aws_account_id.dkr.ecr.region.amazonaws.com. Let's say we remove the region. Do you want DNS control over where this URL points to, or do you want ECR to figure out the best way to serve the request (knowing that this can have cost and performance implications)?
Primarily speeding up image pulls of sometimes multi-gb sized images in ECS (and AWS Batch), half-way around the world.
(ECR as a pull-through cache would be nice!)
You people just made me realise I don't need this to achieve what I want. I have been using a constant to set the image of the Task Definition for so long I didn't notice I could use only one ECR across all regions. Yeah it will make Fargate download slower but for my use case that's not a big deal.
With that in mind, I think the best option for me would be if I could choose to not have region on the ECR address and Amazon would load the nearest available from a static link. Like putting Cloudfront in front of ECR. I wonder if that's possible without making my images public.
Hi @jtoberon,
My need for multi Region Replication is mainly for Disaster Recovery. Ideally we would remove the region from the registry URL and let ECR figure out the best way to serve the request.
@jtoberon
- Our ideal situation would be to have replication happen at layer creation (and synchronization might be a better word since we'd like removals to happen with a single delete as well).
- Cross account replication would be something we would likely use if available, but isn't a requirement for us today.
- The two problems we'd be looking to solve are DR and locality (cost and speed) for multi-region deployments.
- A single global name to represent a repository would be ideal and let ECR figure out the best location to serve the image up from. Most of our traffic is from ECR to ECS, but this would simplify configuration but (hopefully) still add a bit of resiliencey in the event of a regional ECR outage.
@jtoberon
- For my project's use case it would be sufficient to replicate all images.
- My project's use case does not require replicating across accounts.
- Many of the above reasons are applicable - speed up image pulls, reduce your data transfer bill, etc. My project uses active-active datacenters in multiple regions, but currently only pulls from and pushes to one "main" ecr region.
- Having ECR figure out the best way to serve the request would be ideal in active-active architectures, where if one ECR region goes down, ECR can simply figure out where to pull from. DNS control would also be nice in this scenario, but I'm not sure both are possible at the same time.
@jtoberon
- Yes cross region would be a must
- Cross account is also a problem that we are facing
- When do you want to replicate an image? Is it sufficient to replicate all images, or do you want some control over which images are replicated?
When I push. I want to replicate all images.
- Do you want to replicate across accounts?
Possibly. Having cross account permissions work for replicated images would be a requirement.
- What are the primary problems you're trying to solve with cross region replication? For example, you might be trying to speed up image pulls, reduce your data transfer bill, build another region for disaster recovery, etc.
Cross region image pulls is the primary motivator which will reduce the data transfer bill and speed up image pulls.
- How much control do you really want to have over referring to an image? Today, ECR includes a "region" part in the registry URL: https://aws_account_id.dkr.ecr.region.amazonaws.com. Let's say we remove the region. Do you want DNS control over where this URL points to, or do you want ECR to figure out the best way to serve the request (knowing that this can have cost and performance implications)?
Including a "region" part of the registry URL seems acceptable. This feel similar to spinning up S3 Buckets in a different region and setting up replication.
- When do you want to replicate an image? Is it sufficient to replicate all images, or do you want some control over which images are replicated?
Replication at the repository level would be more than sufficient.
- Do you want to replicate across accounts?
Yes, unfortunately ECR is currently too limited due to IAM permissions not being granular enough to cover image/tags. As such, we cannot prevent images from being pulled from ECR if an individual image had a vulnerability or had not been marked as scanned. See use cases in #230
- What are the primary problems you're trying to solve with cross region replication? For example, you might be trying to speed up image pulls, reduce your data transfer bill, build another region for disaster recovery, etc.
DR and isolation between regions. Vulnerability scanning and pulling images.
- How much control do you really want to have over referring to an image? Today, ECR includes a "region" part in the registry URL: https://aws_account_id.dkr.ecr.region.amazonaws.com. Let's say we remove the region. Do you want DNS control over where this URL points to, or do you want ECR to figure out the best way to serve the request (knowing that this can have cost and performance implications)?
- A generic endpoint that is globally distributed and points to nearest AWS owned POP/region.
- VPC endpoints to ECR with the same generic endpoint. DNS ideally the same except points to Interface. The VPC endpoint to support a policy.
@jtoberon For my project:
- Replicate on push, I prefer to mark a repository for replication (starting with all images would be fine)
- no need to replicate across accounts, I m using one account for images, and other multiple accounts pull the images, I need that the repository permissions will also be replicated (repository metadata)
- I m using vpc-endpoints, and I don't want my Fargate cluster to go public.
- Yes, I prefer, like other vpc-endpoints interfaces, that you will do private-dns for it. Thank you. IP
We are looking at ECR cross-account cross-region replication for DR. I am sure most of the ECS users are building it in house for redundancy in case of Region failures or for DR.
For our use-case we only need cross-region replication for the same account only to regions we can control. The main use-cases would be to speed up image pulls, have further redundancy and especially to reduce our data transfer bill.
@jtoberon
We're also very much interested in a Replication solution.
Our current design, we are implementing now, will be as described below.
We have an "CICD" AWS Account, where we build and push our dev builds to ECR repositories. A release consist of promoting (copying) the relevant images to repositories in a separate "Release" AWS Account. We define these repositories as "master" repos (for releases and dev builds).
Multiple AWS Accounts (DTAP) exist where we run our clusters, they define the same repositories ("slave" repos in this case) for each region we are active in. For instance; Production runs in 7 regions. We will implement a pull system that will check for the existence of the requested image version in the region slave ECR. If it is not found we pull the image from the relevant master repo to the slave repo.
Production, acceptance and test will only pull images from the Releases master, while our Development clusters will pull from both master sources.
Which brings us to your questions.
When do you want to replicate an image? Is it sufficient to replicate all images, or do you want some control over which images are replicated?
Ideally we want to define multiple master repositories for a slave repo. Replication only occurs when an image is not present and we do not need to control which images are replicated. It would be nice to have an ordering in place which source repo to query first for missing versions (release master > development master).
As such, the slave repos work as a caching proxy to one or more master repos.
Do you want to replicate across accounts? Yes, we have multiple accounts as described.
What are the primary problems you're trying to solve with cross region replication? For example, you might be trying to speed up image pulls, reduce your data transfer bill, build another region for disaster recovery, etc. All of the above!
How much control do you really want to have over referring to an image? Today, ECR includes a "region" part in the registry URL: https://aws_account_id.dkr.ecr.region.amazonaws.com. Let's say we remove the region. Do you want DNS control over where this URL points to, or do you want ECR to figure out the best way to serve the request (knowing that this can have cost and performance implications)? I think region can be dropped, but even with region still present I think we can manage.
@jtoberon
This feature is highly desirable for my use-case. Pushing to multiple regions at once is our current workaround, but it can significantly increase the time taken for our deployment pipeline to run.
@jtoberon
- Yes cross region would be a must
- Cross account is also a problem that we are facing
I will clarify my comment from above.
- Still valid
- We would like to have cross account replication because we are currently pushing our images to a single ECR in 1 of our account and we are pulling those images from other accounts/regions.
- Mostly image pull speed, data transfer bills
- Removing the region from the DNS is a must for us as we use a single ECR for all images. I do not know if that would be possible be removing the account from the DNS would be nice as user do not care about which account it sits in.
We decided to use that model to speed up our CI/CD pipeline. Pushing in a single ECR makes a log of sense IMHO. We are also using tags to promote images from dev to prod so no need to copy images to an other registry for every environment. The caveat of the is transfer cost and slow pull when say we push in ca-central-1 and pull from eu-central-1.
I think we can summarise everything in this issue with one simple request: please just copy Google Cloud Container Registry 😃