Aws-ecr: migration guide for v8 to v9?

,

Hi! we’re having a hard time upgrading our orb aws-ecr from v8 to v9, is anyone aware of a simple migration guide? There’s definitely more than just renaming some jobs and properties.

The best we could do still ended with Unable to locate credentials. You can configure credentials by running "aws configure". / Error: Cannot perform an interactive login from a non TTY device

We use this simple job configuration right now which works for v8:

orbs:
  aws-ecr: circleci/aws-ecr@8.2.1
  ...

jobs:
  build-and-push:
    executor:
      name: aws-ecr/default
      use-docker-layer-caching: false
    parameters:
      ...
    steps:
      - aws-ecr/build-and-push-image:
          attach-workspace: true
          dockerfile: << parameters.dockerfile >>
          aws-access-key-id: ECR_AWS_ACCESS_KEY_ID
          aws-secret-access-key: ECR_AWS_SECRET_ACCESS_KEY
          profile-name: myProfileName
          region: '${ECR_AWS_REGION}'
          repo: '<< parameters.repo >>'
          tag: '<< parameters.tag >>'
          extra-build-args: '--build-arg NPM_TOKEN --build-arg DD_VERSION="<< pipeline.git.revision >>"'

Thanks to anyone who can help :pray:

In my case, I migrated from v7 to v9 in this manner. Here are some key points to consider:

  • It’s necessary to use aws-cli/setup for AWS authentication, so make sure to add circleci/aws-cli to orbs.
  • The aws-access-key-id and aws-secret-access-key are automatically fetched from CircleCI’s environment variables, so there’s no need to specify them in aws-cli/setup.
  • Change the name from ‘build-and-push-image’ to ‘build_and_push_image’. Additionally, depending on your environment, there may be other parameters required for 'build_and_push_image
orbs:
  aws-ecr: circleci/aws-ecr@9.0
  aws-cli: circleci/aws-cli@4.1

workflows:
  jobs:
    - aws-ecr/build_and_push_image:
      account_id: ${AWS_ACCOUNT_ID}
      region: ${AWS_DEFAULT_REGION}
      repo: yourECRRepository
      tag: yourECRRepoTag
      auth:
      - aws-cli/setup:
        region: ${AWS_DEFAULT_REGION}