Skip to content

Commit

Permalink
Upgrade nodejs runtime to 16.x (v2 branch) (#184)
Browse files Browse the repository at this point in the history
* Upgrade to aws-cdk-lib 2.28.0 which includes support for NODEJS_16_X in CustomResourceProviderRuntime
* Upgrade all code to use NODEJS_16_X instead of NODEJS_14_X.
* Upgrade all code to use NODEJS_16_X instead of NODEJS_12_X.
* Updated top level dependencies.

  - Updated Lerna to the latest version.
  - Updated Webpack dependency in cdkdx which has an SSL security issue hupe1980/cdkdx#22.
  - Updated ClamAV version for Ubuntu run in Docker. Version `0.103.11-1.el7` is no longer available.
  - Added build instructions to README.

* Use Node v18 and v20 for build. Versions 14 and 16 are EOL as of 2024.
* Grant permission to access Docker socket. Docker is required to build some of the packages. Must grant permissions to the socket.
* Specify the exact tag because `latest` is unavailable.
  - Issue reported in aws/jsii#3505.
  - Upstream https://hub.docker.com/r/jsii/superchain recommends the `1-bullseye-slim` version.

Build results:

```
 Lerna (powered by Nx)   Successfully ran target build for 45 projects (2m)

✨  Done in 113.17s.
```

Test results:

```
Test Suites: 42 passed, 42 total
Tests:       106 passed, 106 total
Snapshots:   64 passed, 64 total
Time:        7.664 s
Ran all test suites in 27 projects.
✨  Done in 10.13s.
```

Co-authored-by: Esen Sagynov <[email protected]>
  • Loading branch information
mbp and Esen Sagynov authored Mar 22, 2024
1 parent 9970609 commit 36726d6
Show file tree
Hide file tree
Showing 99 changed files with 1,020 additions and 826 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"eslint.alwaysShowStatus": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"explorer.autoReveal": false
}
4 changes: 2 additions & 2 deletions examples/blue-green-container-deployment-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"dependencies": {
"@cloudcomponents/cdk-blue-green-container-deployment": "^2.1.0",
"@cloudcomponents/cdk-container-registry": "^2.1.0",
"aws-cdk-lib": "2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/cloudfront-authorization-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"dependencies": {
"@cloudcomponents/cdk-cloudfront-authorization": "^2.1.0",
"aws-cdk-lib": "^2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "^10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/codecommit-backup-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"dependencies": {
"@cloudcomponents/cdk-codecommit-backup": "^2.0.0",
"aws-cdk-lib": "^2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "^10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"dependencies": {
"@cloudcomponents/cdk-codepipeline-check-parameter-action": "^2.1.0",
"aws-cdk-lib": "2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/codepipeline-merge-action-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
},
"dependencies": {
"@cloudcomponents/cdk-codepipeline-merge-action": "^2.1.0",
"aws-cdk-lib": "2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/codepipeline-slack-approval-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"dependencies": {
"@cloudcomponents/cdk-codepipeline-slack": "^2.1.0",
"aws-cdk-lib": "2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/container-audit-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"dependencies": {
"@cloudcomponents/cdk-codepipeline-anchore-inline-scan-action": "^2.1.0",
"@cloudcomponents/cdk-codepipeline-dockerfile-linter-action": "^2.1.0",
"aws-cdk-lib": "2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/contentful-webhook-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"dependencies": {
"@cloudcomponents/cdk-contentful-webhook": "^2.1.0",
"@cloudcomponents/cdk-secret-key": "^2.0.0",
"aws-cdk-lib": "^2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "^10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/dependency-check-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"dependencies": {
"@cloudcomponents/cdk-dependency-check": "^2.1.0",
"aws-cdk-lib": "2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/dynamodb-seeder-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"dependencies": {
"@cloudcomponents/cdk-dynamodb-seeder": "^2.1.0",
"aws-cdk-lib": "^2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "^10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/github-webhook-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"dependencies": {
"@cloudcomponents/cdk-github-webhook": "^2.1.0",
"@cloudcomponents/cdk-secret-key": "^2.0.0",
"aws-cdk-lib": "2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/notifications-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"dependencies": {
"@cloudcomponents/cdk-chatops": "^2.1.0",
"@cloudcomponents/cdk-developer-tools-notifications": "^2.1.0",
"aws-cdk-lib": "2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/pull-request-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"dependencies": {
"@cloudcomponents/cdk-pull-request-approval-rule": "^2.1.0",
"@cloudcomponents/cdk-pull-request-check": "^2.1.0",
"aws-cdk-lib": "^2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "^10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/responsive-email-template-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"dependencies": {
"@cloudcomponents/cdk-responsive-email-template": "^2.1.0",
"aws-cdk-lib": "2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/s3-antivurs-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"dependencies": {
"@cloudcomponents/cdk-s3-antivirus": "^2.1.0",
"aws-cdk-lib": "2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/static-website-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"dependencies": {
"@cloudcomponents/cdk-static-website": "^2.0.0",
"aws-cdk-lib": "^2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "^10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/stripe-webhook-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"dependencies": {
"@cloudcomponents/cdk-secret-key": "^2.0.0",
"@cloudcomponents/cdk-stripe-webhook": "^2.1.0",
"aws-cdk-lib": "2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/temp-stack-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"dependencies": {
"@cloudcomponents/cdk-temp-stack": "^2.1.0",
"aws-cdk-lib": "^2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "^10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
4 changes: 2 additions & 2 deletions examples/wordpress-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"dependencies": {
"@cloudcomponents/cdk-wordpress": "^2.0.0",
"aws-cdk-lib": "^2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "^10.0.41",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4",
"aws-cdk": "2.8.0"
"aws-cdk": "^2.28.0"
}
}
6 changes: 3 additions & 3 deletions packages/cdk-blue-green-container-deployment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@
}
},
"peerDependencies": {
"aws-cdk-lib": "^2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "^10.0.41"
},
"devDependencies": {
"@aws-cdk/assert": "2.8.0",
"aws-cdk-lib": "2.8.0",
"@aws-cdk/assert": "2.28.0",
"aws-cdk-lib": "^2.28.0",
"aws-sdk": "^2.1096.0",
"constructs": "10.0.41",
"custom-resource-helper": "^1.0.15",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Object {
"Arn",
],
},
"Runtime": "nodejs12.x",
"Runtime": "nodejs18.x",
"Timeout": 120,
},
"Type": "AWS::Lambda::Function",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('EcsDeploymentConfig', () => {
const { service, prodTargetGroup, testTargetGroup, prodListener, testListener } = createPrereqResources(stack);

const customApplication = new codedeploy.EcsApplication(stack, 'CustomApplication', {
applicationName: 'My Custom Application',
applicationName: 'My-Custom-Application',
});

new EcsDeploymentGroup(stack, 'DeploymentGroup', {
Expand All @@ -110,7 +110,7 @@ describe('EcsDeploymentConfig', () => {
expectCDK(stack).to(
haveResource('AWS::CodeDeploy::Application', {
ComputePlatform: 'ECS',
ApplicationName: 'My Custom Application',
ApplicationName: 'My-Custom-Application',
}),
);

Expand All @@ -129,7 +129,7 @@ describe('EcsDeploymentConfig', () => {
const { service, prodTargetGroup, testTargetGroup, prodListener, testListener } = createPrereqResources(stack);

new EcsDeploymentGroup(stack, 'DeploymentGroup', {
applicationName: 'My Named Application',
applicationName: 'My-Named-Application',
deploymentGroupName: 'My Deployment Group',
ecsServices: [service],
targetGroups: [prodTargetGroup, testTargetGroup],
Expand All @@ -141,7 +141,7 @@ describe('EcsDeploymentConfig', () => {
expectCDK(stack).to(
haveResource('AWS::CodeDeploy::Application', {
ComputePlatform: 'ECS',
ApplicationName: 'My Named Application',
ApplicationName: 'My-Named-Application',
}),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class EcsDeploymentGroup extends Resource implements IEcsDeploymentGroup,
}

const serviceToken = new Function(this, 'Function', {
runtime: Runtime.NODEJS_14_X,
runtime: Runtime.NODEJS_16_X,
code: Code.fromAsset(path.join(__dirname, 'lambdas', 'ecs-deployment-group')),
handler: 'index.handler',
timeout: Duration.minutes(15),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class EcsService extends Construct implements IConnectable, IEcsService,
];

const serviceToken = new Function(this, 'Function', {
runtime: Runtime.NODEJS_14_X,
runtime: Runtime.NODEJS_16_X,
code: Code.fromAsset(path.join(__dirname, 'lambdas', 'ecs-service')),
handler: 'index.handler',
timeout: Duration.minutes(15),
Expand Down
6 changes: 3 additions & 3 deletions packages/cdk-chatops/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@
}
},
"peerDependencies": {
"aws-cdk-lib": "^2.8.0",
"aws-cdk-lib": "^2.28.0",
"constructs": "^10.0.41"
},
"devDependencies": {
"@aws-cdk/assert": "2.8.0",
"aws-cdk-lib": "2.8.0",
"@aws-cdk/assert": "2.28.0",
"aws-cdk-lib": "^2.28.0",
"aws-sdk": "^2.1096.0",
"axios": "^0.25.0",
"constructs": "10.0.41",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class MSTeamsIncomingWebhookConfiguration extends Construct {
super(scope, id);

this.incomingWebhook = new Function(this, 'Function', {
runtime: Runtime.NODEJS_14_X,
runtime: Runtime.NODEJS_16_X,
code: Code.fromAsset(path.join(__dirname, 'lambdas', 'msteams-incoming-webhook')),
handler: 'index.handler',
environment: {
Expand Down
Loading

0 comments on commit 36726d6

Please sign in to comment.