Skip to content

Commit 55fe52a

Browse files
authored
Update to version v1.0.3 (#30)
1 parent 00eda13 commit 55fe52a

File tree

123 files changed

+4362
-3211
lines changed

Some content is hidden

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

123 files changed

+4362
-3211
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Steps to reproduce the behavior.
1717
A clear and concise description of what you expected to happen.
1818

1919
**Please complete the following information about the solution:**
20-
- [ ] Version: [e.g. v1.0.2]
20+
- [ ] Version: [e.g. v1.0.3]
2121

2222
To get the version of the solution, you can look at the description of the created CloudFormation stack. For example, "_(SO0021) - Video On Demand workflow with AWS Step Functions, MediaConvert, MediaPackage, S3, CloudFront and DynamoDB. Version **v5.0.0**_". If the description does not contain the version information, you can look at the mappings section of the template:
2323

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ build/
44
**/.vscode/*
55
reports/
66
coverage/
7+
coverage-reports/
78
.aws-sam/
89
output/
910
target
@@ -13,6 +14,15 @@ druid-bin
1314
zookeeper-bin
1415
*_version.txt
1516

17+
# Python build files
18+
.venv/
19+
__pycache__/
20+
py_modules/
21+
22+
# derived build assets
23+
**/deployment/global-s3-assets
24+
**/deployment/regional-s3-assets
25+
1626
*.js
1727
!jest.config.js
1828
!jest.setup.js

CHANGELOG.md

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

8+
## [1.0.3] - 2024-08-19
9+
10+
### Security
11+
12+
- Upgrade Zookeeper to the latest patch version of v3.8.4
13+
- Upgrade Druid to v30.0.0
14+
- Upgrade Druid-Operator to be v1.2.3
15+
- EC2 instances now require IMDSv2
16+
- Patch axios vulnerability
17+
18+
### Fixed
19+
20+
- Empty S3 buckets during teardown if needed
21+
- Gracefully delete CloudWatch Synthetics Canary network interfaces
22+
823
## [1.0.2] - 2024-08-07
924

1025
### Security
26+
1127
- Patched fast-xml-parser vulnerability
1228

1329
## [1.0.1] - 2024-07-01

NOTICE.txt

+771-42
Large diffs are not rendered by default.

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ The solution deploys the following components that work together to provide a pr
126126
- The latest version of the [AWS CLI](https://aws.amazon.com/cli/), installed and configured.
127127
- The latest version of the [AWS CDK](https://docs.aws.amazon.com/cdk/latest/guide/home.html).
128128
- [Nodejs](https://docs.npmjs.com/getting-started) version 18 or newer.
129+
- [Python](https://www.python.org/) version 3.12 or newer.
129130
- [Git](https://git-scm.com/) command line
130131
- Java Runtime
131132
- The solution requires a Java 8 Runtime. We strongly recommend using [Amazon Corretto 8](https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html). Alternatively, you can also use other OpenJDKs such as [Eclipse Temurin](https://adoptium.net/en-GB/temurin/releases/?version=8).
@@ -294,7 +295,7 @@ It is important to note that the redirect URI on the IDP side should be configur
294295
- **Druid version**: Apache Druid release version (eg. 27.0.0) that you want to run. It is recommended to use the latest stable [Druid version](#https://druid.apache.org/downloads.html).
295296
296297
```
297-
"druidVersion": "27.0.0",
298+
"druidVersion": "30.0.0",
298299
```
299300
300301
- **Druid cluster name**: A sequence of ASCII characters that uniquely identifies each Druid cluster. If there are multiple deployments, please make sure that you have an unique cluster name for each cluster. The cluster name will be appended to the CloudFormation stack name.
@@ -797,6 +798,7 @@ Upon successfully cloning the repository into your local development environment
797798
|- NOTICE.txt - Copyrights for this solution.
798799
|- THIRDPARTY_LICENSE.txt - Copyrights licenses for third party software that was used in this solution
799800
|- README.md - this file.
801+
|- SECURITY.md - detailed information about reporting security issues.
800802
```
801803
802804
---

SECURITY.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Reporting Security Issues
2+
----------------------------------------------------------------------------------------------------------
3+
We take all security reports seriously. When we receive such reports, we will investigate and
4+
subsequently address any potential vulnerabilities as quickly as possible. If you discover a potential
5+
security issue in this project, please notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/) or
6+
directly via email to [AWS Security](mailto:[email protected]). Please do not create a public GitHub issue in this project.

deployment/build-s3-dist.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# Parameters:
2222
# - source-bucket-base-name: Name for the S3 bucket location where the template will source the Lambda
2323
# code from. The template will append '-[region_name]' to this bucket name.
24-
# For example: ./build-s3-dist.sh solutions v1.0.2
24+
# For example: ./build-s3-dist.sh solutions v1.0.3
2525
# The template will then expect the source code to be located in the solutions-[region_name] bucket
2626
# - solution-name: name of the solution for consistency
2727
# - version-code: version of the package
@@ -60,7 +60,7 @@ usage()
6060
{
6161
echo "Usage: $0 bucket solution-name version"
6262
echo "Please provide the base source bucket name, trademarked solution name, and version."
63-
echo "For example: ./build-s3-dist.sh mybucket my-solution v1.0.2"
63+
echo "For example: ./build-s3-dist.sh mybucket my-solution v1.0.3"
6464
exit 1
6565
}
6666

@@ -214,6 +214,9 @@ cleanup_temporary_generted_files()
214214

215215
# Delete the downloaded files
216216
do_cmd rm -rf druid-bin zookeeper-bin
217+
218+
# Cleanup the generated runtime version files
219+
do_cmd rm -f lib/uploads/config/*_version.txt
217220
}
218221

219222
fn_exists()

deployment/run-unit-tests.sh

+62-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@
1313
[ "$DEBUG" == 'true' ] && set -x
1414
set -e
1515

16+
venv_folder="./.venv/"
17+
18+
setup_python_env() {
19+
if [ -d "$venv_folder" ]; then
20+
echo "Re-using Python venv in $venv_folder"
21+
return
22+
fi
23+
24+
python3 -m venv $venv_folder
25+
source $venv_folder/bin/activate
26+
pip3 install -q -r requirements.txt -r requirements-test.txt
27+
deactivate
28+
}
29+
1630
prepare_jest_coverage_report() {
1731
local component_name=$1
1832

@@ -29,6 +43,40 @@ prepare_jest_coverage_report() {
2943
mv coverage $coverage_report_path
3044
}
3145

46+
run_python_test() {
47+
local component_path=$1
48+
local component_name=$2
49+
50+
echo "------------------------------------------------------------------------------"
51+
echo "[Test] Run lambda unit test with coverage for $component_path $component_name"
52+
echo "------------------------------------------------------------------------------"
53+
54+
[ "${CLEAN:-true}" = "true" ] && rm -rf $venv_folder
55+
56+
setup_python_env
57+
source $venv_folder/bin/activate
58+
59+
pytest_coverage_report_path=$coverage_reports_top_path/pytest
60+
mkdir -p $pytest_coverage_report_path
61+
coverage_report_path=$pytest_coverage_report_path/$component_name.coverage.xml
62+
echo "Coverage report path set to $coverage_report_path"
63+
64+
python3 -m pytest --cov --cov-report=term-missing --cov-report "xml:$coverage_report_path"
65+
if [ "$?" = "1" ]; then
66+
echo "(deployment/run-unit-tests.sh) ERROR: there is likely output above." 1>&2
67+
exit 1
68+
fi
69+
70+
sed -i -e "s,<source>$source_dir,<source>source,g" $coverage_report_path
71+
72+
deactivate
73+
74+
if [ "${CLEAN:-true}" = "true" ]; then
75+
# Note: leaving $source_dir/test/coverage-reports to allow further processing of coverage reports
76+
rm -rf $venv_folder coverage .coverage
77+
fi
78+
}
79+
3280
run_javascript_test() {
3381
local component_path=$1
3482
local component_name=$2
@@ -65,7 +113,7 @@ run_cdk_project_test() {
65113
# export overrideWarningsEnabled=false
66114

67115
# run unit tests
68-
npm run test -- -u
116+
npm run test:jest -- -u
69117

70118
# prepare coverage reports
71119
prepare_jest_coverage_report $component_name
@@ -90,6 +138,19 @@ echo "Running unit tests"
90138
source_dir="$(cd $PWD/../source; pwd -P)"
91139
coverage_reports_top_path=$source_dir/coverage-reports
92140

141+
# Test the Python Lambda functions
142+
cd $source_dir/lib/lambdas
143+
for folder in */ ; do
144+
cd "$folder"
145+
function_name=${PWD##*/}
146+
147+
if [ -e "requirements.txt" ]; then
148+
run_python_test $source_dir/lib/lambdas $function_name
149+
fi
150+
151+
cd ..
152+
done
153+
93154
# Test the CDK project
94155
run_cdk_project_test $source_dir
95156

source/.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = {
3030
'@typescript-eslint/explicit-member-accessibility': ['warn'],
3131
'@typescript-eslint/naming-convention': [
3232
'error',
33-
{ selector: 'variableLike', format: ['camelCase'] },
33+
{ selector: 'variableLike', format: ['camelCase'], leadingUnderscore: 'allow' },
3434
{ selector: 'memberLike', format: ['camelCase'] },
3535
{ selector: 'typeLike', format: ['PascalCase'] },
3636
],

source/DruidCloudwatchExtension/src/main/java/com/amazon/solutions/druid/cloudwatch/CloudwatchEmitter.java

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
2-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License").
5-
You may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
2+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
SPDX-License-Identifier: Apache-2.0
154
*/
165
package com.amazon.solutions.druid.cloudwatch;
176

source/DruidCloudwatchExtension/src/main/java/com/amazon/solutions/druid/cloudwatch/CloudwatchEmitterConfig.java

+3-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
2-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License").
5-
You may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
2+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
SPDX-License-Identifier: Apache-2.0
154
*/
165
package com.amazon.solutions.druid.cloudwatch;
176

@@ -24,7 +13,7 @@
2413
@Data
2514
public class CloudwatchEmitterConfig {
2615
static final int CLOUDWATCH_METRICS_MEMORY_LIMIT = 100000000;
27-
static final String SOLUTION_VERSION = "v1.0.2";
16+
static final String SOLUTION_VERSION = "v1.0.3";
2817

2918
@JsonProperty("batchSize")
3019
@Nullable

source/DruidCloudwatchExtension/src/main/java/com/amazon/solutions/druid/cloudwatch/CloudwatchEmitterModule.java

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
2-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License").
5-
You may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
2+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
SPDX-License-Identifier: Apache-2.0
154
*/
165
package com.amazon.solutions.druid.cloudwatch;
176

source/DruidCloudwatchExtension/src/main/java/com/amazon/solutions/druid/cloudwatch/CloudwatchMetricUnits.java

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
2-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License").
5-
You may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
2+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
SPDX-License-Identifier: Apache-2.0
154
*/
165
package com.amazon.solutions.druid.cloudwatch;
176

source/DruidCloudwatchExtension/src/main/java/com/amazon/solutions/druid/cloudwatch/DruidMonitoringMetricsFactory.java

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
2-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License").
5-
You may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
2+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
SPDX-License-Identifier: Apache-2.0
154
*/
165
package com.amazon.solutions.druid.cloudwatch;
176

source/DruidCloudwatchExtension/src/main/java/com/amazon/solutions/druid/cloudwatch/MemoryBoundLinkedBlockingQueue.java

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
2-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License").
5-
You may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
2+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
SPDX-License-Identifier: Apache-2.0
154
*/
165
package com.amazon.solutions.druid.cloudwatch;
176

source/DruidCloudwatchExtension/src/test/java/com/amazon/solutions/druid/cloudwatch/CloudwatchEmitterConfigTest.java

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
2-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License").
5-
You may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
2+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
SPDX-License-Identifier: Apache-2.0
154
*/
165
package com.amazon.solutions.druid.cloudwatch;
176

@@ -57,15 +46,15 @@ public void testGetBatchSize_withDefaultBatchSize() {
5746
@Test
5847
public void testToString_withValidConfig() {
5948
// arrange
60-
CloudwatchEmitterConfig config = new CloudwatchEmitterConfig("test-cluster", 200, "v1.0.2");
49+
CloudwatchEmitterConfig config = new CloudwatchEmitterConfig("test-cluster", 200, "v1.0.3");
6150

6251
// act
6352
String actual = config.toString();
6453

6554
// assert
6655
Assert.assertTrue(actual.contains("test-cluster"));
6756
Assert.assertTrue(actual.contains("200"));
68-
Assert.assertTrue(actual.contains("v1.0.2"));
57+
Assert.assertTrue(actual.contains("v1.0.3"));
6958
Assert.assertTrue(actual.contains("CloudwatchEmitterConfig"));
7059
}
7160

0 commit comments

Comments
 (0)