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

Add ECR permissions to deployment user #62

Merged
merged 1 commit into from
Apr 5, 2022
Merged

Add ECR permissions to deployment user #62

merged 1 commit into from
Apr 5, 2022

Conversation

bakerkretzmar
Copy link
Contributor

Adds the ecr:GetRepositoryPolicy and ecr:SetRepositoryPolicy permissions to the deployment user that Sidecar creates during setup, so that Sidecar can read and pull container images from ECR without any additional configuration.

The underlying permissions that are required here are actually ecr:BatchGetImage and ecr:GetDownloadUrlForLayer, but they have to be set on the ECR repository itself, not on Lambda. As far as I know there isn't an easy way to do that during setup, or to ensure it'll continue to work on new ECR repositories. If the permissions aren't set on the repository Lambda can actually go and set them—and to do so it needs the two Policy permissions added in this PR.

AWS docs on this: https://docs.aws.amazon.com/lambda/latest/dg/configuration-images.html#configuration-images-permissions.

I tested this by re-configuring Sidecar from scratch, and it works as expected and has no issue using a container image.

Closes #61.

@aarondfrancis
Copy link
Owner

Thank you @bakerkretzmar! I'm not super familiar with ECR so I wouldn't have gotten here myself. I appreciate you running it down.

@aarondfrancis aarondfrancis merged commit 2c9d545 into aarondfrancis:main Apr 5, 2022
@bakerkretzmar bakerkretzmar deleted the ecr-permissions branch April 5, 2022 15:11
@bakerkretzmar
Copy link
Contributor Author

Didn't notice that this broke the tests, will fix in a sec sorry!

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

Successfully merging this pull request may close these issues.

Default deployment user can't read Docker image from ECR
2 participants