Skip to content

Instantly share code, notes, and snippets.

@li0nel
Last active March 26, 2023 05:47
Show Gist options
  • Save li0nel/2d144623170808e642f117533bc101f4 to your computer and use it in GitHub Desktop.
Save li0nel/2d144623170808e642f117533bc101f4 to your computer and use it in GitHub Desktop.
CloudFormation template for ECR
# One Docker registry that we will use both for the Laravel application
# image and our Nginx image.
# Note that if you give a name to the repository, CloudFormation can't
# update it without a full replacement.
ECR:
Type: AWS::ECR::Repository
Properties:
# RepositoryName: !Sub ${AWS::StackName}-nginx
RepositoryPolicyText:
Version: "2012-10-17"
Statement:
-
Sid: AllowPushPull
Effect: Allow
Principal:
AWS:
- !Sub arn:aws:iam::${AWS::AccountId}:role/${ECSRole}
Action:
- "ecr:GetDownloadUrlForLayer"
- "ecr:BatchGetImage"
- "ecr:BatchCheckLayerAvailability"
- "ecr:PutImage"
- "ecr:InitiateLayerUpload"
- "ecr:UploadLayerPart"
- "ecr:CompleteLayerUpload"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment