Skip to content

Commit

Permalink
fix(ecr): allow creating repository uri to use tokens like cfn params (
Browse files Browse the repository at this point in the history
…aws#32053)

### Issue # (if applicable)

Closes aws#31860.

### Reason for this change
Currently customers can pass one property `tagOrDigest` and if the customers pass a CFN parameter, CDK could not know if it is a tag or digest, and so the generated URI is not correct.

Now the same parameter can supports Tokens, and it will generate a CFN condition to check if the value of this token is digest or tag, and then update the uri based on the condition output.


### Description of changes

Check if the input is a Token, and so instead of determining if its value is a tag or digest in synth time, we create a CFN condition to do this check in CFN, and then determine how to build the repo uri.

### Description of how you validated changes

Added unit test cases, and integration test cases with assertions.

### 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
moelasmar authored Nov 8, 2024
1 parent 2323877 commit 5648199
Show file tree
Hide file tree
Showing 22 changed files with 33,923 additions and 52 deletions.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5648199

Please sign in to comment.