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

feat(ecr): lookup existing repository #33662

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
add validation
  • Loading branch information
badmintoncryer committed Mar 1, 2025
commit 121fd15c00ab277717653d1820d475c4c77920ff
4 changes: 4 additions & 0 deletions packages/aws-cdk-lib/aws-ecr/lib/repository.ts
Original file line number Diff line number Diff line change
@@ -633,6 +633,10 @@ export class Repository extends RepositoryBase {
throw new Error('Cannot look up a repository with a tokenized name or ARN.');
}

if (!options.repositoryArn && !options.repositoryName) {
throw new Error('At least one of `repositoryName` or `repositoryArn` must be provided.');
}

const response: {[key: string]: any}[] = ContextProvider.getValue(scope, {
provider: cxschema.ContextProvider.CC_API_PROVIDER,
props: {