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

Commit 6948da2

Browse files
authored
Updated to version v1.8.0 (#15)
Updated to version v1.8.0
1 parent ce634d5 commit 6948da2

File tree

155 files changed

+21457
-6242
lines changed

Some content is hidden

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

155 files changed

+21457
-6242
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
4+
title: ""
55
labels: bug
6-
assignees: ''
7-
6+
assignees: ""
87
---
98

109
**Describe the bug**
10+
1111
<!--- A clear and concise description of what the bug is -->
1212

1313
**To Reproduce**
14+
1415
<!--- Steps to reproduce the behavior -->
1516

1617
**Expected behavior**
18+
1719
<!--- A clear and concise description of what you expected to happen -->
1820

1921
**Please complete the following information about the solution:**
22+
2023
- [ ] Version: [e.g. v1.0.0]
2124

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)
25+
To get the version of the solution, you can look at the description of the created CloudFormation stack. For example, "_(SO0143) - The AWS CloudFormation template for deployment of the DevOps Monitoring Dashboard on AWS. Version **v1.0.0**_". You can also find the version from [releases](https://github.com/aws-solutions/aws-devops-monitoring-dashboard/releases)
2326

2427
- [ ] Region: [e.g. us-east-1]
2528
- [ ] Was the solution modified from the version published on this repository?
2629
- [ ] If the answer to the previous question was yes, are the changes available on GitHub?
27-
- [ ] Have you checked your [service quotas](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) for the sevices this solution uses?
30+
- [ ] Have you checked your [service quotas](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) for the services this solution uses?
2831
- [ ] 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)
2932

3033
**Screenshots**

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ 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.8.0] - 2022-10-31
8+
### Added
9+
- Added multi-account multi-region data ingestion
10+
- Added tag filter for AWS CodeCommit, CodeBuild and CodePipeline
11+
712
## [1.5.0] - 2022-04-19
813
### Added
914
- Added GitHub integration - GitHub activity metric for push events
10-
- Added Mean Time to Recovery (MTTR) metric for Code Pipeline
15+
- Added Mean Time to Recovery (MTTR) metric for Code Pipeline
1116

1217
## [1.1.0] - 2021-06-16
1318
### Added

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ reported the issue. Please try to include as much information as you can. Detail
2323
## Contributing via Pull Requests
2424
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
2525

26-
1. You are working against the latest source on the *master* branch.
26+
1. You are working against the latest source on the *main* branch.
2727
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
2828
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
2929

README.md

+70-35
Large diffs are not rendered by default.

deployment/build-s3-dist.sh

