Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push to ECR ignoring provided AWS creds, assuming IAM role instead #291

Open
christopher-wong opened this issue Apr 3, 2020 · 1 comment

Comments

@christopher-wong
Copy link

christopher-wong commented Apr 3, 2020

I have Concourse setup in an Amazon EKS (k8s) cluster. The cluster has an IAM role that provides it to access a restricted set of resources needed to maintain the cluster.

Concourse is additionally seeded with a specific Concourse IAM user (via secret_access_key and access_key_id) that has access to ECR.

When I use that IAM user to push to ECR, I get a denied and not authorized to perform error. Weirdly, the role the error message references is the assumed IAM role of the cluster, and not the Concourse user of the secret_access_key and access_key_id that I passed to the docker-image resource.

My resource configuration:

  - name: ecr-docker-reg
    type: docker-image
    source:
      access_key_id: ((aws-access-key-id-dev))
      secret_access_key: ((aws-secret-access-key-dev))
      repository: <ECR_REPO_URL_HERE>

I get the following output:

Successfully tagged <IMAGE_NAME>
18:13:35
The push refers to repository [<ECR_REPO_URL_HERE]
18:13:35
82dcad63e746: Preparing
18:13:35
a4c502aa9e69: Preparing
18:13:35
8137f1ad3edc: Preparing
18:13:35
beee9f30bc1f: Preparing
18:13:35
beee9f30bc1f: Waiting
18:13:35
denied: User: arn:aws:sts::<some-assumed-cluster-role> is not authorized to perform: ecr:InitiateLayerUpload on resource: arn:aws:ecr:us-west-2:<ECR_REPO_URL>
@christopher-wong christopher-wong changed the title Permission issues when pushing to AWS ECR docker-image resource not using provided AWS creds, assuming IAM role instead Apr 6, 2020
@christopher-wong christopher-wong changed the title docker-image resource not using provided AWS creds, assuming IAM role instead Push to ECR ignoring provided AWS creds, assuming IAM role instead Apr 6, 2020
@xtremerui
Copy link
Contributor

For a better experience with ECR, have you tried registry-image-resource that also support ECR?

Refer to #199 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants