Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit ce634d5

Browse files
authored
Merge pull request #13 from aws-solutions/develop
Merging this PR for v1.5.0
2 parents 26a75ac + 7a25638 commit ce634d5

File tree

118 files changed

+5998
-3196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+5998
-3196
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ assignees: ''
1919
**Please complete the following information about the solution:**
2020
- [ ] Version: [e.g. v1.0.0]
2121

22-
To get the version of the solution, you can look at the description of the created CloudFormation stack. For example, "_(SO0134) - The AWS CloudFormation template for deployment of the AWS Centralized WAF & SG Management. Version **v1.0.0**_". You can also find the version from [releases](https://github.com/awslabs/aws-devops-monitoring-dashboard/releases)
22+
To get the version of the solution, you can look at the description of the created CloudFormation stack. For example, "_(SO0134) - The AWS CloudFormation template for deployment of the AWS DevOps Monitoring Dashboard. Version **v1.0.0**_". You can also find the version from [releases](https://github.com/aws-solutions/aws-devops-monitoring-dashboard/releases)
2323

2424
- [ ] Region: [e.g. us-east-1]
2525
- [ ] Was the solution modified from the version published on this repository?
2626
- [ ] If the answer to the previous question was yes, are the changes available on GitHub?
2727
- [ ] Have you checked your [service quotas](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) for the sevices this solution uses?
28-
- [ ] Were there any errors in the CloudWatch Logs? [How to enable debug mode?](https://github.com/awslabs/aws-devops-monitoring-dashboard/#enable-debug-mode)
28+
- [ ] Were there any errors in the CloudWatch Logs? [How to enable debug mode?](https://github.com/aws-solutions/aws-devops-monitoring-dashboard/#enable-debug-mode)
2929

3030
**Screenshots**
3131
If applicable, add screenshots to help explain your problem (please **DO NOT include sensitive information**).

.gitignore

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Ignore TS compile output
2+
**/*.js
3+
**/*.d.ts
4+
# Exclude required .js files from above ignore rule
5+
!deployment/.typescript/cdk-solution-helper/index.js
6+
!jest.config.js
7+
!source/.typescript/lambda/**/*.js
8+
!source/lambda/**/*.js
9+
!**/cdk-solution-helper/index.js
10+
11+
package-lock.json
12+
node_modules
13+
**/__pycache__/*
14+
*.venv-test/
15+
*_yaml/
16+
17+
# CDK asset staging directory
18+
.cdk.staging
19+
cdk.out
20+
21+
22+
deployment/global-s3-assets
23+
deployment/regional-s3-assets
24+
deployment/temp
25+
open-source/
26+
.DS_Store
27+
deployment/setenv.sh
28+
internal/source/tools/setenv.sh
29+
30+
#nodejs
31+
*dist*
32+
*coverage*
33+
34+
#intellij
35+
/.idea
36+
37+
#SonarQube
38+
.scannerwork/

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.5.0] - 2022-04-19
8+
### Added
9+
- Added GitHub integration - GitHub activity metric for push events
10+
- Added Mean Time to Recovery (MTTR) metric for Code Pipeline
11+
712
## [1.1.0] - 2021-06-16
813
### Added
914
- Metrics visualization for codebuild and codepipeline Events.

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ information to effectively respond to your bug report or contribution.
1111

1212
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
1313

14-
When filing an issue, please check [existing open](https://github.com/awslabs/%%SOLUTION_NAME%%/issues), or [recently closed](https://github.com/awslabs/%%SOLUTION_NAME%%/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
14+
When filing an issue, please check [existing open](https://github.com/aws-solutions/aws-devops-monitoring-dashboard/issues), or [recently closed](https://github.com/aws-solutions/aws-devops-monitoring-dashboard/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
1515
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
1616

1717
* A reproducible test case or series of steps
@@ -42,7 +42,7 @@ GitHub provides additional document on [forking a repository](https://help.githu
4242

4343

4444
## Finding contributions to work on
45-
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/awslabs/%%SOLUTION_NAME%%/labels/help%20wanted) issues is a great place to start.
45+
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/aws-solutions/aws-devops-monitoring-dashboard/labels/help%20wanted) issues is a great place to start.
4646

4747

4848
## Code of Conduct
@@ -57,6 +57,6 @@ If you discover a potential security issue in this project we ask that you notif
5757

5858
## Licensing
5959

60-
See the [LICENSE](https://github.com/awslabs/%%SOLUTION_NAME%%/blob/master/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
60+
See the [LICENSE](https://github.com/aws-solutions/aws-devops-monitoring-dashboard/blob/main/LICENSE.txt) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
6161

6262
We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.

NOTICE.txt

+2-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2-
3-
Licensed under the Apache License, Version 2.0 (the "License").
4-
You may not use this file except in compliance with the License.
5-
A copy of the License is located at
6-
7-
http://www.apache.org/licenses/LICENSE-2.0
8-
9-
or in the "license" file accompanying this file. This file is distributed
10-
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11-
express or implied. See the License for the specific language governing
12-
permissions and lithe Massachusetts Institute of Technology (MIT) licenseations under the License.
1+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
SPDX-License-Identifier: Apache-2.0
133

144
**********************
155
THIRD PARTY COMPONENTS

README.md

+21-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
**[🚀 Solution Landing Page](<https://aws.amazon.com/solutions/implementations/aws-devops-monitoring-dashboard/>)** | **[🚧 Feature request](https://github.com/awslabs/aws-devops-monitoring-dashboard/issues/new?assignees=&labels=feature-request%2C+enhancement&template=feature_request.md&title=)** | **[🐛 Bug Report](https://github.com/awslabs/aws-devops-monitoring-dashboard/issues/new?assignees=&labels=bug%2C+triage&template=bug_report.md&title=)**
1+
**[🚀 Solution Landing Page](<https://aws.amazon.com/solutions/implementations/aws-devops-monitoring-dashboard/>)** | **[🚧 Feature request](https://github.com/aws-solutions/aws-devops-monitoring-dashboard/issues/new?assignees=&labels=feature-request%2C+enhancement&template=feature_request.md&title=)** | **[🐛 Bug Report](https://github.com/aws-solutions/aws-devops-monitoring-dashboard/issues/new?assignees=&labels=bug%2C+triage&template=bug_report.md&title=)**
22

33
Note: If you want to use the solution without building from source, navigate to Solution Landing Page
44

@@ -34,8 +34,8 @@ For a detailed solution implementation guide, refer to Solution Landing Page [AW
3434
<br/>
3535
</p>
3636

37-
1. A developer initiates an activity in an AWS CI/CD pipeline, such as pushing a code change to AWS CodeCommit or deploying an application using AWS CodeDeploy. These activities create events. In addition, activities in AWS CodeBuild generates CloudWatch metrics.
38-
2. An Amazon EventBridge events rule detects the events based on predefined event patterns and then sends the event data to an Amazon Kinesis Data Firehose delivery stream. One event rule is created per event source. For AWS CodeBuild, a CloudWatch metric stream is setup to capture its CloudWatch metrics and deliver it to a Kinese Data Firehose delivery stream.
37+
1. A developer initiates an activity in an AWS CI/CD pipeline, such as pushing a code change to AWS CodeCommit or deploying an application using AWS CodeDeploy. These activities create events. For development using GitHub repository, git push events are generated.
38+
2. An Amazon EventBridge events rule detects the events based on predefined event patterns and then sends the event data to an Amazon Kinesis Data Firehose delivery stream. One event rule is created per event source. For activities in AWS CodeBuild, a CloudWatch metric stream is set up to capture CloudWatch metrics and deliver them to a Kinesis Data Firehose delivery stream. For GitHub push events, an Amazon API endpoint is created to post these events and deliver them to a Kinesis Data Firehose delivery stream.
3939
3. An Amazon EventBridge events rule is also created to capture events from an Amazon CloudWatch alarm that monitors the status of an Amazon CloudWatch synthetics canary, if you have set up the canary and alarm in your account. This alarm is needed to gather data for calculating Mean Time to Recover (MTTR) metrics.
4040
4. Amazon Kinesis Data Firehose uses an AWS Lambda function for data transformation. The Lambda function extracts relevant data to each metric and sends it to an Amazon S3 bucket for downstream processing.
4141
5. An Amazon Athena database queries the Amazon S3 bucket data and returns query results to Amazon QuickSight.
@@ -46,7 +46,11 @@ For a detailed solution implementation guide, refer to Solution Landing Page [AW
4646
# AWS Solutions Constructs
4747
[AWS CDK Solutions Constructs](https://aws.amazon.com/solutions/constructs/) make it easier to consistently create well-architected applications. All AWS Solutions Constructs are reviewed by AWS and use best practices established by the AWS Well-Architected Framework. This solution uses the following AWS CDK Constructs:
4848

49-
- aws-events-rule-kinesisfirehose-s3
49+
- aws-eventbridge-kinesisfirehose-s3
50+
- aws-eventbridge-lambda
51+
- aws-kinesisfirehose-s3
52+
53+
5054

5155
<a name="aws-solutions-constructs"></a><a name="customizing-the-solution"></a>
5256
# Customizing the Solution
@@ -69,12 +73,12 @@ Clone or download the repository to a local directory on your linux client. Note
6973
**Git Clone example:**
7074

7175
```
72-
git clone https://github.com/awslabs/aws-devops-monitoring-dashboard.git
76+
git clone https://github.com/aws-solutions/aws-devops-monitoring-dashboard.git
7377
```
7478

7579
**Download Zip example:**
7680
```
77-
wget https://github.com/awslabs/aws-devops-monitoring-dashboard/archive/master.zip
81+
wget https://github.com/aws-solutions/aws-devops-monitoring-dashboard/archive/master.zip
7882
```
7983

8084
#### 2. Unit test
@@ -90,8 +94,9 @@ chmod +x ./run-unit-tests.sh
9094

9195
AWS Solutions use two buckets:
9296

93-
* One global bucket that is access via the http end point. AWS CloudFormation templates are stored here. Ex. "mybucket"
97+
* One global bucket that is accessed via the http end point. AWS CloudFormation templates are stored here. Ex. "mybucket"
9498
* One regional bucket for each region where you plan to deploy the solution. Use the name of the global bucket as the prefix of the bucket name, and suffixed with the region name. Regional assets such as Lambda code are stored here. Ex. "mybucket-us-east-1"
99+
* Inside this bucket, create a folder named with the same solution name specified below in the environment variables section; and inside that, create another folder named with the same version number specified below. Here is how a sample folder/prefix would look like: "aws-devops-monitoring-dashboard/V1.0.0".
95100
* The assets in buckets must be accessible by your account
96101

97102
#### 4. Declare environment variables
@@ -103,7 +108,7 @@ export AWS_REGION=<AWS_REGION> # region where the solution is deployed
103108
export CF_TEMPLATE_BUCKET_NAME=<YOUR_CF_TEMPLATE_BUCKET_NAME> # Name of the global bucket where CloudFormation templates are stored
104109
export QUICKSIGHT_TEMPLATE_ACCOUNT = <YOUR_QUICKSIGHT_TEMPLATE_ACCOUNT> # The AWS account from which the Amazon QuickSight templates should be sourced for Amazon QuickSight Analysis and Dashboard creation
105110
export DIST_QUICKSIGHT_NAMESPACE = <YOUR_DIST_QUICKSIGHT_NAMESPACE >
106-
# The namesapce in QuickSight account ARN. Ex. "default"
111+
# The namespace in QuickSight account ARN. Ex. "default"
107112
```
108113
#### 5. Build the solution
109114
```
@@ -114,9 +119,8 @@ chmod +x build-s3-dist.sh
114119

115120
<a name="Upload-deployment-assets-to-your-S3-buckets"></a>
116121
## Upload Deployment Assets
117-
* Copy the files `aws-devops-monitoring-dashboard.template` and `canary-alarm.template` in the directory `./deployment/global-s3-assets`, to the bucket with the name referenced to `$DIST_OUTPUT_BUCKET`
118-
* Copy the file with the name format `awsdevopsmonitoringdashboardQSDashboard*.nested.template` in the directory `./deployment/global-s3-assets`, to the bucket with the name referenced to `$CF_TEMPLATE_BUCKET_NAME`
119-
* Copy the lambda distribution files from the folder `./deployment/regional-s3-assets` in to the S3 bucket with the name as `$DIST_OUTPUT_BUCKET-[REGION]`, `[REGION]` is the specific region where the solution is being deployed.
122+
* Copy the cloudformation templates (.template files) from the directory `./deployment/global-s3-assets` into the global S3 bucket with the name referenced to `$CF_TEMPLATE_BUCKET_NAME`.
123+
* Copy the lambda distribution files (.zip files) from the directory `./deployment/regional-s3-assets` into the folder/prefix `$SOLUTION_NAME/$VERSION` in the regional S3 bucket with the name referenced to `$DIST_OUTPUT_BUCKET-[REGION]`. `[REGION]` is the specific region where the solution is being deployed.
120124

121125
<a name="create-quicksight-template"></a>
122126
## Create QuickSight Template
@@ -152,11 +156,14 @@ aws quicksight list-data-sets --aws-account-id your-aws-account-id
152156
{
153157
"DataSetPlaceholder": "code-pipeline-detail",
154158
"DataSetArn": "your-quicksight-code-pipeline-detail-dataset-arn"
155-
}
156-
,
159+
},
157160
{
158161
"DataSetPlaceholder": "code-build-detail",
159162
"DataSetArn": "your-quicksight-code-build-detail-dataset-arn"
163+
},
164+
{
165+
"DataSetPlaceholder": "github-change-activity",
166+
"DataSetArn": "your-quicksight-github-change-activity-dataset-arn"
160167
}
161168
]
162169
}
@@ -232,4 +239,4 @@ This solution collects anonymous operational metrics to help AWS improve the qua
232239
<a name="license"></a>
233240
# License
234241

235-
See license [here](https://github.com/awslabs/aws-devops-monitoring-dashboard/blob/master/LICENSE.txt)
242+
See license [here](https://github.com/aws-solutions/aws-devops-monitoring-dashboard/blob/master/LICENSE.txt)

deployment/build-s3-dist.sh

+6-8
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
[ "$DEBUG" == 'true' ] && set -x
2929
set -e
3030

31-
# Important: CDK global version number
32-
cdk_version=1.98.0
33-
3431
# Check to see if input has been provided:
3532
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] || [ -z "$4" ] || [ -z "$5" ] || [ -z "$6" ]; then
3633
echo "Please provide all required parameters for the build script"
@@ -71,9 +68,9 @@ do_replace() {
7168
# for solution ID, name, and trademarked name
7269
# Ex:
7370
# #!/bin/bash
74-
# SOLUTION_ID='SO0111'
75-
# SOLUTION_NAME='AWS Security Hub Automated Response & Remediation'
76-
# SOLUTION_TRADEMARKEDNAME='aws-security-hub-automated-response-and-remediation'
71+
# SOLUTION_ID='SO0134'
72+
# SOLUTION_NAME='AWS DevOps Monitoring Dashboard'
73+
# SOLUTION_TRADEMARKEDNAME='aws-devops-monitoring-dashboard'
7774
if [[ -e './solution_env.sh' ]]; then
7875
chmod +x ./solution_env.sh
7976
source ./solution_env.sh
@@ -174,8 +171,9 @@ echo "--------------------------------------------------------------------------
174171
echo "[Synth] CDK Project"
175172
echo "------------------------------------------------------------------------------"
176173
cd $temp_work_dir
177-
do_cmd npm install # local install per package.json
178-
do_cmd npm install aws-cdk@$cdk_version
174+
do_cmd npm install
175+
export overrideWarningsEnabled=false
176+
node_modules/aws-cdk/bin/cdk synth --output=$staging_dist_dir
179177
export PATH=$(npm bin):$PATH
180178
do_cmd npm run build
181179

deployment/cdk-solution-helper/index.js

+2-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
/**
2-
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
5-
* with the License. A copy of the License is located at
6-
*
7-
* http://www.apache.org/licenses/LICENSE-2.0
8-
*
9-
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
10-
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
11-
* and limitations under the License.
12-
*/
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
133

144
// Imports
155
const fs = require('fs');

source/bin/aws_devops_monitoring_dashboard.ts

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
#!/usr/bin/env node
2-
/**********************************************************************************************************************
3-
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. *
4-
* *
5-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance *
6-
* with the License. A copy of the License is located at *
7-
* *
8-
* http://www.apache.org/licenses/LICENSE-2.0 *
9-
* *
10-
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES *
11-
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions *
12-
* and limitations under the License. *
13-
*********************************************************************************************************************/
2+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
// SPDX-License-Identifier: Apache-2.0
144

155

166
import 'source-map-support/register';
177
import * as cdk from '@aws-cdk/core';
188
import * as lambda from '@aws-cdk/aws-lambda';
19-
import { CanaryStack } from '../lib/deployment-helper/canary_alarm';
20-
import { DevOpsDashboardStack } from '../lib/aws_devops_monitoring_dashboard_stack';
9+
import {CanaryStack} from '../lib/deployment-helper/canary_alarm/canary_alarm_stack';
10+
import {PipelineAlarmStack} from '../lib/deployment-helper/codepipeline_alarm/codepipeline_alarm_stack';
11+
import {DevOpsDashboardStack} from '../lib/aws_devops_monitoring_dashboard_stack';
2112

2213
// SOLUTION_* - set by solution_env.sh
2314
const SOLUTION_ID = process.env['SOLUTION_ID'] || 'undefined';
@@ -27,6 +18,7 @@ const DIST_VERSION = process.env['DIST_VERSION'] || '%%VERSION%%';
2718
const DIST_OUTPUT_BUCKET = process.env['DIST_OUTPUT_BUCKET'] || '%%BUCKET%%';
2819
const DIST_SOLUTION_NAME = process.env['DIST_SOLUTION_NAME'] || '%%SOLUTION%%';
2920
const LAMBDA_RUNTIME_NODEJS = lambda.Runtime.NODEJS_14_X
21+
const TEMPLATE_FORMAT_VERSIOIN = '2010-09-09'
3022

3123
const app = new cdk.App();
3224

@@ -50,5 +42,13 @@ const devopsDashboardStack = new DevOpsDashboardStack(app, 'aws-devops-monitorin
5042
lambdaRuntimeNode: LAMBDA_RUNTIME_NODEJS
5143
});
5244

53-
devopsDashboardStack.templateOptions.templateFormatVersion = "2010-09-09"
54-
canaryStack.templateOptions.templateFormatVersion = "2010-09-09"
45+
/* Stack for creating codepipeline alarm */
46+
const pipelineAlarmStack = new PipelineAlarmStack(app, 'pipeline-alarm', {
47+
description: `(${SOLUTION_ID}P) ${SOLUTION_NAME} - Create CodePipeline Alarm Template. Version: ${DIST_VERSION}`,
48+
solutionId: SOLUTION_ID,
49+
solutionVersion: DIST_VERSION
50+
})
51+
52+
devopsDashboardStack.templateOptions.templateFormatVersion = TEMPLATE_FORMAT_VERSIOIN
53+
canaryStack.templateOptions.templateFormatVersion = TEMPLATE_FORMAT_VERSIOIN
54+
pipelineAlarmStack.templateOptions.templateFormatVersion = TEMPLATE_FORMAT_VERSIOIN

source/image/architecture_diagram.png

204 KB
Loading

0 commit comments

Comments
 (0)