-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathregistry.yaml
60 lines (55 loc) · 1.46 KB
/
registry.yaml
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
56
57
58
59
60
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Docker Registry
Parameters:
Stage:
Type: String
Default: 'dev'
AllowedValues:
- dev
- stage
- prod
Project:
Type: String
Default: 'docker-registry-example'
User:
Type: String
Resources:
ImageRepository:
Type: AWS::ECR::Repository
Properties:
RepositoryName: !Sub '${Project}-ecr-registry-${Stage}'
RepositoryPolicyText:
Version: "2012-10-17"
Statement:
-
Sid: AllowPushPull
Effect: Allow
Principal:
AWS:
- !Sub "arn:aws:iam::${AWS::AccountId}:user/${User}"
Action:
- "ecr:GetDownloadUrlForLayer"
- "ecr:BatchGetImage"
- "ecr:BatchCheckLayerAvailability"
- "ecr:PutImage"
- "ecr:InitiateLayerUpload"
- "ecr:UploadLayerPart"
- "ecr:CompleteLayerUpload"
ImageTagMutability: MUTABLE
LambdaDockerBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Sub "${Project}-${Stage}-${AWS::AccountId}"
Tags:
- Key: "stage"
Value: !Ref Stage
- Key: "project"
Value: !Ref Project
Outputs:
RepositoryName:
Description: 'Ecr Registry name'
Value: !Ref ImageRepository
BucketName:
Description: 'Bucket to store artifacts'
Value: !Ref LambdaDockerBucket