-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yml
52 lines (52 loc) · 1.58 KB
/
template.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
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: 'Create pipeline-dashboard application.'
Resources:
PipelineDashboardEventHandler:
Type: 'AWS::Serverless::Function'
Properties:
Description: Create CloudWatch metrics from CodePipeline events
Handler: index.handlePipelineEvent
Runtime: nodejs6.10
CodeUri: .
Events:
PipelineEventRule:
Type: CloudWatchEvent
Properties:
Pattern:
source:
- "aws.codepipeline"
detail-type:
- "CodePipeline Pipeline Execution State Change"
- "CodePipeline Stage Execution State Change"
- "CodePipeline Action Execution State Change"
Policies:
- CloudWatchPutMetricPolicy: {}
- Version: '2012-10-17'
Statement:
- Effect: Allow
Resource: '*'
Action:
- codepipeline:ListPipelineExecutions
PipelineDashboardGenerator:
Type: 'AWS::Serverless::Function'
Properties:
Description: Build CloudWatch dashboard from CloudWatch metrics
Handler: index.generateDashboard
Runtime: nodejs6.10
CodeUri: .
Timeout: 60
Events:
DashboardEventRule:
Type: Schedule
Properties:
Schedule: "cron(*/5 * * * ? *)"
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Resource: '*'
Action:
- cloudwatch:ListMetrics
- cloudwatch:GetDashboard
- cloudwatch:PutDashboard