Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(ecr-deployment): Native solution for pushing container images to named ECR repositories #31467

Open
2 tasks
athewsey opened this issue Sep 17, 2024 · 3 comments
Open
2 tasks
Labels
@aws-cdk/aws-ecr Related to Amazon Elastic Container Registry feature-request A feature should be added or improved. p2

Comments

@athewsey
Copy link

Describe the feature

A fully-supported, CDK-native way to stage container image assets to named ECR repositories, similar to how s3-deployment supports staging assets to S3.

Use Case

This has been a known gap for some time, and the aws-ecr-assets README still references issue #12597 which was actually accepted by the CDK team but then closed (incorrectly I would argue) without a solution getting rolled in to aws-cdk itself.

There are a range of reasons to want to stage container images defined in CDK stacks to named repositories rather than just the CDK-managed one: Both for philosophical environment tidiness; use-cases where developers need to access the images by name; and for setting up secure IAM permissions (since repository ARNs are name-dependent).

The non-native solutions under CDKLabs have struggled with persistent bugs and lack of maintenance (e.g. cdk-ecr-deployment#478, cdk-ecr-deployment#651, cdk-ecr-deployment#380, cdk-docker-image-deployment#433, etc)

Proposed Solution

A construct or sub-module (aws-ecr-deployment maybe?), maintained within this aws-cdk repository itself, for loading container image assets to named ECR repositories.

Other Information

I would be totally fine if the solution here is to re-open the original issue that's still mentioned on the README and close this one as a duplicate - but right now the docs are directing users to +1 an issue that's already been closed.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.140.0

Environment details (OS name and version, etc.)

macOS

@athewsey athewsey added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Sep 17, 2024
@github-actions github-actions bot added the @aws-cdk/aws-ecr Related to Amazon Elastic Container Registry label Sep 17, 2024
@tmokmss
Copy link
Contributor

tmokmss commented Sep 17, 2024

jfyi there is another non-native solution: ContainerImageBuild.

You can push a container image to any ECR repository with arbitrary image tag:

import { ContainerImageBuild } from 'deploy-time-build';

const image = new ContainerImageBuild(this, 'BuildImage', {
    directory: 'example-image',
    repository: repository,
    tag: 'foo',
});

with additonal configurations such as zstd compression or deploy-time build args injection.

@pahud pahud self-assigned this Sep 17, 2024
@pahud
Copy link
Contributor

pahud commented Sep 17, 2024

Thank you. We recommend https://github.com/cdklabs/cdk-ecr-deployment at this moment.

Your feedback is very important. I'll bring it to the team's attention.

@pahud pahud added the p2 label Sep 17, 2024
@pahud pahud removed their assignment Sep 17, 2024
@pahud pahud removed the needs-triage This issue or PR still needs to be triaged. label Sep 17, 2024
@mrgrain
Copy link
Contributor

mrgrain commented Oct 16, 2024

We would like to support this as part of the regular asset publishing. However this will likely require some major changes how assets are handled. We are committed to delivering this eventually. The help has prioritize, please keep commenting and +1 this issue, and let your contacts at AWS know (if available). The current prioritization plan can be seen here: https://github.com/aws/aws-cdk/blob/main/ROADMAP.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecr Related to Amazon Elastic Container Registry feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

4 participants