aws-ecr-orb icon indicating copy to clipboard operation
aws-ecr-orb copied to clipboard

create-repo fails if ECR repository already exists

Open schmiman opened this issue 2 years ago • 0 comments

Orb version

circleci/[email protected]

What happened

With the create-repo tag, the build fails if the repo already exists.

steps:
  - setup_remote_docker 
  - aws-ecr/build-and-push-image:
      region: ap-southeast-1
      create-repo: true
      assume-web-identity: true
      role-arn: arn:aws:iam::xxxxxx:role/xxxxxx-role
      repo: pdf-service
      repo-scan-on-push: true
      tag: <<parameters.imageTag>>
      skip-when-tags-exist: false

I even tried with deleting the existing repo and let circleCI create it. But even then it fails at the second run.

Expected behavior

Only create the repo if it doesn't exist. If the repot exists, continue and use the existing repo.

schmiman avatar Aug 18 '22 03:08 schmiman