-
Notifications
You must be signed in to change notification settings - Fork 175
/
pipeline.temp
102 lines (98 loc) · 3.26 KB
/
pipeline.temp
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# An IAM role that allows the AWS CodePipeline service to perform it's
# necessary actions. We have intentionally left permissions on this role
# that will not be used by the CodePipeline service during this workshop.
# This will allow you to more simply use CodePipeline in the future should
# you want to use the service for Pipelines that interact with different
# AWS services than the ones used in this workshop.
MythicalMysfitsServiceCodePipelineServiceRole:
Type: AWS::IAM::Role
Properties:
RoleName: !Sub CodePipelineServiceRole_${AWS::StackName}
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Principal:
Service:
- codepipeline.amazonaws.com
Action:
- sts:AssumeRole
Path: "/"
Policies:
- PolicyName: MythicalMysfitsService-codepipeline-service-policy
PolicyDocument:
Statement:
- Action:
- codecommit:GetBranch
- codecommit:GetCommit
- codecommit:UploadArchive
- codecommit:GetUploadArchiveStatus
- codecommit:CancelUploadArchive
Resource: "*"
Effect: Allow
- Action:
- s3:GetObject
- s3:GetObjectVersion
- s3:GetBucketVersioning
Resource: "*"
Effect: Allow
- Action:
- s3:PutObject
Resource:
- arn:aws:s3:::*
Effect: Allow
- Action:
- elasticloadbalancing:*
- autoscaling:*
- cloudwatch:*
- ecs:*
- codebuild:*
- iam:PassRole
Resource: "*"
Effect: Allow
Version: "2012-10-17"
# An IAM role that allows the AWS CodeBuild service to perform the actions
# required to complete a build of our source code retrieved from CodeCommit,
# and push the created image to ECR.
MythicalMysfitsServiceCodeBuildServiceRole:
Type: AWS::IAM::Role
Properties:
RoleName: !Sub CodeBuildServiceRole_${AWS::StackName}
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
Effect: Allow
Principal:
Service: codebuild.amazonaws.com
Action: sts:AssumeRole
Policies:
- PolicyName: "MythicalMysfitsService-CodeBuildServicePolicy"
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: "Allow"
Action:
- "codecommit:ListBranches"
- "codecommit:ListRepositories"
- "codecommit:BatchGetRepositories"
- "codecommit:Get*"
- "codecommit:GitPull"
Resource:
- !GetAtt MythicalImageRepository.Arn
- Effect: "Allow"
Action:
- "logs:CreateLogGroup"
- "logs:CreateLogStream"
- "logs:PutLogEvents"
Resource: "*"
- Effect: "Allow"
Action:
- "s3:PutObject"
- "s3:GetObject"
- "s3:GetObjectVersion"
- "s3:ListBucket"
Resource: "*"
- Effect: "Allow"
Action:
- "ecr:InitiateLayerUpload"
- "ecr:GetAuthorizationToken"
Resource: "*"