+13-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ do_replace() {
6969
# Ex:
7070
# #!/bin/bash
7171
# SOLUTION_ID='SO0134'
72-
# SOLUTION_NAME='AWS DevOps Monitoring Dashboard'
72+
# SOLUTION_NAME='DevOps Monitoring Dashboard on AWS'
7373
# SOLUTION_TRADEMARKEDNAME='aws-devops-monitoring-dashboard'
7474
if [[ -e './solution_env.sh' ]]; then
7575
chmod +x ./solution_env.sh
@@ -158,9 +158,19 @@ for folder in */ ; do
158158
done
159159

160160
if [ -e "requirements.txt" ]; then
161-
pip3 install -q -r requirements.txt --upgrade --target ./
161+
echo "Installing python lambda using virtual environment"
162+
python3 -m venv .venv-test
163+
echo "Activating virtual environment"
164+
source .venv-test/bin/activate
165+
echo "Executing pip3 install -q -r requirements.txt --upgrade --target ./"
166+
python3 -m pip install -q -r requirements.txt --upgrade --target ./
167+
echo "Deactivating virtual environment"
168+
deactivate
169+
echo "Deleting python virtual environment"
170+
rm -fr .venv-test
162171
elif [ -e "package.json" ]; then
163-
# do_cmd npm ci --only=prod
172+
echo "Installing node dependencies"
173+
echo "Executing do_cmd npm install --production"
164174
do_cmd npm install --production
165175
fi
166176

deployment/cdk-solution-helper/README.md

+44-65
Original file line numberDiff line numberDiff line change
@@ -15,85 +15,61 @@ used by the AWS Solutions publishing pipeline.
1515
These placeholders are then replaced with the appropriate values using the default find/replace operation run by the pipeline.
1616

1717
Before:
18+
1819
```
1920
"examplefunction67F55935": {
20-
"Type": "AWS::Lambda::Function",
21-
"Properties": {
22-
"Code": {
23-
"S3Bucket": {
24-
"Ref": "AssetParametersd513e93e266931de36e1c7e79c27b196f84ab928fce63d364d9152ca501551f7S3Bucket54E71A95"
25-
},
26-
"S3Key": {
27-
"Fn::Join": [
28-
"",
29-
[
30-
{
31-
"Fn::Select": [
32-
0,
33-
{
34-
"Fn::Split": [
35-
"||",
36-
{
37-
"Ref": "AssetParametersd513e93e266931de36e1c7e79c27b196f84ab928fce63d364d9152ca501551f7S3VersionKeyC789D8B1"
38-
}
39-
]
40-
}
41-
]
42-
},
43-
{
44-
"Fn::Select": [
45-
1,
46-
{
47-
"Fn::Split": [
48-
"||",
49-
{
50-
"Ref": "AssetParametersd513e93e266931de36e1c7e79c27b196f84ab928fce63d364d9152ca501551f7S3VersionKeyC789D8B1"
51-
}
52-
]
53-
}
54-
]
55-
}
56-
]
57-
]
58-
}
59-
}, ...
60-
Handler: "index.handler", ...
21+
"Type": "AWS::Lambda::Function",
22+
"Properties": {
23+
"Code": {
24+
"S3Bucket": {
25+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
26+
},
27+
"S3Key": "5efbeaf6fad70c6f155399d9bb43debfa8efd4a4c9b5e055a103fe7b12754e76.zip"
28+
},
29+
"Handler": "index.handler",
30+
"Runtime": "nodejs16.x"
31+
},
32+
...
33+
}
6134
```
6235

6336
After helper function run:
37+
6438
```
6539
"examplefunction67F55935": {
66-
"Type": "AWS::Lambda::Function",
67-
"Properties": {
68-
"Code": {
69-
"S3Bucket": "%%BUCKET_NAME%%",
70-
"S3Key": "%%SOLUTION_NAME%%/%%VERSION%%/assetd513e93e266931de36e1c7e79c27b196f84ab928fce63d364d9152ca501551f7.zip"
71-
}, ...
72-
"Handler": "assetd513e93e266931de36e1c7e79c27b196f84ab928fce63d364d9152ca501551f7/index.handler"
40+
"Type": "AWS::Lambda::Function",
41+
"Properties": {
42+
"Code": {
43+
"S3Bucket": "%%BUCKET_NAME%%",
44+
"S3Key": "%%SOLUTION_NAME%%/%%VERSION%%/assetd513e93e266931de36e1c7e79c27b196f84ab928fce63d364d9152ca501551f7.zip"
45+
}, ...
46+
"Handler": "index.handler"
7347
```
7448

7549
After build script run:
50+
7651
```
7752
"examplefunction67F55935": {
78-
"Type": "AWS::Lambda::Function",
79-
"Properties": {
80-
"Code": {
81-
"S3Bucket": "solutions",
82-
"S3Key": "trademarked-solution-name/v1.0.0/asset.d513e93e266931de36e1c7e79c27b196f84ab928fce63d364d9152ca501551f7.zip"
83-
}, ...
84-
"Handler": "assetd513e93e266931de36e1c7e79c27b196f84ab928fce63d364d9152ca501551f7/index.handler"
53+
"Type": "AWS::Lambda::Function",
54+
"Properties": {
55+
"Code": {
56+
"S3Bucket": "solutions",
57+
"S3Key": "trademarked-solution-name/v1.0.0/assetd513e93e266931de36e1c7e79c27b196f84ab928fce63d364d9152ca501551f7.zip"
58+
}, ...
59+
"Handler": "index.handler"
8560
```
8661

8762
After CloudFormation deployment:
63+
8864
```
8965
"examplefunction67F55935": {
90-
"Type": "AWS::Lambda::Function",
91-
"Properties": {
92-
"Code": {
93-
"S3Bucket": "solutions-us-east-1",
94-
"S3Key": "trademarked-solution-name/v1.0.0/asset.d513e93e266931de36e1c7e79c27b196f84ab928fce63d364d9152ca501551f7.zip"
95-
}, ...
96-
"Handler": "assetd513e93e266931de36e1c7e79c27b196f84ab928fce63d364d9152ca501551f7/index.handler"
66+
"Type": "AWS::Lambda::Function",
67+
"Properties": {
68+
"Code": {
69+
"S3Bucket": "solutions-us-east-1",
70+
"S3Key": "trademarked-solution-name/v1.0.0/assetd513e93e266931de36e1c7e79c27b196f84ab928fce63d364d9152ca501551f7.zip"
71+
}, ...
72+
"Handler": "index.handler"
9773
```
9874

9975
#### Template cleanup
@@ -103,6 +79,7 @@ been used to specify Lambda source code properties. This allows solution-specifi
10379
removes unnecessary clutter.
10480

10581
Before:
82+
10683
```
10784
"Parameters": {
10885
"AssetParametersd513e93e266931de36e1c7e79c27b196f84ab928fce63d364d9152ca501551f7S3Bucket54E71A95": {
@@ -129,9 +106,10 @@ Before:
129106
"Type" : "String"
130107
}
131108
}
132-
```
109+
```
133110

134111
After:
112+
135113
```
136114
"Parameters": {
137115
"CorsEnabled" : {
@@ -146,7 +124,8 @@ After:
146124
"Type" : "String"
147125
}
148126
}
149-
```
127+
```
128+
129+
---
150130

151-
***
152131
&copy; Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

deployment/cdk-solution-helper/index.js

+42-33
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ const fs = require('fs');
77
// Paths
88
const global_s3_assets = '../global-s3-assets';
99

10+
//this regular express also takes into account lambda functions defined in nested stacks
11+
const _regex = /[\w]*AssetParameters/g;
12+
1013
// For each template in global_s3_assets ...
1114
fs.readdirSync(global_s3_assets).forEach(file => {
1215
// Import and parse template file
@@ -16,28 +19,50 @@ fs.readdirSync(global_s3_assets).forEach(file => {
1619
// Clean-up Lambda function code dependencies
1720
const resources = (template.Resources) ? template.Resources : {};
1821
const lambdaFunctions = Object.keys(resources).filter(function (key) {
19-
return resources[key].Type === 'AWS::Lambda::Function';
22+
return (resources[key].Type === 'AWS::Lambda::Function');
2023
});
2124

2225
lambdaFunctions.forEach(function (f) {
2326
const fn = template.Resources[f];
24-
if (fn.Properties.Code.hasOwnProperty('S3Bucket')) {
27+
let prop;
28+
if (fn.Properties.hasOwnProperty('Code')) {
29+
prop = fn.Properties.Code;
30+
} else if (fn.Properties.hasOwnProperty('Content')) {
31+
prop = fn.Properties.Content;
32+
}
33+
34+
console.debug(`fn: ${JSON.stringify(fn)}`);
35+
console.debug(`prop: ${JSON.stringify(prop)}`);
36+
37+
if (prop.hasOwnProperty("S3Bucket")) {
2538
// Set the S3 key reference
26-
let artifactHash = Object.assign(fn.Properties.Code.S3Bucket.Ref);
27-
// console.debug(`Old artificatHash is ${artifactHash}`);
28-
artifactHash = artifactHash.replace(/[\w]*AssetParameters/g, '');
29-
artifactHash = artifactHash.substring(0, artifactHash.indexOf('S3Bucket'));
30-
// console.debug(`New artificatHash is ${artifactHash}`);
39+
let artifactHash = Object.assign(prop.S3Key);
40+
console.debug(`artifactHash is ${artifactHash}`);
3141
const assetPath = `asset${artifactHash}`;
32-
fn.Properties.Code.S3Key = `%%SOLUTION_NAME%%/%%VERSION%%/${assetPath}.zip`;
33-
42+
prop.S3Key = `%%SOLUTION_NAME%%/%%VERSION%%/${assetPath}`;
43+
3444
// Set the S3 bucket reference
35-
fn.Properties.Code.S3Bucket = {
36-
'Fn::Sub': '%%BUCKET_NAME%%-${AWS::Region}'
37-
};
38-
} else {
39-
// console.debug(`Here is the fn dump ${JSON.stringify(fn)}`);
45+
prop.S3Bucket = {
46+
"Fn::Sub": "%%BUCKET_NAME%%-${AWS::Region}",
47+
};
48+
} else {
49+
console.warn(`No S3Bucket Property found for ${JSON.stringify(prop)}`);
50+
}
51+
});
52+
53+
// Clean-up Lambda Layer code dependencies
54+
const lambdaLayers = Object.keys(resources).filter(function (key) {
55+
return resources[key].Type === "AWS::Lambda::LayerVersion";
56+
});
57+
lambdaLayers.forEach(function (l) {
58+
const layer = template.Resources[l];
59+
if (layer.Properties.Content.hasOwnProperty('S3Bucket')) {
60+
let s3Key = Object.assign(layer.Properties.Content.S3Key);
61+
layer.Properties.Content.S3Key = `%%SOLUTION_NAME%%/%%VERSION%%/${s3Key}`;
62+
layer.Properties.Content.S3Bucket = {
63+
'Fn::Sub': '%%BUCKET_NAME%%-${AWS::Region}'
4064
}
65+
}
4166
});
4267

4368
// Clean-up nested template stack dependencies
@@ -51,7 +76,7 @@ fs.readdirSync(global_s3_assets).forEach(file => {
5176
'Fn::Join': [
5277
'',
5378
[
54-
`https://%%TEMPLATE_BUCKET_NAME%%.s3.`,
79+
'https://%%TEMPLATE_BUCKET_NAME%%.s3.',
5580
{
5681
'Ref' : 'AWS::URLSuffix'
5782
},
@@ -60,23 +85,10 @@ fs.readdirSync(global_s3_assets).forEach(file => {
6085
]
6186
]
6287
};
63-
// fn.Properties.TemplateURL = {
64-
// 'Fn::Join': [
65-
// '',
66-
// [
67-
// 'https://s3.',
68-
// {
69-
// 'Ref' : 'AWS::URLSuffix'
70-
// },
71-
// '/',
72-
// `%%TEMPLATE_BUCKET_NAME%%/%%SOLUTION_NAME%%/%%VERSION%%/${fn.Metadata.nestedStackFileName}`
73-
// ]
74-
// ]
75-
// };
7688

7789
const params = fn.Properties.Parameters ? fn.Properties.Parameters : {};
7890
const nestedStackParameters = Object.keys(params).filter(function(key) {
79-
if (key.search(/[\w]*AssetParameters/g) > -1) {
91+
if (key.search(_regex) > -1) {
8092
return true;
8193
}
8294
return false;
@@ -90,12 +102,9 @@ fs.readdirSync(global_s3_assets).forEach(file => {
90102
// Clean-up parameters section
91103
const parameters = (template.Parameters) ? template.Parameters : {};
92104
const assetParameters = Object.keys(parameters).filter(function (key) {
93-
// console.debug(`key to analyze ${key}`);
94-
if (key.search(/[\w]*AssetParameters/g) > -1) {
95-
// console.debug('Pattern match');
105+
if (key.search(_regex) > -1) {
96106
return true;
97107
}
98-
// console.debug('Pattern did not match');
99108
return false;
100109
});
101110
assetParameters.forEach(function (a) {

deployment/cdk-solution-helper/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deployment/cdk-solution-helper/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"name": "cdk-solution-helper",
33
"version": "0.1.0",
4+
"devDependencies": {
5+
"fs": "0.0.1-security"
6+
},
47
"dependencies": {
58
"fs": "0.0.1-security"
69
}

0 commit comments

Comments
 (0)