How to allow Bitbucket-Pipelines to pull images from Amazon EC2 container service (ECR)?

3.9k views Asked by At

What I have tried:

  • I can successfully push to Amazon ECR (details in this answer I posted)
  • I am failing to pull the above image in a subsequent pipeline (see example).

Example bitbucket-pipeline.yml

image:
  name: <ecr-registry-address>/<repository>:<tag>
  aws:
    access-key: ${AWS_ACCESS_KEY_ID}
    secret-key: ${AWS_SECRET_ACCESS_KEY}

pipelines:
  default:
    - step:
        script:
          - echo 'Hello World'

The error I get back:

Currently getting this error, not much of an explanation

Finally:

In order to push to the repository, I already setup IAM roles for the bitbucket-pipelines account (AmazonEC2ContainerRegistryPowerUser). Is there any other setup required?

1

There are 1 answers

0
dnk8n On

I found that the cause for the above error was the ${} format. Removing the curly brackets allowed everything to work as expected.

More details here.