Add ECR permissions to deployment user #62
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds the
ecr:GetRepositoryPolicy
andecr: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
andecr: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.