Created
October 1, 2016 21:44
-
-
Save labrute974/034729ad1db74ed16dfdb01d507bbb2e to your computer and use it in GitHub Desktop.
cloudformation_ecr_dependency
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: '2010-09-09' | |
Resources: | |
Repository: | |
Type: "AWS::ECR::Repository" | |
Properties: | |
RepositoryPolicyText: | |
Version: "2012-10-17" | |
Statement: | |
- | |
Sid: AllowPushPull | |
Effect: Allow | |
Principal: | |
AWS: | |
- !GetAtt [ "PushRole", "Arn" ] | |
Action: | |
- "ecr:GetDownloadUrlForLayer" | |
- "ecr:BatchGetImage" | |
- "ecr:BatchCheckLayerAvailability" | |
- "ecr:PutImage" | |
- "ecr:InitiateLayerUpload" | |
- "ecr:UploadLayerPart" | |
- "ecr:CompleteLayerUpload" | |
PushRole: | |
Type: "AWS::IAM::Role" | |
Properties: | |
Path: "/application/" | |
RoleName: "registry-push" | |
AssumeRolePolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- | |
Effect: "Allow" | |
Principal: | |
Service: | |
- "ec2.amazonaws.com" | |
Action: | |
- "sts:AssumeRole" | |
Policies: | |
- | |
PolicyName: "ECRPush" | |
PolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- | |
Resource: !Join [ "", [ "arn:aws:ecr:", !Ref "AWS::Region", ":", !Ref "AWS::AccountId", ":repository/", !Ref Repository ] ] | |
Effect: "Allow" | |
Action: | |
- "ecr:BatchDeleteImage" | |
- "ecr:CompleteLayerUpload" | |
- "ecr:InitiateLayerUpload" | |
- "ecr:ListImages" | |
- "ecr:PutImage" | |
- "ecr:UploadLayerPart" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is an invalid CF stack. purposed for a blog post