Skip to content

Commit 13b62da

Browse files
authored
Merge pull request #345 from gockle/hotfix/1.4.2
Hotfix to update cdk version to v2 and rebuild Lambda Python to update certifi
2 parents b8c5ed8 + 3b4defa commit 13b62da

17 files changed

+9462
-988
lines changed

.viperlightignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Ignore Config used with code.amazon.com
2+
Config
3+
4+
^docs/
5+
^viperlight/
6+
source/lambda/schedulers/instance_scheduler.py:133
7+
source/lambda/schedulers/instance_scheduler.py:134
8+
source/lambda/requesthandlers/setup_demo_data.py:64
9+
deployment/buildspecs/mainline-s3-spec.yml:20
10+
source/lambda/models/rds/2014-10-31/service-2.json:152
11+
source/lambda/models/ssm/2014-11-06/service-2.json:3240
12+
source/lambda/tests/cloudformation_util.py:26
13+
source/lambda/tests/cloudformation_util.py:27
14+
source/lambda/tests/rds_util.py:27
15+
source/lambda/tests/rds_util.py:28
16+
source/lambda/tests/ec2_util.py:27
17+
source/lambda/tests/ec2_util.py:28
18+
CODE_OF_CONDUCT.md:4
19+
CONTRIBUTING.md:51
20+
source/package-lock.json:6526
21+
source/package-lock.json:3672
22+
source/package-lock.json:3510
23+
source/package-lock.json:3667
24+
source/test/aws-instance-scheduler-stack.test.ts:25
25+
source/test/aws-instance-scheduler-remote-stack.test.ts:24
26+
source/lambda/models/rds/2014-10-31/service-2.json:4873

.viperlightrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"all": true,
3+
"failOn": "medium"
4+
}

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ 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.4.2] - 2023-01-11
8+
### Fixed
9+
- Upgrade certifi to mitigate [CVE-2022-23491](https://nvd.nist.gov/vuln/detail/CVE-2022-23491).
10+
- Updated issues in bandit scan.
11+
- Updated the CDK version 2.x
12+
713
## [1.4.1] - 2022-05-12
814
### Fixed
915
- Replaced the DescribeLogStreams API call used for getting the next sequence token with PutLogEvents API call to reduce the lambda execution time [#307](https://github.com/awslabs/aws-instance-scheduler/issues/307)

buildspec.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: 0.2
2+
3+
phases:
4+
install:
5+
runtime-versions:
6+
python: 3.10
7+
commands:
8+
- pip install --upgrade pip
9+
- pip install -r source/lambda/requirements.txt -t source/lambda/
10+
pre_build:
11+
commands:
12+
- echo "Installing dependencies and executing unit tests - `pwd`"
13+
- cd source
14+
- chmod +x ./run-all-tests.sh && ./run-all-tests.sh
15+
- echo "Installing dependencies and executing unit tests completed `date`"
16+
build:
17+
commands:
18+
- echo "`pwd`"
19+
- echo "cd ../deployment"
20+
- cd ../deployment
21+
- echo "Starting build `date` in `pwd`"
22+
- chmod +x ./build-s3-dist.sh && ./build-s3-dist.sh $DIST_OUTPUT_BUCKET $SOLUTION_NAME $VERSION
23+
- echo "Build completed `date`"
24+
- echo "Starting open-source-dist `date` in `pwd`"
25+
- chmod +x ./build-open-source-dist.sh && ./build-open-source-dist.sh $SOLUTION_NAME
26+
- echo "Open Source Dist completed `date`"
27+
28+
post_build:
29+
commands:
30+
- echo "Retrieving next stage buildspec `date` in `pwd`"
31+
- aws s3 cp s3://solutions-build-assets/changelog-spec.yml ../buildspec.yml
32+
- echo "Retrieving next stage buildspec complete"
33+
- echo "Post build completed on `date`"
34+
35+
artifacts:
36+
files:
37+
- deployment/**/*
38+
- buildspec.yml
39+
- CHANGELOG.md

deployment/build-s3-dist.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#
1414

1515
# Important: CDK global version number
16-
cdk_version=1.96.0
16+
cdk_version=2.59.0
1717

1818
# Check to see if the required parameters have been provided:
1919
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then

source/bin/aws-instance-scheduler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* permissions and limitations under the License. *
1515
*****************************************************************************/
1616

17-
import * as cdk from '@aws-cdk/core';
17+
import * as cdk from 'aws-cdk-lib';
1818
import { AwsInstanceSchedulerStack } from '../lib/aws-instance-scheduler-stack';
1919
import { AwsInstanceSchedulerRemoteStack } from '../lib/aws-instance-scheduler-remote-stack';
2020

source/jest.config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module.exports = {
2-
"roots": [
3-
"<rootDir>/test"
4-
],
5-
testMatch: [ '**/*.test.ts'],
6-
"transform": {
7-
"^.+\\.tsx?$": "ts-jest"
8-
},
2+
"roots": [
3+
"<rootDir>/test"
4+
],
5+
testMatch: [ '**/*.test.ts'],
6+
transform: {
7+
'^.+\\.tsx?$': 'ts-jest'
98
}
9+
}

source/lambda/bin/chardetect

Lines changed: 0 additions & 8 deletions
This file was deleted.

source/lambda/testing_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
botocore>=1.12.99
22
boto3>=1.9.99
33
mock>=2.0.0
4-
pytest>=4.4.1
4+
pytest>=7.2.0
55
pytest-mock>=1.10.4
66
pytest-runner>=2.11.1
77
uuid>=1.30

source/lib/aws-instance-scheduler-remote-stack.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
* permissions and limitations under the License. *
1515
*****************************************************************************/
1616

17-
import * as cdk from '@aws-cdk/core';
18-
import * as iam from '@aws-cdk/aws-iam';
19-
import { ArnPrincipal, CompositePrincipal, Effect, PolicyStatement } from "@aws-cdk/aws-iam";
17+
import * as cdk from 'aws-cdk-lib';
18+
import * as iam from 'aws-cdk-lib/aws-iam';
19+
import { ArnPrincipal, CompositePrincipal, Effect, PolicyStatement } from "aws-cdk-lib/aws-iam";
20+
import { Construct } from "constructs";
2021

2122
export interface AwsInstanceSchedulerRemoteStackProps extends cdk.StackProps {
2223
readonly description: string,
@@ -30,7 +31,7 @@ export interface AwsInstanceSchedulerRemoteStackProps extends cdk.StackProps {
3031

3132
export class AwsInstanceSchedulerRemoteStack extends cdk.Stack {
3233

33-
constructor(scope: cdk.Construct, id: string, props: AwsInstanceSchedulerRemoteStackProps) {
34+
constructor(scope: Construct, id: string, props: AwsInstanceSchedulerRemoteStackProps) {
3435
super(scope, id, props);
3536

3637
//CFN Parameters

0 commit comments

Comments
 (0)