This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
forked from stelligent/pipeline-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yml
85 lines (84 loc) · 3.12 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
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
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
PermissionsBoundary:
Description: "An optional permissions boundary to apply to all roles"
Type: String
ConstraintDescription: Must match a valid ARN of an IAM policy for the permission boundary
AllowedPattern: "^$|arn:aws:iam::\\d{12}:policy/[a-zA-Z\\-]+$"
Default: ""
Conditions:
HasPermissionBoundary:
!Not [!Equals [!Ref PermissionsBoundary, ""]]
Metadata:
AWS::ServerlessRepo::Application:
Name: mechanicalrock-pipeline-dashboard
Description: "Simple dashboard built for viewing pipeline metrics in AWS. See https://github.com/MechanicalRock/pipeline-dashboard"
Author: Mechanical Rock
SpdxLicenseId: Apache-2.0
LicenseUrl: LICENSE
ReadmeUrl: README.md
Labels: ["metrics", "pipeline", "dora"]
HomePageUrl: https://github.com/MechanicalRock/pipeline-dashboard
SemanticVersion: 1.1.1
SourceCodeUrl: https://github.com/MechanicalRock/pipeline-dashboard
Resources:
PipelineDashboardEventHandler:
Type: "AWS::Serverless::Function"
Properties:
Description: Create CloudWatch metrics from CodePipeline events
Handler: index.handlePipelineEvent
Runtime: nodejs14.x
CodeUri: .
Events:
PipelineEventRule:
Type: EventBridgeRule
Properties:
Pattern:
source:
- "aws.codepipeline"
detail-type:
- "CodePipeline Pipeline Execution State Change"
- "CodePipeline Stage Execution State Change"
- "CodePipeline Action Execution State Change"
PermissionsBoundary: !If [HasPermissionBoundary, !Ref PermissionsBoundary, !Ref AWS::NoValue]
Policies:
- CloudWatchPutMetricPolicy: {}
- CodePipelineReadOnlyPolicy:
PipelineName: !Ref PipelinePattern
PipelineDashboardGenerator:
Type: "AWS::Serverless::Function"
Properties:
Description: Build CloudWatch dashboard from CloudWatch metrics
Handler: index.generateDashboard
Runtime: nodejs14.x
CodeUri: .
Timeout: 60
Events:
DashboardEventRule:
Type: Schedule
Properties:
Schedule: "cron(*/5 * * * ? *)"
PermissionsBoundary: !If [HasPermissionBoundary, !Ref PermissionsBoundary, !Ref AWS::NoValue]
Policies:
- CloudWatchDashboardPolicy: {}
PipelineDashboardTrendGenerator:
Type: "AWS::Serverless::Function"
Properties:
Description: Build CloudWatch Trend dashboard from CloudWatch metrics
Handler: index.generateDashboardTrend
Runtime: nodejs14.x
CodeUri: .
Timeout: 60
Events:
DashboardEventRule:
Type: Schedule
Properties:
Schedule: "cron(*/5 * * * ? *)"
PermissionsBoundary: !If [HasPermissionBoundary, !Ref PermissionsBoundary, !Ref AWS::NoValue]
Policies:
- CloudWatchDashboardPolicy: {}