-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy path03central-pipeline.yaml
More file actions
194 lines (194 loc) · 6.84 KB
/
03central-pipeline.yaml
File metadata and controls
194 lines (194 loc) · 6.84 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
---
AWSTemplateFormatVersion: '2010-09-09'
Description: Creates a Project Pipeline for the different Branches
Parameters:
Project:
Type: String
Default: serverless
RepoBranch:
Type: String
Default: "master"
Resources:
Pipeline:
Type: AWS::CodePipeline::Pipeline
Properties:
ArtifactStore:
Location: !Sub ${AWS::AccountId}-${Project}-pipeline-artifacts-${AWS::Region}
Type: "S3"
EncryptionKey:
Id:
Fn::ImportValue:
!Sub "${Project}-KMSKeyArn"
Type: KMS
RoleArn:
Fn::ImportValue:
!Sub "${Project}-PipeLineRoleArn"
Name: !Sub ${Project}-Pipeline
Stages:
- Name: Source
Actions:
- Name: App
ActionTypeId:
Category: Source
Owner: AWS
Version: '1'
Provider: CodeCommit
Configuration:
RepositoryName: !Sub ${Project}-ProjectRepo
BranchName: !Ref RepoBranch
OutputArtifacts:
- Name: ccArtifact
RunOrder: 1
- Name: "Build_Templates"
Actions:
- Name: CodeBuild
ActionTypeId:
Category: Build
Owner: AWS
Version: '1'
Provider: CodeBuild
Configuration:
ProjectName: !Sub ${Project}-BuildProject
InputArtifacts:
- Name: ccArtifact
OutputArtifacts:
- Name: BuildArtifact
RunOrder: 1
- Name: Create_Change_Sets_and_Deploy_to_Dev
Actions:
- Name: CreateChangeSet_Dev
ActionTypeId:
Category: Deploy
Owner: AWS
Version: '1'
Provider: CloudFormation
Configuration:
ChangeSetName: cicd-codepipeline-ChangeSet-Dev
ActionMode: CHANGE_SET_REPLACE
StackName: cicd-codepipeline-Dev
Capabilities: CAPABILITY_IAM
ParameterOverrides: |
{
"Environment" : "dev"
}
TemplatePath: BuildArtifact::packaged.yml
RoleArn:
Fn::ImportValue:
!Sub "${Project}-Dev-cloudformationdeployer-role"
InputArtifacts:
- Name: BuildArtifact
RunOrder: 1
RoleArn:
Fn::ImportValue:
!Sub "${Project}-Dev-centralacctcodepipelineCFRole"
- Name: ExecuteChangeSet_Dev
ActionTypeId:
Category: Deploy
Owner: AWS
Provider: CloudFormation
Version: "1"
Configuration:
ActionMode: CHANGE_SET_EXECUTE
RoleArn:
Fn::ImportValue:
!Sub "${Project}-Dev-cloudformationdeployer-role"
StackName: cicd-codepipeline-Dev
ChangeSetName: cicd-codepipeline-ChangeSet-Dev
OutputArtifacts:
- Name: cicd-codepipeline-ChangeSet-Dev
RunOrder: 2
RoleArn:
Fn::ImportValue:
!Sub "${Project}-Dev-centralacctcodepipelineCFRole"
- Name: Create_Change_Sets_and_Deploy_to_Test
Actions:
- Name: CreateChangeSet_Test
ActionTypeId:
Category: Deploy
Owner: AWS
Version: '1'
Provider: CloudFormation
Configuration:
ChangeSetName: cicd-codepipeline-ChangeSet-Test
ActionMode: CHANGE_SET_REPLACE
StackName: cicd-codepipeline-Test
Capabilities: CAPABILITY_IAM
ParameterOverrides: |
{
"Environment" : "test"
}
TemplatePath: BuildArtifact::packaged.yml
RoleArn:
Fn::ImportValue:
!Sub "${Project}-Test-cloudformationdeployer-role"
InputArtifacts:
- Name: BuildArtifact
RunOrder: 1
RoleArn:
Fn::ImportValue:
!Sub "${Project}-Test-centralacctcodepipelineCFRole"
- Name: ExecuteChangeSet_Test
ActionTypeId:
Category: Deploy
Owner: AWS
Provider: CloudFormation
Version: "1"
Configuration:
ActionMode: CHANGE_SET_EXECUTE
RoleArn:
Fn::ImportValue:
!Sub "${Project}-Test-cloudformationdeployer-role"
StackName: cicd-codepipeline-Test
ChangeSetName: cicd-codepipeline-ChangeSet-Test
OutputArtifacts:
- Name: cicd-codepipeline-ChangeSet-Test
RunOrder: 2
RoleArn:
Fn::ImportValue:
!Sub "${Project}-Test-centralacctcodepipelineCFRole"
- Name: Create_Change_Sets_and_Deploy_to_Prod
Actions:
- Name: CreateChangeSet_Prod
ActionTypeId:
Category: Deploy
Owner: AWS
Version: '1'
Provider: CloudFormation
Configuration:
ChangeSetName: cicd-codepipeline-ChangeSet-Prod
ActionMode: CHANGE_SET_REPLACE
StackName: cicd-codepipeline-Prod
Capabilities: CAPABILITY_IAM
ParameterOverrides: |
{
"Environment" : "prod"
}
TemplatePath: BuildArtifact::packaged.yml
RoleArn:
Fn::ImportValue:
!Sub "${Project}-Prod-cloudformationdeployer-role"
InputArtifacts:
- Name: BuildArtifact
RunOrder: 1
RoleArn:
Fn::ImportValue:
!Sub "${Project}-Prod-centralacctcodepipelineCFRole"
- Name: ExecuteChangeSet_Prod
ActionTypeId:
Category: Deploy
Owner: AWS
Provider: CloudFormation
Version: "1"
Configuration:
ActionMode: CHANGE_SET_EXECUTE
RoleArn:
Fn::ImportValue:
!Sub "${Project}-Prod-cloudformationdeployer-role"
StackName: cicd-codepipeline-Prod
ChangeSetName: cicd-codepipeline-ChangeSet-Prod
OutputArtifacts:
- Name: cicd-codepipeline-ChangeSet-Prod
RunOrder: 2
RoleArn:
Fn::ImportValue:
!Sub "${Project}-Prod-centralacctcodepipelineCFRole"