Skip to content
Latchkey

aws ecr describe-repositories: Inspect ECR Repos in CI

List ECR repositories and read their registry URIs.

aws ecr describe-repositories returns metadata for ECR repositories, including the repositoryUri used in docker tag/push. In CI it confirms a repo exists before a push, or extracts the URI into a variable so workflows are not hardcoded.

Common flags

  • --repository-names - limit to specific repositories
  • --query "repositories[0].repositoryUri" - extract the push URI
  • --output text - emit plain text for shell capture
  • --region - registry region

Example in CI

Resolve the repository URI to tag an image.

shell
aws ecr describe-repositories --repository-names my-app --query "repositories[0].repositoryUri" --output text

Common errors in CI

  • An error occurred (RepositoryNotFoundException) - repo name does not exist in this region/account
  • An error occurred (AccessDeniedException) - role lacks ecr:DescribeRepositories
  • Unable to locate credentials - configure OIDC role auth

Key takeaways

  • describe-repositories returns repositoryUri for docker tag and push.
  • Use --query to extract the URI instead of hardcoding it in workflows.
  • RepositoryNotFoundException usually means a wrong region or account.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →