-
Notifications
You must be signed in to change notification settings - Fork 50
/
template-sar.yml
45 lines (45 loc) · 1.62 KB
/
template-sar.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
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: 'Create pipeline-dashboard application.'
Parameters:
PipelinePattern:
Description: 'The pattern of pipeline names to allow access to describe. Recommended value: *'
Type: String
Resources:
PipelineDashboardEventHandler:
Type: 'AWS::Serverless::Function'
Properties:
Description: Create CloudWatch metrics from AWS CodePipeline events
Handler: index.handlePipelineEvent
Runtime: nodejs12.x
CodeUri: s3://pipeline-dashboard-node-0811-us-east-1/2a5aeb4cc9e66058ac7fcd00bd33da64
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: {}
- CodePipelineReadOnlyPolicy:
PipelineName: !Ref PipelinePattern
PipelineDashboardGenerator:
Type: 'AWS::Serverless::Function'
Properties:
Description: Build CloudWatch dashboard from CloudWatch metrics
Handler: index.generateDashboard
Runtime: nodejs12.x
CodeUri: s3://pipeline-dashboard-node-0811-us-east-1/2a5aeb4cc9e66058ac7fcd00bd33da64
Timeout: 60
Events:
DashboardEventRule:
Type: Schedule
Properties:
Schedule: "cron(*/5 * * * ? *)"
Policies:
- CloudWatchDashboardPolicy: {}