-
Notifications
You must be signed in to change notification settings - Fork 1
/
mu.yml
193 lines (190 loc) · 5.72 KB
/
mu.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
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
environments:
- name: acceptance
loadbalancer:
hostedzone: bigbluesign.com
certificate: "8c43c2a3-1a25-4552-9ee9-804124d4d1d7"
cluster:
minSize: 2
desiredCapacity: 2
instanceType: t2.medium
service:
name: karma-angular
cpu: 950
memory: 1024
port: 8080
healthEndpoint: /management/health
pathPatterns:
- /*
database:
name: karma
masterUsername: karma
engine: postgres
environment:
SPRING_DATASOURCE_USERNAME: ${DatabaseMasterUsername}
SPRING_DATASOURCE_PASSWORD: ${DatabaseMasterPassword}
SPRING_DATASOURCE_URL: jdbc:postgresql://${DatabaseEndpointAddress}:${DatabaseEndpointPort}/${DatabaseName}
pipeline:
build:
image: aws/codebuild/java:openjdk-8
acceptance:
image: aws/codebuild/java:openjdk-8
production:
disabled: true
notify:
### configure extension for handling CloudFront and static assets
extensions:
- url: https://github.com/stelligent/mu-cloudfront/archive/v0.4.zip
parameters:
mu-loadbalancer-acceptance:
CloudFrontCert: "86a733d7-b890-478b-bc24-4ec0b40ea66d"
mu-pipeline-.*:
SourcePath: karma-angular/build/www
### custom cloudformation for managing the bucket with BDD reports
templates:
mu-pipeline-karma-angular:
Resources:
PipelineFailedEventRule:
Properties:
Targets:
Fn::Splice:
- 0
- 1
- - InputTransformer:
InputTemplate:
Fn::Sub: >
"Pipeline <pipeline> has failed. Test results available at https://s3-${AWS::Region}.amazonaws.com/${CIBucket}/${ServiceName}/index.html. Details available at https://console.aws.amazon.com/codepipeline/home?region=${AWS::Region}#/view/<pipeline>"
PipelineSucceededEventRule:
Properties:
Targets:
Fn::Splice:
- 0
- 1
- - InputTransformer:
InputTemplate:
Fn::Sub: >
"Pipeline <pipeline> has succeeded. Test results available at https://s3-${AWS::Region}.amazonaws.com/${CIBucket}/${ServiceName}/index.html. Details available at https://console.aws.amazon.com/codepipeline/home?region=${AWS::Region}#/view/<pipeline>"
CIBucket:
Type: AWS::S3::Bucket
Properties:
BucketName:
Fn::Sub: stanfield-systems-karma-ci
WebsiteConfiguration:
IndexDocument: index.html
CIBucketPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket:
Ref: CIBucket
PolicyDocument:
Statement:
- Effect: Allow
Principal:
AWS:
Ref: CodeBuildCIRoleArn
Action:
- s3:ListBucket
Resource:
Fn::Sub: arn:aws:s3:::${CIBucket}
- Effect: Allow
Principal:
AWS:
Ref: CodeBuildCIRoleArn
Action:
- s3:GetObject
- s3:PutObject
- s3:DeleteObject
Resource:
Fn::Sub: arn:aws:s3:::${CIBucket}/*
- Effect: Allow
Principal: '*'
Action: s3:GetObject
Resource:
Fn::Sub: arn:aws:s3:::${CIBucket}/*
Condition:
IpAddress:
aws:SourceIp:
- 73.151.106.136/32
- 96.81.182.193/32
- 0.0.0.0/0
'mu-loadbalancer-.*':
Resources:
CloudFrontDist:
Properties:
DistributionConfig:
CacheBehaviors:
- AllowedMethods:
- DELETE
- GET
- HEAD
- OPTIONS
- PATCH
- POST
- PUT
DefaultTTL: 0
ForwardedValues:
QueryString: true
Cookies:
Forward: all
Headers:
- '*'
MaxTTL: 60
MinTTL: 0
PathPattern: /management*
TargetOriginId: ecs-alb
ViewerProtocolPolicy:
Fn::If:
- HasCloudFrontCert
- redirect-to-https
- allow-all
- AllowedMethods:
- DELETE
- GET
- HEAD
- OPTIONS
- PATCH
- POST
- PUT
DefaultTTL: 0
ForwardedValues:
QueryString: true
Cookies:
Forward: all
Headers:
- '*'
MaxTTL: 60
MinTTL: 0
PathPattern: /swagger-resources*
TargetOriginId: ecs-alb
ViewerProtocolPolicy:
Fn::If:
- HasCloudFrontCert
- redirect-to-https
- allow-all
- AllowedMethods:
- DELETE
- GET
- HEAD
- OPTIONS
- PATCH
- POST
- PUT
DefaultTTL: 0
ForwardedValues:
QueryString: true
Cookies:
Forward: all
Headers:
- '*'
MaxTTL: 60
MinTTL: 0
PathPattern: /v2*
TargetOriginId: ecs-alb
ViewerProtocolPolicy:
Fn::If:
- HasCloudFrontCert
- redirect-to-https
- allow-all