aws / aws/containers-roadmap

[ECR] [Replication]: trigger replication when regions are updated

Open
#1,252 7 comments 90 reactions 0 assignees View on GitHub
ECR Proposed
Dominant language
Shell
Stars
5.4k
Forks
334
PR merge metrics
No merged PRs in 30d

Description

### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

**Tell us about your request**
What do you want us to build?
A trigger that starts replication for newly added regions for "Cross-Region replication".

**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?**
I need that replications start automatically to a region that was just added to the Cross-Region Replication of a registry. Currently, I believe the API is expecting the Cross-Region Replication to be activated (and regions set) prior to the creation and pushing of an image. However, if a new region is added to the same registry, the replication will only occur (for a single repository) if a new image/tag is pushed to a repository. If this cannot be solved, it will impact the deployment of services to new regions.

**Are you currently working around this issue?**
### Original:
~~Currently, the best (easiest) workaround I found is to delete the image (tag) and immediately push it back into the repository. This won't require any actual upload to happen (as the layers will still exist) and will trigger the replication of **only** the image/tag pushed.~~
### Edit 1:
I found a much better way of triggering the replication (it only works for single image tags):
Using the API or SDK of your preference perform a `batch-get-image` to thoroughly describe all image/tags you want to trigger replication. For each image tag, take the `imageManifest` from the `batch-get-image` response and use `put-image` to update the image tag using the same manifest. This shall trigger the replication as if a new image has just been pushed.

### Edit 2:
Actually, the previous approach was pretty hacky as the `imageManifest` needs to be changed (it's a string) somehow - adding or removing a linebreak was enough to trigger everything. The less hacky approach is to delete the image tag before attempting to update it. I'm pretty sure this is still hacky and might bite me back in the future - that's why this request is important.

**Additional context**
It would be nice to have this feature even before the ability to select repositories or images by tag/regex.

Contributor guide

Open the contributing guide

Research direction

No repository files, tests, or implementation entry points are identified. Start by reviewing the ECR cross-region replication behavior described in the issue and the relevant AWS API documentation. Done means adding support for automatically replicating existing images when a registry region is added.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.