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

aws-ecr-assets: Readme points to out of date information #27298

Closed
chamsco-aws opened this issue Sep 26, 2023 · 2 comments
Closed

aws-ecr-assets: Readme points to out of date information #27298

chamsco-aws opened this issue Sep 26, 2023 · 2 comments
Labels
@aws-cdk/aws-ecr-assets Related to AWS CDK Docker Image Assets closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. documentation This is a problem with documentation. effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p1 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@chamsco-aws
Copy link

Describe the issue

This section of the README.md directs customers to use cdklabs/cdk-ecr-deployment

## Publishing images to ECR repositories
`DockerImageAsset` is designed for seamless build & consumption of image assets by CDK code deployed to multiple environments
through the CDK CLI or through CI/CD workflows. To that end, the ECR repository behind this construct is controlled by the AWS CDK.
The mechanics of where these images are published and how are intentionally kept as an implementation detail, and the construct
does not support customizations such as specifying the ECR repository name or tags.
If you are looking for a way to _publish_ image assets to an ECR repository in your control, you should consider using
[cdklabs/cdk-ecr-deployment], which is able to replicate an image asset from the CDK-controlled ECR repository to a repository of
your choice.
Here an example from the [cdklabs/cdk-ecr-deployment] project:
```text
// This example available in TypeScript only
import { DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';
import * as ecrdeploy from 'cdk-ecr-deployment';
const image = new DockerImageAsset(this, 'CDKDockerImage', {
directory: path.join(__dirname, 'docker'),
});
new ecrdeploy.ECRDeployment(this, 'DeployDockerImage', {
src: new ecrdeploy.DockerImageName(image.imageUri),
dest: new ecrdeploy.DockerImageName(`${cdk.Aws.ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/test:nginx`),
});
```
⚠️ Please note that this is a 3rd-party construct library and is not officially supported by AWS.
You are welcome to +1 [this GitHub issue](https://github.com/aws/aws-cdk/issues/12597) if you would like to see
native support for this use-case in the AWS CDK.
[cdklabs/cdk-ecr-deployment]: https://github.com/cdklabs/cdk-ecr-deployment

However in this closed issue (ecr-deployment): new aws-ecr-deployment module

Check out cdk-docker-image-deployment, a new library that gives you control of the tags and organization of your Docker image assets.

Right now, it lives in cdklabs and will be maintained by the cdk team, but depending on its popularity we may add it to the core aws-cdk-lib library as well. We are excited to get your feedback and hear what features you would like to see added!

Originally posted by @scanlonp in #12597 (comment)

You direct people to use cdklabs/cdk-docker-image-deployment, I think the documentation needs to be updated to the new preferred package.

Links

## Publishing images to ECR repositories
`DockerImageAsset` is designed for seamless build & consumption of image assets by CDK code deployed to multiple environments
through the CDK CLI or through CI/CD workflows. To that end, the ECR repository behind this construct is controlled by the AWS CDK.
The mechanics of where these images are published and how are intentionally kept as an implementation detail, and the construct
does not support customizations such as specifying the ECR repository name or tags.
If you are looking for a way to _publish_ image assets to an ECR repository in your control, you should consider using
[cdklabs/cdk-ecr-deployment], which is able to replicate an image asset from the CDK-controlled ECR repository to a repository of
your choice.
Here an example from the [cdklabs/cdk-ecr-deployment] project:
```text
// This example available in TypeScript only
import { DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';
import * as ecrdeploy from 'cdk-ecr-deployment';
const image = new DockerImageAsset(this, 'CDKDockerImage', {
directory: path.join(__dirname, 'docker'),
});
new ecrdeploy.ECRDeployment(this, 'DeployDockerImage', {
src: new ecrdeploy.DockerImageName(image.imageUri),
dest: new ecrdeploy.DockerImageName(`${cdk.Aws.ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/test:nginx`),
});
```
⚠️ Please note that this is a 3rd-party construct library and is not officially supported by AWS.
You are welcome to +1 [this GitHub issue](https://github.com/aws/aws-cdk/issues/12597) if you would like to see
native support for this use-case in the AWS CDK.
[cdklabs/cdk-ecr-deployment]: https://github.com/cdklabs/cdk-ecr-deployment

@chamsco-aws chamsco-aws added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Sep 26, 2023
@github-actions github-actions bot added the @aws-cdk/aws-ecr-assets Related to AWS CDK Docker Image Assets label Sep 26, 2023
@peterwoodworth peterwoodworth added p1 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Sep 26, 2023
@peterwoodworth
Copy link
Contributor

If it's still true that the new package isn't working on non-ts languages, we may want to address that first before updating the docs here

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. feature-request A feature should be added or improved. labels Mar 14, 2024
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecr-assets Related to AWS CDK Docker Image Assets closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. documentation This is a problem with documentation. effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p1 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants