forked from jenkinsci/amazon-ecs-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudformation-ecr.yaml
50 lines (49 loc) · 1.47 KB
/
cloudformation-ecr.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
AWSTemplateFormatVersion: 2010-09-09
Description: Template for Jenkins Master on Fargate with EFS - ECR repo
Parameters:
ServiceName:
Type: String
Default: ECSJenkins
Resources:
ECRRepository:
Type: AWS::ECR::Repository
Properties:
RepositoryName: jenkins-master
RepositoryPolicyText:
Version: '2008-10-17'
Statement:
- Sid: AllowPush
Effect: Allow
Principal:
AWS:
- !Sub arn:aws:iam::${AWS::AccountId}:root
Action:
- ecr:GetAuthorizationToken
- ecr:GetDownloadUrlForLayer
- ecr:PutImage
- ecr:InitiateLayerUpload
- ecr:UploadLayerPart
- ecr:CompleteLayerUpload
- Sid: AllowPull
Effect: Allow
Principal:
AWS:
- !Sub arn:aws:iam::${AWS::AccountId}:root
Action:
- ecr:GetDownloadUrlForLayer
- ecr:BatchGetImage
- ecr:BatchCheckLayerAvailability
- ecr:GetAuthorizationToken
ECRParam:
Type: AWS::SSM::Parameter
Properties:
Description: Docker repo URI for jenkins master
Name: '/jenkins/docker-uri'
Type: 'String'
Value: !Sub ${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${ECRRepository}
Outputs:
ECRURI:
Description: URI of jenkins master repo
Value: !Sub ${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${ECRRepository}
Export:
Name: !Sub ${ServiceName}-docker-uri