Skip to content

Commit

Permalink
docs(ecs): describe default tag value for fromEcrRepository method (a…
Browse files Browse the repository at this point in the history
…ws#30926)

### Description of changes

If we don't specify the tag parameter for fromEcrRepository method, `latest` is used as default value.
https://github.com/aws/aws-cdk/blob/c8e5924bbc83b91b929838518f4955dd3bbb884f/packages/aws-cdk-lib/aws-ecs/lib/container-image.ts#L19-L24

However, currently this behavior is not described in document.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.ContainerImage.html#static-fromwbrecrwbrrepositoryrepository-tag

I'm adding the description regarding this default value.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
tam0ri authored Jul 27, 2024
1 parent 5f3337f commit f9fd00c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/aws-cdk-lib/aws-ecs/lib/container-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export abstract class ContainerImage {

/**
* Reference an image in an ECR repository
*
* @param tag If you don't specify this parameter, `latest` is used as default.
*/
public static fromEcrRepository(repository: ecr.IRepository, tag: string = 'latest') {
return new EcrImage(repository, tag);
Expand Down

0 comments on commit f9fd00c

Please sign in to comment.