-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecr.yml
55 lines (53 loc) · 1.59 KB
/
ecr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
AWSTemplateFormatVersion: "2010-09-09"
Description: ECR Resources
Resources:
CodebuildRepository:
Type: AWS::ECR::Repository
Properties:
RepositoryName: aws-learn-devops/codebuild
RepositoryPolicyText:
Version: '2008-10-17'
Statement:
- Sid: CodeBuildAccess
Effect: Allow
Principal:
Service: codebuild.amazonaws.com
Action:
- ecr:GetDownloadUrlForLayer
- ecr:BatchGetImage
- ecr:BatchCheckLayerAvailability
TodobackendRepository:
Type: AWS::ECR::Repository
Properties:
RepositoryName: aws-learn-devops/todobackend
RepositoryPolicyText:
Version: "2008-10-17"
Statement:
- Sid: RemoteAccountAccess
Effect: Allow
Principal:
AWS: arn:aws:iam::500955583076:root
Service: codebuild.amazonaws.com
Action:
- ecr:GetDownloadUrlForLayer
- ecr:BatchGetImage
- ecr:BatchCheckLayerAvailability
LifecyclePolicy:
LifecyclePolicyText: |
{
"rules": [
{
"rulePriority": 10,
"description": "Untagged images",
"selection": {
"tagStatus": "untagged",
"countType": "sinceImagePushed",
"countUnit": "days",
"countNumber": 7
},
"action": {
"type": "expire"
}
}
]
}