Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remaining usage of node 14 #25995

Merged
merged 4 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ export class ReplicaProvider extends NestedStack {
// Issues UpdateTable API calls
this.onEventHandler = new lambda.Function(this, 'OnEventHandler', {
code,
runtime: lambda.Runtime.NODEJS_14_X,
runtime: cr.builtInCustomResourceNodeRuntime(this),
handler: 'index.onEventHandler',
timeout: Duration.minutes(5),
});

// Checks if table is back to `ACTIVE` state
this.isCompleteHandler = new lambda.Function(this, 'IsCompleteHandler', {
code,
runtime: lambda.Runtime.NODEJS_14_X,
runtime: cr.builtInCustomResourceNodeRuntime(this),
handler: 'index.isCompleteHandler',
timeout: Duration.seconds(30),
});
Expand Down
10 changes: 9 additions & 1 deletion packages/aws-cdk-lib/aws-dynamodb/test/dynamodb.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ import {
} from '../lib';
import { ReplicaProvider } from '../lib/replica-provider';

jest.mock('../../custom-resources');
jest.mock('../../custom-resources', () => {
const autoMock = jest.createMockFromModule('../../custom-resources');
const { builtInCustomResourceNodeRuntime } = jest.requireActual('../../custom-resources');
return {
// @ts-ignore
...autoMock,
builtInCustomResourceNodeRuntime,
};
});

/* eslint-disable quote-props */

Expand Down
5 changes: 2 additions & 3 deletions packages/aws-cdk-lib/aws-eks/lib/cluster-resource-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import * as cr from '../../custom-resources';
import { NodeProxyAgentLayer } from '../../lambda-layer-node-proxy-agent';

const HANDLER_DIR = path.join(__dirname, 'cluster-resource-handler');
const HANDLER_RUNTIME = lambda.Runtime.NODEJS_14_X;

export interface ClusterResourceProviderProps {

Expand Down Expand Up @@ -70,7 +69,7 @@ export class ClusterResourceProvider extends NestedStack {
const onEvent = new lambda.Function(this, 'OnEventHandler', {
code: lambda.Code.fromAsset(HANDLER_DIR),
description: 'onEvent handler for EKS cluster resource provider',
runtime: HANDLER_RUNTIME,
runtime: cr.builtInCustomResourceNodeRuntime(this),
environment: {
AWS_STS_REGIONAL_ENDPOINTS: 'regional',
...props.environment,
Expand All @@ -87,7 +86,7 @@ export class ClusterResourceProvider extends NestedStack {
const isComplete = new lambda.Function(this, 'IsCompleteHandler', {
code: lambda.Code.fromAsset(HANDLER_DIR),
description: 'isComplete handler for EKS cluster resource provider',
runtime: HANDLER_RUNTIME,
runtime: cr.builtInCustomResourceNodeRuntime(this),
environment: {
AWS_STS_REGIONAL_ENDPOINTS: 'regional',
...props.environment,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1307,5 +1307,12 @@
"paymentcryptographydata": {
"prefix": "payment-cryptography-data",
"name": "PaymentCryptographyData"
},
"codegurusecurity": {
"prefix": "codeguru-security",
"name": "CodeGuruSecurity"
},
"verifiedpermissions": {
"name": "VerifiedPermissions"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import * as iam from '../../../aws-iam';
import * as lambda from '../../../aws-lambda';
import * as logs from '../../../aws-logs';
import { Duration } from '../../../core';
import { builtInCustomResourceNodeRuntime } from '../aws-custom-resource';

const RUNTIME_HANDLER_PATH = path.join(__dirname, 'runtime');
const FRAMEWORK_HANDLER_TIMEOUT = Duration.minutes(15); // keep it simple for now
Expand Down Expand Up @@ -207,7 +208,7 @@ export class Provider extends Construct implements ICustomResourceProvider {
exclude: ['*.ts'],
}),
description: `AWS CDK resource provider framework - ${entrypoint} (${this.node.path})`.slice(0, 256),
runtime: lambda.Runtime.NODEJS_14_X,
runtime: builtInCustomResourceNodeRuntime(this),
handler: `framework.${entrypoint}`,
timeout: FRAMEWORK_HANDLER_TIMEOUT,
logRetention: this.logRetention,
Expand Down