Failing to register task definitiion due to Private repository credentials are not a supported authentication method for ECR

Viewed 1944

I have a docker image that contains multiple containers, one of which is hosted on a private repo on docker hub. I am trying to deploy my image onto ECS, after hosting the image on ECR, but I am receiving the error:

Private repository credentials are not a supported authentication method for ECR

I have successfully authenticated with AWS.

  deploy:
    needs: build
    runs-on: ubuntu-latest
    env:
      AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
      AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      GIT_URL_INSTEAD_OF: "https://github.com/=git@github.com:"
      FORCE_COLOR: 1
      ECR_REGION: us-east-1
      ECS_REGION: us-east-2
    steps:

    - name: Download Task Definition
      id: download-artifact
      uses: actions/download-artifact@v2
      with:
        name: task-definition

    - name: Configure AWS Credentials
      id: aws-login
      uses: aws-actions/configure-aws-credentials@v1
      with:
        aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
        aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        aws-region: us-east-1

    - name: Rename task definition
      run: mv task-definition* task-definition.json

    - name: Login to ECR
      uses: aws-actions/amazon-ecr-login@v1

    - name: Deploy
      uses: aws-actions/amazon-ecs-deploy-task-definition@v1
      timeout-minutes: 10
      with:
        task-definition: task-definition.json
        service: glean-payments-dev
        cluster: fargate
        wait-for-service-stability: true

The AWS Documentation seems to indicate that it should use the IAM role that I am authenticating with to pull from ECR which is why I'm confused as to why it's attempting to get the image with private repository credentials.

0 Answers
Related