From 8b0757e1ea472dc1094f441e6c46d87c44fbc5a8 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Fri, 30 Sep 2022 15:35:52 +0200 Subject: [PATCH] fix: change Node 10 to 14 everywhere (#22289) This is a backport of https://github.com/aws/aws-cdk/pull/20595. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- INTEGRATION_TESTS.md | 4 +- packages/@aws-cdk/aws-apigateway/README.md | 10 +- .../test/authorizers/lambda.test.ts | 6 +- .../@aws-cdk/aws-apigateway/test/cors.test.ts | 2 +- .../aws-apigateway/test/deployment.test.ts | 4 +- .../test/integrations/lambda.test.ts | 14 +-- .../aws-apigateway/test/lambda-api.test.ts | 12 +- .../aws-apigateway/test/method.test.ts | 2 +- .../test/hooks.test.ts | 6 +- packages/@aws-cdk/aws-cloudfront/README.md | 22 ++-- .../aws-cloudfront/test/distribution.test.ts | 8 +- .../test/web-distribution.test.ts | 10 +- packages/@aws-cdk/aws-cloudtrail/README.md | 10 +- .../aws-cloudtrail/test/cloudtrail.test.ts | 2 +- .../lambda/custom-deployment-config.test.ts | 2 +- .../test/lambda/deployment-group.test.ts | 2 +- .../aws-codepipeline-actions/README.md | 4 +- .../test/lambda/lambda-invoke-action.test.ts | 2 +- .../test/pipeline.test.ts | 2 +- packages/@aws-cdk/aws-cognito/README.md | 4 +- packages/@aws-cdk/aws-config/README.md | 8 +- .../@aws-cdk/aws-config/test/rule.test.ts | 8 +- .../__entrypoint__.js | 118 +++++++++++++++++ .../ca.crt | 0 .../client1.domain.tld.crt | 0 .../client1.domain.tld.key | 0 .../index.d.ts | 0 .../index.js | 0 .../index.ts | 0 .../server.crt | 0 .../server.key | 0 .../__entrypoint__.js | 119 ------------------ .../cdk-ec2-client-vpn-endpoint.template.json | 20 +-- .../cdk.out | 2 +- .../integ.json | 4 +- .../manifest.json | 26 ++-- .../tree.json | 12 +- .../aws-ec2/test/integ.client-vpn-endpoint.ts | 2 +- .../@aws-cdk/aws-events-targets/README.md | 4 +- .../@aws-cdk/aws-kinesisfirehose/README.md | 4 +- .../aws-lambda-destinations/README.md | 6 +- .../test/destinations.test.ts | 2 +- .../@aws-cdk/aws-lambda/test/alias.test.ts | 42 +++---- .../@aws-cdk/aws-lambda/test/code.test.ts | 18 +-- .../aws-lambda/test/function-hash.test.ts | 8 +- .../aws-lambda/test/function-url.test.ts | 10 +- .../@aws-cdk/aws-lambda/test/function.test.ts | 106 ++++++++-------- .../aws-lambda/test/lambda-insights.test.ts | 2 +- .../aws-lambda/test/lambda-version.test.ts | 14 +-- .../@aws-cdk/aws-lambda/test/layers.test.ts | 6 +- .../aws-lambda/test/vpc-lambda.test.ts | 18 +-- .../aws-logs-destinations/test/lambda.test.ts | 2 +- packages/@aws-cdk/aws-rds/README.md | 6 +- .../@aws-cdk/aws-rds/test/instance.test.ts | 2 +- .../@aws-cdk/aws-s3-notifications/README.md | 2 +- .../test/lambda/lambda.test.ts | 12 +- .../test/rotation-schedule.test.ts | 10 +- .../aws-secretsmanager/test/secret.test.ts | 2 +- .../aws-ses-actions/test/actions.test.ts | 2 +- .../aws-sns-subscriptions/test/subs.test.ts | 22 ++-- packages/@aws-cdk/core/README.md | 6 +- .../test/provider-framework/provider.test.ts | 24 ++-- packages/@aws-cdk/integ-tests/README.md | 12 +- packages/@aws-cdk/triggers/README.md | 2 +- packages/aws-cdk-lib/README.md | 6 +- packages/aws-cdk-lib/package.json | 4 + packages/aws-cdk/README.md | 10 +- packages/aws-cdk/does-not-exist.json | 2 +- packages/aws-cdk/test/integ/cli/app/app.js | 2 +- tools/@aws-cdk/node-bundle/src/api/bundle.ts | 2 +- 70 files changed, 410 insertions(+), 407 deletions(-) create mode 100644 packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/__entrypoint__.js rename packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/{asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f => asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a}/ca.crt (100%) rename packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/{asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f => asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a}/client1.domain.tld.crt (100%) rename packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/{asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f => asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a}/client1.domain.tld.key (100%) rename packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/{asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f => asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a}/index.d.ts (100%) rename packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/{asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f => asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a}/index.js (100%) rename packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/{asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f => asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a}/index.ts (100%) rename packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/{asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f => asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a}/server.crt (100%) rename packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/{asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f => asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a}/server.key (100%) delete mode 100644 packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/__entrypoint__.js diff --git a/INTEGRATION_TESTS.md b/INTEGRATION_TESTS.md index f6c95623d1093..b546f3cc54f91 100644 --- a/INTEGRATION_TESTS.md +++ b/INTEGRATION_TESTS.md @@ -93,7 +93,7 @@ const stack = new cdk.Stack(app, 'aws-cdk-lambda-1'); const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); app.synth(); @@ -214,7 +214,7 @@ touch any CloudFormation property, but instead change the way that code is bundl a change to an integration test, you need to make sure that the integration tests and assertions are rerun. An example of this would be making a change to the way `aws-lambda-nodejs` bundles Lambda code. A couple of things could go wrong that would -only be caught by rerunning the integration tests. +only be caught by rerunning the integration tests. 1. The bundling commands are only running when performing a real synth (not part of unit tests). Running the integration test confirms that the actual bundling was not broken. diff --git a/packages/@aws-cdk/aws-apigateway/README.md b/packages/@aws-cdk/aws-apigateway/README.md index 8dae2d1cf9165..2052a33340846 100644 --- a/packages/@aws-cdk/aws-apigateway/README.md +++ b/packages/@aws-cdk/aws-apigateway/README.md @@ -113,13 +113,13 @@ You can use Amazon API Gateway with AWS Step Functions as the backend integratio The `StepFunctionsRestApi` only supports integration with Synchronous Express state machine. The `StepFunctionsRestApi` construct makes this easy by setting up input, output and error mapping. -The construct sets up an API endpoint and maps the `ANY` HTTP method and any calls to the API endpoint starts an express workflow execution for the underlying state machine. +The construct sets up an API endpoint and maps the `ANY` HTTP method and any calls to the API endpoint starts an express workflow execution for the underlying state machine. Invoking the endpoint with any HTTP method (`GET`, `POST`, `PUT`, `DELETE`, ...) in the example below will send the request to the state machine as a new execution. On success, an HTTP code `200` is returned with the execution output as the Response Body. If the execution fails, an HTTP `500` response is returned with the `error` and `cause` from the execution output as the Response Body. If the request is invalid (ex. bad execution input) HTTP code `400` is returned. -The response from the invocation contains only the `output` field from the +The response from the invocation contains only the `output` field from the [StartSyncExecution](https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartSyncExecution.html#API_StartSyncExecution_ResponseSyntax) API. In case of failures, the fields `error` and `cause` are returned as part of the response. Other metadata such as billing details, AWS account ID and resource ARNs are not returned in the API response. @@ -139,7 +139,7 @@ const stateMachine: stepfunctions.IStateMachine = new stepfunctions.StateMachine definition: stateMachineDefinition, stateMachineType: stepfunctions.StateMachineType.EXPRESS, }); - + new apigateway.StepFunctionsRestApi(this, 'StepFunctionsRestApi', { deploy: true, stateMachine: stateMachine, @@ -157,7 +157,7 @@ AWS Step Functions will receive the request body in its input as follows: ```json { "body": { - "customerId": 1 + "customerId": 1 }, "path": "/", "querystring": {} @@ -426,7 +426,7 @@ have to define your models and mappings for the request, response, and integrati ```ts const hello = new lambda.Function(this, 'hello', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'hello.handler', code: lambda.Code.fromAsset('lambda') }); diff --git a/packages/@aws-cdk/aws-apigateway/test/authorizers/lambda.test.ts b/packages/@aws-cdk/aws-apigateway/test/authorizers/lambda.test.ts index 35e4af64cad8e..54bc61807c662 100644 --- a/packages/@aws-cdk/aws-apigateway/test/authorizers/lambda.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/authorizers/lambda.test.ts @@ -11,7 +11,7 @@ describe('lambda authorizer', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const auth = new TokenAuthorizer(stack, 'myauthorizer', { @@ -176,7 +176,7 @@ describe('lambda authorizer', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const auth = new TokenAuthorizer(stack, 'myauthorizer', { @@ -320,7 +320,7 @@ describe('lambda authorizer', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const role = new iam.Role(stack, 'authorizerassumerole', { diff --git a/packages/@aws-cdk/aws-apigateway/test/cors.test.ts b/packages/@aws-cdk/aws-apigateway/test/cors.test.ts index c573e6302589e..0712a76bb2471 100644 --- a/packages/@aws-cdk/aws-apigateway/test/cors.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/cors.test.ts @@ -634,7 +634,7 @@ describe('cors', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN diff --git a/packages/@aws-cdk/aws-apigateway/test/deployment.test.ts b/packages/@aws-cdk/aws-apigateway/test/deployment.test.ts index ef537a848c070..ae74fd4080f62 100644 --- a/packages/@aws-cdk/aws-apigateway/test/deployment.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/deployment.test.ts @@ -199,12 +199,12 @@ describe('deployment', () => { const stack2 = new Stack(); const handler1 = new lambda.Function(stack1, 'handler1', { code: lambda.Code.fromAsset(path.join(__dirname, 'lambda')), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', }); const handler2 = new lambda.Function(stack2, 'handler2', { code: lambda.Code.fromAsset(path.join(__dirname, 'lambda')), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', }); diff --git a/packages/@aws-cdk/aws-apigateway/test/integrations/lambda.test.ts b/packages/@aws-cdk/aws-apigateway/test/integrations/lambda.test.ts index 187e15e2b09cf..7d2221c0ddb92 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integrations/lambda.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/integrations/lambda.test.ts @@ -54,7 +54,7 @@ describe('lambda', () => { // GIVEN const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'Handler', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', }); @@ -102,7 +102,7 @@ describe('lambda', () => { // GIVEN const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'Handler', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', }); @@ -138,7 +138,7 @@ describe('lambda', () => { // GIVEN const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'Handler', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', }); @@ -162,7 +162,7 @@ describe('lambda', () => { const api = new apigateway.RestApi(stack, 'test-api'); const handler = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('loo'), }); @@ -228,7 +228,7 @@ describe('lambda', () => { }); const handler = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('loo'), }); @@ -249,7 +249,7 @@ describe('lambda', () => { const method = restapi.root.addMethod('ANY'); const handler = new lambda.Function(stack, 'MyFunc', { functionName: 'ThisFunction', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('loo'), }); @@ -269,7 +269,7 @@ describe('lambda', () => { const restapi = new apigateway.RestApi(stack, 'RestApi'); const method = restapi.root.addMethod('ANY'); const handler = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('loo'), }); diff --git a/packages/@aws-cdk/aws-apigateway/test/lambda-api.test.ts b/packages/@aws-cdk/aws-apigateway/test/lambda-api.test.ts index f7c47afe85d2b..e58a615112219 100644 --- a/packages/@aws-cdk/aws-apigateway/test/lambda-api.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/lambda-api.test.ts @@ -11,7 +11,7 @@ describe('lambda api', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -73,7 +73,7 @@ describe('lambda api', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'alias', { aliasName: 'my-alias', @@ -138,7 +138,7 @@ describe('lambda api', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -175,7 +175,7 @@ describe('lambda api', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); expect(() => new apigw.LambdaRestApi(stack, 'lambda-rest-api', { @@ -196,7 +196,7 @@ describe('lambda api', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -252,7 +252,7 @@ describe('lambda api', () => { handler: new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), restApiName: cdk.PhysicalName.GENERATE_IF_NEEDED, }); diff --git a/packages/@aws-cdk/aws-apigateway/test/method.test.ts b/packages/@aws-cdk/aws-apigateway/test/method.test.ts index de41b0dfe363f..1540a7d27ad16 100644 --- a/packages/@aws-cdk/aws-apigateway/test/method.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/method.test.ts @@ -658,7 +658,7 @@ describe('method', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const auth = new apigw.TokenAuthorizer(stack, 'myauthorizer1', { diff --git a/packages/@aws-cdk/aws-autoscaling-hooktargets/test/hooks.test.ts b/packages/@aws-cdk/aws-autoscaling-hooktargets/test/hooks.test.ts index 413142423f7b5..1e824c28ebd04 100644 --- a/packages/@aws-cdk/aws-autoscaling-hooktargets/test/hooks.test.ts +++ b/packages/@aws-cdk/aws-autoscaling-hooktargets/test/hooks.test.ts @@ -121,7 +121,7 @@ describe('given an AutoScalingGroup and no role', () => { // GIVEN const fn = new lambda.Function(stack, 'Fn', { code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.index', }); @@ -165,7 +165,7 @@ describe('given an AutoScalingGroup and no role', () => { const key = new kms.Key(stack, 'key'); const fn = new lambda.Function(stack, 'Fn', { code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.index', }); @@ -297,7 +297,7 @@ describe('given an AutoScalingGroup and a role', () => { // GIVEN const fn = new lambda.Function(stack, 'Fn', { code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.index', }); const myrole = new iam.Role(stack, 'MyRole', { diff --git a/packages/@aws-cdk/aws-cloudfront/README.md b/packages/@aws-cdk/aws-cloudfront/README.md index 42b717b8a8840..a37d40c0d6fbf 100644 --- a/packages/@aws-cdk/aws-cloudfront/README.md +++ b/packages/@aws-cdk/aws-cloudfront/README.md @@ -91,7 +91,7 @@ your domain name, and provide one (or more) domain names from the certificate fo The certificate must be present in the AWS Certificate Manager (ACM) service in the US East (N. Virginia) region; the certificate may either be created by ACM, or created elsewhere and imported into ACM. When a certificate is used, the distribution will support HTTPS connections -from SNI only and a minimum protocol version of TLSv1.2_2021 if the `@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021` feature flag is set, and TLSv1.2_2019 otherwise. +from SNI only and a minimum protocol version of TLSv1.2_2021 if the `@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021` feature flag is set, and TLSv1.2_2019 otherwise. ```ts // To use your own domain name in a Distribution, you must associate a certificate @@ -361,7 +361,7 @@ on every request: // A Lambda@Edge function added to default behavior of a Distribution // and triggered on every request const myFunc = new cloudfront.experimental.EdgeFunction(this, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')), }); @@ -392,7 +392,7 @@ If the stack is in `us-east-1`, a "normal" `lambda.Function` can be used instead ```ts // Using a lambda Function instead of an EdgeFunction for stacks in `us-east-`. const myFunc = new lambda.Function(this, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')), }); @@ -405,14 +405,14 @@ you can also set a specific stack ID for each Lambda@Edge. // Setting stackIds for EdgeFunctions that can be referenced from different applications // on the same account. const myFunc1 = new cloudfront.experimental.EdgeFunction(this, 'MyFunction1', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler1')), stackId: 'edge-lambda-stack-id-1', }); const myFunc2 = new cloudfront.experimental.EdgeFunction(this, 'MyFunction2', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler2')), stackId: 'edge-lambda-stack-id-2', @@ -558,7 +558,7 @@ configuration properties have been changed: | `loggingConfig` | `enableLogging`; configure with `logBucket` `logFilePrefix` and `logIncludesCookies` | | `viewerProtocolPolicy` | removed; set on each behavior instead. default changed from `REDIRECT_TO_HTTPS` to `ALLOW_ALL` | -After switching constructs, you need to maintain the same logical ID for the underlying [CfnDistribution](https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-cloudfront.CfnDistribution.html) if you wish to avoid the deletion and recreation of your distribution. +After switching constructs, you need to maintain the same logical ID for the underlying [CfnDistribution](https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-cloudfront.CfnDistribution.html) if you wish to avoid the deletion and recreation of your distribution. To do this, use [escape hatches](https://docs.aws.amazon.com/cdk/v2/guide/cfn_layer.html) to override the logical ID created by the new Distribution construct with the logical ID created by the old construct. Example: @@ -714,7 +714,7 @@ new cloudfront.CloudFrontWebDistribution(this, 'MyCfWebDistribution', { }); ``` -Becomes: +Becomes: ```ts declare const sourceBucket: s3.Bucket; @@ -733,8 +733,8 @@ cfnDistribution.addPropertyOverride('ViewerCertificate.SslSupportMethod', 'sni-o ### Other changes -A number of default settings have changed on the new API when creating a new distribution, behavior, and origin. -After making the major changes needed for the migration, run `cdk diff` to see what settings have changed. +A number of default settings have changed on the new API when creating a new distribution, behavior, and origin. +After making the major changes needed for the migration, run `cdk diff` to see what settings have changed. If no changes are desired during migration, you will at the least be able to use [escape hatches](https://docs.aws.amazon.com/cdk/v2/guide/cfn_layer.html) to override what the CDK synthesizes, if you can't change the properties directly. ## CloudFrontWebDistribution API @@ -940,7 +940,7 @@ The following example command uses OpenSSL to generate an RSA key pair with a le openssl genrsa -out private_key.pem 2048 ``` -The resulting file contains both the public and the private key. The following example command extracts the public key from the file named `private_key.pem` and stores it in `public_key.pem`. +The resulting file contains both the public and the private key. The following example command extracts the public key from the file named `private_key.pem` and stores it in `public_key.pem`. ```bash openssl rsa -pubout -in private_key.pem -out public_key.pem @@ -966,4 +966,4 @@ new cloudfront.KeyGroup(this, 'MyKeyGroup', { See: * https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html -* https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html +* https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html diff --git a/packages/@aws-cdk/aws-cloudfront/test/distribution.test.ts b/packages/@aws-cdk/aws-cloudfront/test/distribution.test.ts index 9d8925796a6d8..30afc9c5defe4 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/distribution.test.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/distribution.test.ts @@ -698,7 +698,7 @@ describe('with Lambda@Edge functions', () => { beforeEach(() => { lambdaFunction = new lambda.Function(stack, 'Function', { - runtime: lambda.Runtime.NODEJS, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('whatever'), handler: 'index.handler', }); @@ -728,7 +728,7 @@ describe('with Lambda@Edge functions', () => { EventType: 'origin-request', IncludeBody: true, LambdaFunctionARN: { - Ref: 'FunctionCurrentVersion4E2B2261477a5ae8059bbaa7813f752292c0f65e', + Ref: 'FunctionCurrentVersion4E2B2261c8c3cb9534b15b1bd7452e3a82ec90e1', }, }, ], @@ -798,7 +798,7 @@ describe('with Lambda@Edge functions', () => { { EventType: 'viewer-request', LambdaFunctionARN: { - Ref: 'FunctionCurrentVersion4E2B2261477a5ae8059bbaa7813f752292c0f65e', + Ref: 'FunctionCurrentVersion4E2B2261c8c3cb9534b15b1bd7452e3a82ec90e1', }, }, ], @@ -826,7 +826,7 @@ describe('with Lambda@Edge functions', () => { test('with removable env vars', () => { const envLambdaFunction = new lambda.Function(stack, 'EnvFunction', { - runtime: lambda.Runtime.NODEJS, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('whateverwithenv'), handler: 'index.handler', }); diff --git a/packages/@aws-cdk/aws-cloudfront/test/web-distribution.test.ts b/packages/@aws-cdk/aws-cloudfront/test/web-distribution.test.ts index ef7487bac0076..e4a26668973c2 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/web-distribution.test.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/web-distribution.test.ts @@ -840,7 +840,7 @@ added the ellipsis so a user would know there was more to r...`, const lambdaFunction = new lambda.Function(stack, 'Lambda', { code: lambda.Code.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); new CloudFrontWebDistribution(stack, 'AnAmazingWebsiteProbably', { @@ -871,7 +871,7 @@ added the ellipsis so a user would know there was more to r...`, 'EventType': 'origin-request', 'IncludeBody': true, 'LambdaFunctionARN': { - 'Ref': 'LambdaCurrentVersionDF706F6A97fb843e9bd06fcd2bb15eeace80e13e', + 'Ref': 'LambdaCurrentVersionDF706F6A8cedba3e8e1b3bbf7614644bfafda118', }, }, ], @@ -890,7 +890,7 @@ added the ellipsis so a user would know there was more to r...`, const lambdaFunction = new lambda.Function(stack, 'Lambda', { code: lambda.Code.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); lambdaFunction.addEnvironment('KEY', 'value', { removeInEdge: true }); @@ -928,7 +928,7 @@ added the ellipsis so a user would know there was more to r...`, const lambdaFunction = new lambda.Function(stack, 'Lambda', { code: lambda.Code.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, environment: { KEY: 'value', }, @@ -1324,7 +1324,7 @@ added the ellipsis so a user would know there was more to r...`, const fn = new lambda.Function(stack, 'Lambda', { code: lambda.Code.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const lambdaVersion = new lambda.Version(stack, 'LambdaVersion', { lambda: fn }); diff --git a/packages/@aws-cdk/aws-cloudtrail/README.md b/packages/@aws-cdk/aws-cloudtrail/README.md index 46c5c0a95bd22..871104372439f 100644 --- a/packages/@aws-cdk/aws-cloudtrail/README.md +++ b/packages/@aws-cdk/aws-cloudtrail/README.md @@ -26,7 +26,7 @@ const trail = new cloudtrail.Trail(this, 'CloudTrail'); ``` By default, this will create a new S3 Bucket that CloudTrail will write to, and choose a few other reasonable defaults -such as turning on multi-region and global service events. +such as turning on multi-region and global service events. The defaults for each property and how to override them are all documented on the `TrailProps` interface. ## Log File Validation @@ -72,7 +72,7 @@ import * as logs from '@aws-cdk/aws-logs'; const trail = new cloudtrail.Trail(this, 'CloudTrail', { sendToCloudWatchLogs: true, - cloudWatchLogsRetention: logs.RetentionDays.FOUR_MONTHS, + cloudWatchLogsRetention: logs.RetentionDays.FOUR_MONTHS, }); ``` @@ -91,7 +91,7 @@ The following code filters events for S3 from a specific AWS account and trigger ```ts const myFunctionHandler = new lambda.Function(this, 'MyFunction', { code: lambda.Code.fromAsset('resource/myfunction'), - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', }); @@ -136,7 +136,7 @@ account. These are also known as control plane operations. Learn more about [Man Events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-concepts.html#cloudtrail-concepts-events). By default, a `Trail` logs all management events. However, they can be configured to either be turned off, or to only -log 'Read' or 'Write' events. +log 'Read' or 'Write' events. The following code configures the `Trail` to only track management events that are of type 'Read'. @@ -178,7 +178,7 @@ configures logging of Lambda data events for a specific Function. ```ts const trail = new cloudtrail.Trail(this, 'MyAmazingCloudTrail'); const amazingFunction = new lambda.Function(this, 'AnAmazingFunction', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: "hello.handler", code: lambda.Code.fromAsset("lambda"), }); diff --git a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.test.ts b/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.test.ts index 1492a3c1377b1..4687fc5057b0c 100644 --- a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.test.ts +++ b/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.test.ts @@ -572,7 +572,7 @@ describe('cloudtrail', () => { test('for Lambda function data event', () => { const stack = getTestStack(); const lambdaFunction = new lambda.Function(stack, 'LambdaFunction', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'hello.handler', code: lambda.Code.fromInline('exports.handler = {}'), }); diff --git a/packages/@aws-cdk/aws-codedeploy/test/lambda/custom-deployment-config.test.ts b/packages/@aws-cdk/aws-codedeploy/test/lambda/custom-deployment-config.test.ts index 618479726a3f2..4498ed8522f73 100644 --- a/packages/@aws-cdk/aws-codedeploy/test/lambda/custom-deployment-config.test.ts +++ b/packages/@aws-cdk/aws-codedeploy/test/lambda/custom-deployment-config.test.ts @@ -7,7 +7,7 @@ function mockFunction(stack: cdk.Stack, id: string) { return new lambda.Function(stack, id, { code: lambda.Code.fromInline('mock'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); } function mockAlias(stack: cdk.Stack) { diff --git a/packages/@aws-cdk/aws-codedeploy/test/lambda/deployment-group.test.ts b/packages/@aws-cdk/aws-codedeploy/test/lambda/deployment-group.test.ts index 5dbd5c98258ab..9fc6049e9a2c5 100644 --- a/packages/@aws-cdk/aws-codedeploy/test/lambda/deployment-group.test.ts +++ b/packages/@aws-cdk/aws-codedeploy/test/lambda/deployment-group.test.ts @@ -9,7 +9,7 @@ function mockFunction(stack: cdk.Stack, id: string) { return new lambda.Function(stack, id, { code: lambda.Code.fromInline('mock'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); } function mockAlias(stack: cdk.Stack) { diff --git a/packages/@aws-cdk/aws-codepipeline-actions/README.md b/packages/@aws-cdk/aws-codepipeline-actions/README.md index c616cecd2302e..0d04e0b241187 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/README.md +++ b/packages/@aws-cdk/aws-codepipeline-actions/README.md @@ -762,7 +762,7 @@ const lambdaCode = lambda.Code.fromCfnParameters(); const func = new lambda.Function(this, 'Lambda', { code: lambdaCode, handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // used to make sure each CDK synthesis produces a different Version const version = func.currentVersion; @@ -1125,7 +1125,7 @@ Example: const lambdaInvokeAction = new codepipeline_actions.LambdaInvokeAction({ actionName: 'Lambda', lambda: new lambda.Function(this, 'Func', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline(` const AWS = require('aws-sdk'); diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts index cf6317f20f030..835dc0e0d6819 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts @@ -361,7 +361,7 @@ function stackIncludingLambdaInvokeCodePipeline(props: HelperProps, app?: App) { lambda: new lambda.Function(stack, 'Lambda', { code: lambda.Code.fromCfnParameters(), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), userParameters: props.userParams, userParametersString: props.userParamsString, diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/pipeline.test.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/pipeline.test.ts index ee3fc2cc1e0fc..8a66b5d01854f 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/pipeline.test.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/pipeline.test.ts @@ -434,7 +434,7 @@ describe('pipeline', () => { const lambdaFun = new lambda.Function(stack, 'Function', { code: new lambda.InlineCode('bla'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const pipeline = new codepipeline.Pipeline(stack, 'Pipeline'); diff --git a/packages/@aws-cdk/aws-cognito/README.md b/packages/@aws-cdk/aws-cognito/README.md index 8e2720be896f3..eb41ec1228a2a 100644 --- a/packages/@aws-cdk/aws-cognito/README.md +++ b/packages/@aws-cdk/aws-cognito/README.md @@ -419,7 +419,7 @@ on the construct, as so - ```ts const authChallengeFn = new lambda.Function(this, 'authChallengeFn', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromAsset(path.join(__dirname, 'path/to/asset')), }); @@ -433,7 +433,7 @@ const userpool = new cognito.UserPool(this, 'myuserpool', { }); userpool.addTrigger(cognito.UserPoolOperation.USER_MIGRATION, new lambda.Function(this, 'userMigrationFn', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromAsset(path.join(__dirname, 'path/to/asset')), })); diff --git a/packages/@aws-cdk/aws-config/README.md b/packages/@aws-cdk/aws-config/README.md index 3a66934a43d69..80c5595d2685b 100644 --- a/packages/@aws-cdk/aws-config/README.md +++ b/packages/@aws-cdk/aws-config/README.md @@ -25,7 +25,7 @@ Higher level constructs for initial set-up (delivery channel & configuration rec [AWS Config](https://docs.aws.amazon.com/config/latest/developerguide/WhatIsConfig.html) provides a detailed view of the configuration of AWS resources in your AWS account. This includes how the resources are related to one another and how they were configured in the -past so that you can see how the configurations and relationships change over time. +past so that you can see how the configurations and relationships change over time. This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. @@ -88,7 +88,7 @@ new config.AccessKeysRotated(this, 'AccessKeyRotated'); #### CloudFormation Stack drift detection Checks whether your CloudFormation stack's actual configuration differs, or has drifted, -from it's expected configuration. +from it's expected configuration. ```ts // compliant if stack's status is 'IN_SYNC' @@ -143,7 +143,7 @@ new config.CustomRule(this, 'CustomRule', { ``` When the trigger for a rule occurs, the Lambda function is invoked by publishing an event. -See [example events for AWS Config Rules](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_develop-rules_example-events.html) +See [example events for AWS Config Rules](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_develop-rules_example-events.html) The AWS documentation has examples of Lambda functions for evaluations that are [triggered by configuration changes](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_develop-rules_nodejs-sample.html#event-based-example-rule) and [triggered periodically](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_develop-rules_nodejs-sample.html#periodic-example-rule) @@ -217,7 +217,7 @@ Compliance events are published to an SNS topic. const evalComplianceFn = new lambda.Function(this, 'CustomFunction', { code: lambda.AssetCode.fromInline('exports.handler = (event) => console.log(event);'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // A custom rule that runs on configuration changes of EC2 instances diff --git a/packages/@aws-cdk/aws-config/test/rule.test.ts b/packages/@aws-cdk/aws-config/test/rule.test.ts index a6e125b4d89ec..93f614073687d 100644 --- a/packages/@aws-cdk/aws-config/test/rule.test.ts +++ b/packages/@aws-cdk/aws-config/test/rule.test.ts @@ -41,7 +41,7 @@ describe('rule', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.AssetCode.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -202,7 +202,7 @@ describe('rule', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.AssetCode.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // THEN @@ -219,7 +219,7 @@ describe('rule', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.AssetCode.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // THEN @@ -238,7 +238,7 @@ describe('rule', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('dummy'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/__entrypoint__.js b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/__entrypoint__.js new file mode 100644 index 0000000000000..9df94382cc74e --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/__entrypoint__.js @@ -0,0 +1,118 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.handler = exports.external = void 0; +const https = require("https"); +const url = require("url"); +// for unit tests +exports.external = { + sendHttpRequest: defaultSendHttpRequest, + log: defaultLog, + includeStackTraces: true, + userHandlerIndex: './index', +}; +const CREATE_FAILED_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::CREATE_FAILED'; +const MISSING_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID'; +async function handler(event, context) { + const sanitizedEvent = { ...event, ResponseURL: '...' }; + exports.external.log(JSON.stringify(sanitizedEvent, undefined, 2)); + // ignore DELETE event when the physical resource ID is the marker that + // indicates that this DELETE is a subsequent DELETE to a failed CREATE + // operation. + if (event.RequestType === 'Delete' && event.PhysicalResourceId === CREATE_FAILED_PHYSICAL_ID_MARKER) { + exports.external.log('ignoring DELETE event caused by a failed CREATE event'); + await submitResponse('SUCCESS', event); + return; + } + try { + // invoke the user handler. this is intentionally inside the try-catch to + // ensure that if there is an error it's reported as a failure to + // cloudformation (otherwise cfn waits). + // eslint-disable-next-line @typescript-eslint/no-require-imports + const userHandler = require(exports.external.userHandlerIndex).handler; + const result = await userHandler(sanitizedEvent, context); + // validate user response and create the combined event + const responseEvent = renderResponse(event, result); + // submit to cfn as success + await submitResponse('SUCCESS', responseEvent); + } + catch (e) { + const resp = { + ...event, + Reason: exports.external.includeStackTraces ? e.stack : e.message, + }; + if (!resp.PhysicalResourceId) { + // special case: if CREATE fails, which usually implies, we usually don't + // have a physical resource id. in this case, the subsequent DELETE + // operation does not have any meaning, and will likely fail as well. to + // address this, we use a marker so the provider framework can simply + // ignore the subsequent DELETE. + if (event.RequestType === 'Create') { + exports.external.log('CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored'); + resp.PhysicalResourceId = CREATE_FAILED_PHYSICAL_ID_MARKER; + } + else { + // otherwise, if PhysicalResourceId is not specified, something is + // terribly wrong because all other events should have an ID. + exports.external.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(event)}`); + } + } + // this is an actual error, fail the activity altogether and exist. + await submitResponse('FAILED', resp); + } +} +exports.handler = handler; +function renderResponse(cfnRequest, handlerResponse = {}) { + // if physical ID is not returned, we have some defaults for you based + // on the request type. + const physicalResourceId = handlerResponse.PhysicalResourceId ?? cfnRequest.PhysicalResourceId ?? cfnRequest.RequestId; + // if we are in DELETE and physical ID was changed, it's an error. + if (cfnRequest.RequestType === 'Delete' && physicalResourceId !== cfnRequest.PhysicalResourceId) { + throw new Error(`DELETE: cannot change the physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${handlerResponse.PhysicalResourceId}" during deletion`); + } + // merge request event and result event (result prevails). + return { + ...cfnRequest, + ...handlerResponse, + PhysicalResourceId: physicalResourceId, + }; +} +async function submitResponse(status, event) { + const json = { + Status: status, + Reason: event.Reason ?? status, + StackId: event.StackId, + RequestId: event.RequestId, + PhysicalResourceId: event.PhysicalResourceId || MISSING_PHYSICAL_ID_MARKER, + LogicalResourceId: event.LogicalResourceId, + NoEcho: event.NoEcho, + Data: event.Data, + }; + exports.external.log('submit response to cloudformation', json); + const responseBody = JSON.stringify(json); + const parsedUrl = url.parse(event.ResponseURL); + const req = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { 'content-type': '', 'content-length': responseBody.length }, + }; + await exports.external.sendHttpRequest(req, responseBody); +} +async function defaultSendHttpRequest(options, responseBody) { + return new Promise((resolve, reject) => { + try { + const request = https.request(options, _ => resolve()); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +function defaultLog(fmt, ...params) { + // eslint-disable-next-line no-console + console.log(fmt, ...params); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZWpzLWVudHJ5cG9pbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJub2RlanMtZW50cnlwb2ludC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrQkFBK0I7QUFDL0IsMkJBQTJCO0FBRTNCLGlCQUFpQjtBQUNKLFFBQUEsUUFBUSxHQUFHO0lBQ3RCLGVBQWUsRUFBRSxzQkFBc0I7SUFDdkMsR0FBRyxFQUFFLFVBQVU7SUFDZixrQkFBa0IsRUFBRSxJQUFJO0lBQ3hCLGdCQUFnQixFQUFFLFNBQVM7Q0FDNUIsQ0FBQztBQUVGLE1BQU0sZ0NBQWdDLEdBQUcsd0RBQXdELENBQUM7QUFDbE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/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/ca.crt b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/ca.crt similarity index 100% rename from packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/ca.crt rename to packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/ca.crt diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/client1.domain.tld.crt b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/client1.domain.tld.crt similarity index 100% rename from packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/client1.domain.tld.crt rename to packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/client1.domain.tld.crt diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/client1.domain.tld.key b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/client1.domain.tld.key similarity index 100% rename from packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/client1.domain.tld.key rename to packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/client1.domain.tld.key diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/index.d.ts b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/index.d.ts similarity index 100% rename from packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/index.d.ts rename to packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/index.d.ts diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/index.js b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/index.js similarity index 100% rename from packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/index.js rename to packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/index.js diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/index.ts b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/index.ts similarity index 100% rename from packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/index.ts rename to packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/index.ts diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/server.crt b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/server.crt similarity index 100% rename from packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/server.crt rename to packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/server.crt diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/server.key b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/server.key similarity index 100% rename from packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/server.key rename to packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/server.key diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/__entrypoint__.js b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/__entrypoint__.js deleted file mode 100644 index 3475719002c73..0000000000000 --- a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/__entrypoint__.js +++ /dev/null @@ -1,119 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.handler = exports.external = void 0; -const https = require("https"); -const url = require("url"); -// for unit tests -exports.external = { - sendHttpRequest: defaultSendHttpRequest, - log: defaultLog, - includeStackTraces: true, - userHandlerIndex: './index', -}; -const CREATE_FAILED_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::CREATE_FAILED'; -const MISSING_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID'; -async function handler(event, context) { - exports.external.log(JSON.stringify(event, undefined, 2)); - // ignore DELETE event when the physical resource ID is the marker that - // indicates that this DELETE is a subsequent DELETE to a failed CREATE - // operation. - if (event.RequestType === 'Delete' && event.PhysicalResourceId === CREATE_FAILED_PHYSICAL_ID_MARKER) { - exports.external.log('ignoring DELETE event caused by a failed CREATE event'); - await submitResponse('SUCCESS', event); - return; - } - try { - // invoke the user handler. this is intentionally inside the try-catch to - // ensure that if there is an error it's reported as a failure to - // cloudformation (otherwise cfn waits). - // eslint-disable-next-line @typescript-eslint/no-require-imports - const userHandler = require(exports.external.userHandlerIndex).handler; - const result = await userHandler(event, context); - // validate user response and create the combined event - const responseEvent = renderResponse(event, result); - // submit to cfn as success - await submitResponse('SUCCESS', responseEvent); - } - catch (e) { - const resp = { - ...event, - Reason: exports.external.includeStackTraces ? e.stack : e.message, - }; - if (!resp.PhysicalResourceId) { - // special case: if CREATE fails, which usually implies, we usually don't - // have a physical resource id. in this case, the subsequent DELETE - // operation does not have any meaning, and will likely fail as well. to - // address this, we use a marker so the provider framework can simply - // ignore the subsequent DELETE. - if (event.RequestType === 'Create') { - exports.external.log('CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored'); - resp.PhysicalResourceId = CREATE_FAILED_PHYSICAL_ID_MARKER; - } - else { - // otherwise, if PhysicalResourceId is not specified, something is - // terribly wrong because all other events should have an ID. - exports.external.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(event)}`); - } - } - // this is an actual error, fail the activity altogether and exist. - await submitResponse('FAILED', resp); - } -} -exports.handler = handler; -function renderResponse(cfnRequest, handlerResponse = {}) { - var _a, _b; - // if physical ID is not returned, we have some defaults for you based - // on the request type. - const physicalResourceId = (_b = (_a = handlerResponse.PhysicalResourceId) !== null && _a !== void 0 ? _a : cfnRequest.PhysicalResourceId) !== null && _b !== void 0 ? _b : cfnRequest.RequestId; - // if we are in DELETE and physical ID was changed, it's an error. - if (cfnRequest.RequestType === 'Delete' && physicalResourceId !== cfnRequest.PhysicalResourceId) { - throw new Error(`DELETE: cannot change the physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${handlerResponse.PhysicalResourceId}" during deletion`); - } - // merge request event and result event (result prevails). - return { - ...cfnRequest, - ...handlerResponse, - PhysicalResourceId: physicalResourceId, - }; -} -async function submitResponse(status, event) { - var _a; - const json = { - Status: status, - Reason: (_a = event.Reason) !== null && _a !== void 0 ? _a : status, - StackId: event.StackId, - RequestId: event.RequestId, - PhysicalResourceId: event.PhysicalResourceId || MISSING_PHYSICAL_ID_MARKER, - LogicalResourceId: event.LogicalResourceId, - NoEcho: event.NoEcho, - Data: event.Data, - }; - exports.external.log('submit response to cloudformation', json); - const responseBody = JSON.stringify(json); - const parsedUrl = url.parse(event.ResponseURL); - const req = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { 'content-type': '', 'content-length': responseBody.length }, - }; - await exports.external.sendHttpRequest(req, responseBody); -} -async function defaultSendHttpRequest(options, responseBody) { - return new Promise((resolve, reject) => { - try { - const request = https.request(options, _ => resolve()); - request.on('error', reject); - request.write(responseBody); - request.end(); - } - catch (e) { - reject(e); - } - }); -} -function defaultLog(fmt, ...params) { - // eslint-disable-next-line no-console - console.log(fmt, ...params); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZWpzLWVudHJ5cG9pbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJub2RlanMtZW50cnlwb2ludC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrQkFBK0I7QUFDL0IsMkJBQTJCO0FBRTNCLGlCQUFpQjtBQUNKLFFBQUEsUUFBUSxHQUFHO0lBQ3RCLGVBQWUsRUFBRSxzQkFBc0I7SUFDdkMsR0FBRyxFQUFFLFVBQVU7SUFDZixrQkFBa0IsRUFBRSxJQUFJO0lBQ3hCLGdCQUFnQixFQUFFLFNBQVM7Q0FDNUIsQ0FBQztBQUVGLE1BQU0sZ0NBQWdDLEdBQUcsd0RBQXdELENBQUM7QUFDbEcsTUFBTSwwQkFBMEIsR0FBRyw4REFBOEQsQ0FBQztBQVczRixLQUFLLFVBQVUsT0FBTyxDQUFDLEtBQWtELEVBQUUsT0FBMEI7SUFDMUcsZ0JBQVEsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxLQUFLLEVBQUUsU0FBUyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFFbEQsdUVBQXVFO0lBQ3ZFLHVFQUF1RTtJQUN2RSxhQUFhO0lBQ2IsSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsSUFBSSxLQUFLLENBQUMsa0JBQWtCLEtBQUssZ0NBQWdDLEVBQUU7UUFDbkcsZ0JBQVEsQ0FBQyxHQUFHLENBQUMsdURBQXVELENBQUMsQ0FBQztRQUN0RSxNQUFNLGNBQWMsQ0FBQ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HJlc29sdmUoKSk7XG4gICAgICByZXF1ZXN0Lm9uKCdlcnJvcicsIHJlamVjdCk7XG4gICAgICByZXF1ZXN0LndyaXRlKHJlc3BvbnNlQm9keSk7XG4gICAgICByZXF1ZXN0LmVuZCgpO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIHJlamVjdChlKTtcbiAgICB9XG4gIH0pO1xufVxuXG5mdW5jdGlvbiBkZWZhdWx0TG9nKGZtdDogc3RyaW5nLCAuLi5wYXJhbXM6IGFueVtdKSB7XG4gIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1jb25zb2xlXG4gIGNvbnNvbGUubG9nKGZtdCwgLi4ucGFyYW1zKTtcbn1cbiJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/cdk-ec2-client-vpn-endpoint.template.json b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/cdk-ec2-client-vpn-endpoint.template.json index 518a7f60cafe4..fdca2e3fc84b8 100644 --- a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/cdk-ec2-client-vpn-endpoint.template.json +++ b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/cdk-ec2-client-vpn-endpoint.template.json @@ -83,7 +83,7 @@ "Properties": { "Code": { "S3Bucket": { - "Ref": "AssetParametersc0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5fS3Bucket42BD8ED5" + "Ref": "AssetParameters1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8aS3Bucket4E8C33C0" }, "S3Key": { "Fn::Join": [ @@ -96,7 +96,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParametersc0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5fS3VersionKeyA7C3DEE3" + "Ref": "AssetParameters1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8aS3VersionKeyE2343283" } ] } @@ -109,7 +109,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParametersc0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5fS3VersionKeyA7C3DEE3" + "Ref": "AssetParameters1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8aS3VersionKeyE2343283" } ] } @@ -128,7 +128,7 @@ "Arn" ] }, - "Runtime": "nodejs12.x" + "Runtime": "nodejs14.x" }, "DependsOn": [ "CustomACMImportCertificatesCustomResourceProviderRole2CE46D14" @@ -624,17 +624,17 @@ } }, "Parameters": { - "AssetParametersc0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5fS3Bucket42BD8ED5": { + "AssetParameters1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8aS3Bucket4E8C33C0": { "Type": "String", - "Description": "S3 bucket for asset \"c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f\"" + "Description": "S3 bucket for asset \"1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a\"" }, - "AssetParametersc0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5fS3VersionKeyA7C3DEE3": { + "AssetParameters1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8aS3VersionKeyE2343283": { "Type": "String", - "Description": "S3 key for asset version \"c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f\"" + "Description": "S3 key for asset version \"1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a\"" }, - "AssetParametersc0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5fArtifactHash18BB2B9F": { + "AssetParameters1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8aArtifactHashEE06FD36": { "Type": "String", - "Description": "Artifact hash for asset \"c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f\"" + "Description": "Artifact hash for asset \"1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a\"" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/cdk.out index 90bef2e09ad39..588d7b269d34f 100644 --- a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/cdk.out @@ -1 +1 @@ -{"version":"17.0.0"} \ No newline at end of file +{"version":"20.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/integ.json b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/integ.json index bf1ebb8f937c8..f0111079d39eb 100644 --- a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/integ.json +++ b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/integ.json @@ -1,7 +1,7 @@ { - "version": "18.0.0", + "version": "20.0.0", "testCases": { - "aws-ec2/test/integ.client-vpn-endpoint": { + "integ.client-vpn-endpoint": { "stacks": [ "cdk-ec2-client-vpn-endpoint" ], diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/manifest.json index 71a713d31c6f4..7fa8fc14e2cc6 100644 --- a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "17.0.0", + "version": "20.0.0", "artifacts": { "Tree": { "type": "cdk:tree", @@ -19,13 +19,13 @@ { "type": "aws:cdk:asset", "data": { - "path": "asset.c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f", - "id": "c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f", + "path": "asset.1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a", + "id": "1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a", "packaging": "zip", - "sourceHash": "c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f", - "s3BucketParameter": "AssetParametersc0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5fS3Bucket42BD8ED5", - "s3KeyParameter": "AssetParametersc0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5fS3VersionKeyA7C3DEE3", - "artifactHashParameter": "AssetParametersc0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5fArtifactHash18BB2B9F" + "sourceHash": "1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a", + "s3BucketParameter": "AssetParameters1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8aS3Bucket4E8C33C0", + "s3KeyParameter": "AssetParameters1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8aS3VersionKeyE2343283", + "artifactHashParameter": "AssetParameters1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8aArtifactHashEE06FD36" } } ], @@ -53,22 +53,22 @@ "data": "CustomACMImportCertificatesCustomResourceProviderHandler2EB12457" } ], - "/cdk-ec2-client-vpn-endpoint/AssetParameters/c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/S3Bucket": [ + "/cdk-ec2-client-vpn-endpoint/AssetParameters/1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/S3Bucket": [ { "type": "aws:cdk:logicalId", - "data": "AssetParametersc0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5fS3Bucket42BD8ED5" + "data": "AssetParameters1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8aS3Bucket4E8C33C0" } ], - "/cdk-ec2-client-vpn-endpoint/AssetParameters/c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/S3VersionKey": [ + "/cdk-ec2-client-vpn-endpoint/AssetParameters/1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/S3VersionKey": [ { "type": "aws:cdk:logicalId", - "data": "AssetParametersc0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5fS3VersionKeyA7C3DEE3" + "data": "AssetParameters1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8aS3VersionKeyE2343283" } ], - "/cdk-ec2-client-vpn-endpoint/AssetParameters/c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/ArtifactHash": [ + "/cdk-ec2-client-vpn-endpoint/AssetParameters/1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/ArtifactHash": [ { "type": "aws:cdk:logicalId", - "data": "AssetParametersc0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5fArtifactHash18BB2B9F" + "data": "AssetParameters1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8aArtifactHashEE06FD36" } ], "/cdk-ec2-client-vpn-endpoint/Vpc/Resource": [ diff --git a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/tree.json b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/tree.json index c36941e13adfd..35d46886c2ad6 100644 --- a/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-ec2/test/client-vpn-endpoint.integ.snapshot/tree.json @@ -100,13 +100,13 @@ "id": "AssetParameters", "path": "cdk-ec2-client-vpn-endpoint/AssetParameters", "children": { - "c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f": { - "id": "c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f", - "path": "cdk-ec2-client-vpn-endpoint/AssetParameters/c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f", + "1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a": { + "id": "1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a", + "path": "cdk-ec2-client-vpn-endpoint/AssetParameters/1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a", "children": { "S3Bucket": { "id": "S3Bucket", - "path": "cdk-ec2-client-vpn-endpoint/AssetParameters/c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/S3Bucket", + "path": "cdk-ec2-client-vpn-endpoint/AssetParameters/1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/S3Bucket", "constructInfo": { "fqn": "@aws-cdk/core.CfnParameter", "version": "0.0.0" @@ -114,7 +114,7 @@ }, "S3VersionKey": { "id": "S3VersionKey", - "path": "cdk-ec2-client-vpn-endpoint/AssetParameters/c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/S3VersionKey", + "path": "cdk-ec2-client-vpn-endpoint/AssetParameters/1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/S3VersionKey", "constructInfo": { "fqn": "@aws-cdk/core.CfnParameter", "version": "0.0.0" @@ -122,7 +122,7 @@ }, "ArtifactHash": { "id": "ArtifactHash", - "path": "cdk-ec2-client-vpn-endpoint/AssetParameters/c0eca79e4277becf35cc23c67499f47e70fd50078e025e595c51ed97b9699c5f/ArtifactHash", + "path": "cdk-ec2-client-vpn-endpoint/AssetParameters/1ef463e71119677d383a964bbb0740f0c4de382c21d5a8d68be98334d514ae8a/ArtifactHash", "constructInfo": { "fqn": "@aws-cdk/core.CfnParameter", "version": "0.0.0" diff --git a/packages/@aws-cdk/aws-ec2/test/integ.client-vpn-endpoint.ts b/packages/@aws-cdk/aws-ec2/test/integ.client-vpn-endpoint.ts index 878f8f057bb3d..dbb8f5b05997c 100644 --- a/packages/@aws-cdk/aws-ec2/test/integ.client-vpn-endpoint.ts +++ b/packages/@aws-cdk/aws-ec2/test/integ.client-vpn-endpoint.ts @@ -42,7 +42,7 @@ class ImportCertificates extends CoreConstruct { const serviceToken = CustomResourceProvider.getOrCreate(this, IMPORT_CERTIFICATES_RESOURCE_TYPE, { codeDirectory: path.join(__dirname, 'import-certificates-handler'), - runtime: CustomResourceProviderRuntime.NODEJS_12, + runtime: CustomResourceProviderRuntime.NODEJS_14_X, policyStatements: [{ Effect: 'Allow', Action: ['acm:ImportCertificate', 'acm:DeleteCertificate'], diff --git a/packages/@aws-cdk/aws-events-targets/README.md b/packages/@aws-cdk/aws-events-targets/README.md index 34157fef412b5..0b720411a3097 100644 --- a/packages/@aws-cdk/aws-events-targets/README.md +++ b/packages/@aws-cdk/aws-events-targets/README.md @@ -51,7 +51,7 @@ triggered for every events from `aws.ec2` source. You can optionally attach a import * as lambda from '@aws-cdk/aws-lambda'; const fn = new lambda.Function(this, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = handler.toString()`), }); @@ -243,7 +243,7 @@ const rule = new events.Rule(this, 'Rule', { const fn = new lambda.Function( this, 'MyFunc', { handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline( 'exports.handler = e => {}' ), } ); diff --git a/packages/@aws-cdk/aws-kinesisfirehose/README.md b/packages/@aws-cdk/aws-kinesisfirehose/README.md index 2db9f79e6ba30..06c5f443175ca 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose/README.md +++ b/packages/@aws-cdk/aws-kinesisfirehose/README.md @@ -287,7 +287,7 @@ threshold (the "buffer interval"), whichever happens first. You can configure th thresholds based on the capabilities of the destination and your use-case. By default, the buffer size is 5 MiB and the buffer interval is 5 minutes. -```ts +```ts // Increase the buffer interval and size to 10 minutes and 8 MiB, respectively declare const bucket: s3.Bucket; const destination = new destinations.S3Bucket(bucket, { @@ -402,7 +402,7 @@ times by default, but can be configured using `retries` in the processor configu // Provide a Lambda function that will transform records before delivery, with custom // buffering and retry configuration const lambdaFunction = new lambda.Function(this, 'Processor', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromAsset(path.join(__dirname, 'process-records')), }); diff --git a/packages/@aws-cdk/aws-lambda-destinations/README.md b/packages/@aws-cdk/aws-lambda-destinations/README.md index 8e10b8c342ffe..ea2fc1130af51 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/README.md +++ b/packages/@aws-cdk/aws-lambda-destinations/README.md @@ -30,7 +30,7 @@ import * as sns from '@aws-cdk/aws-sns'; const myTopic = new sns.Topic(this, 'Topic'); const myFn = new lambda.Function(this, 'Fn', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')), // sns topic for successful invocations @@ -47,7 +47,7 @@ import * as sqs from '@aws-cdk/aws-sqs'; const deadLetterQueue = new sqs.Queue(this, 'DeadLetterQueue'); const myFn = new lambda.Function(this, 'Fn', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('// your code'), // sqs queue for unsuccessful invocations @@ -135,7 +135,7 @@ invocation record: declare const destinationFn: lambda.Function; const sourceFn = new lambda.Function(this, 'Source', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')), // auto-extract on success diff --git a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.test.ts b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.test.ts index 5a94887c5673b..2b0fa9431c827 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.test.ts +++ b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.test.ts @@ -14,7 +14,7 @@ beforeEach(() => { const lambdaProps = { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }; test('event bus as destination', () => { diff --git a/packages/@aws-cdk/aws-lambda/test/alias.test.ts b/packages/@aws-cdk/aws-lambda/test/alias.test.ts index 91a86d23cad1a..970a06ce253b8 100644 --- a/packages/@aws-cdk/aws-lambda/test/alias.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/alias.test.ts @@ -11,7 +11,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version = fn.addVersion('1'); @@ -37,7 +37,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); new lambda.Alias(stack, 'Alias', { @@ -58,7 +58,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version = fn.addVersion('NewVersion'); @@ -84,7 +84,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version1 = fn.addVersion('1'); @@ -114,7 +114,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const pce = 5; @@ -147,7 +147,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version = fn.currentVersion; @@ -178,7 +178,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version = fn.currentVersion; @@ -221,7 +221,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN: Alias provisionedConcurrencyConfig less than 0 @@ -256,7 +256,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version = fn.currentVersion; @@ -273,7 +273,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version = fn.currentVersion; @@ -309,7 +309,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'fn', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -355,7 +355,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'fn', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { aliasName: 'prod', @@ -396,7 +396,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { @@ -435,7 +435,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { @@ -481,7 +481,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { @@ -511,7 +511,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { @@ -532,7 +532,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { @@ -553,7 +553,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { @@ -586,7 +586,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { @@ -611,7 +611,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { @@ -637,7 +637,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const aliasName = 'prod'; const alias = new lambda.Alias(stack, 'Alias', { diff --git a/packages/@aws-cdk/aws-lambda/test/code.test.ts b/packages/@aws-cdk/aws-lambda/test/code.test.ts index 11d54f95e7c12..46b795cf6831b 100644 --- a/packages/@aws-cdk/aws-lambda/test/code.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/code.test.ts @@ -15,7 +15,7 @@ describe('code', () => { expect(() => defineFunction(lambda.Code.fromInline('boom'), lambda.Runtime.JAVA_8)).toThrow(/Inline source not allowed for java8/); }); test('fails if larger than 4096 bytes', () => { - expect(() => defineFunction(lambda.Code.fromInline(generateRandomString(4097)), lambda.Runtime.NODEJS_10_X)) + expect(() => defineFunction(lambda.Code.fromInline(generateRandomString(4097)), lambda.Runtime.NODEJS_14_X)) .toThrow(/Lambda source is too large, must be <= 4096 but is 4097/); }); }); @@ -38,13 +38,13 @@ describe('code', () => { // WHEN new lambda.Function(stack, 'Func1', { handler: 'foom', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: directoryAsset, }); new lambda.Function(stack, 'Func2', { handler: 'foom', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: directoryAsset, }); @@ -66,7 +66,7 @@ describe('code', () => { // WHEN new lambda.Function(stack, 'Func1', { code: lambda.Code.fromAsset(location), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'foom', }); @@ -88,14 +88,14 @@ describe('code', () => { const stack1 = new cdk.Stack(app, 'Stack1'); new lambda.Function(stack1, 'Func', { code: asset, - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'foom', }); const stack2 = new cdk.Stack(app, 'Stack2'); expect(() => new lambda.Function(stack2, 'Func', { code: asset, - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'foom', })).toThrow(/already associated/); }); @@ -107,7 +107,7 @@ describe('code', () => { const code = new lambda.CfnParametersCode(); new lambda.Function(stack, 'Function', { code, - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', }); @@ -153,7 +153,7 @@ describe('code', () => { new lambda.Function(stack, 'Function', { code, - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', }); @@ -541,7 +541,7 @@ describe('code', () => { }); }); -function defineFunction(code: lambda.Code, runtime: lambda.Runtime = lambda.Runtime.NODEJS_10_X) { +function defineFunction(code: lambda.Code, runtime: lambda.Runtime = lambda.Runtime.NODEJS_14_X) { const stack = new cdk.Stack(); return new lambda.Function(stack, 'Func', { handler: 'foom', diff --git a/packages/@aws-cdk/aws-lambda/test/function-hash.test.ts b/packages/@aws-cdk/aws-lambda/test/function-hash.test.ts index 9cbede76762dd..cd7098287198d 100644 --- a/packages/@aws-cdk/aws-lambda/test/function-hash.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/function-hash.test.ts @@ -91,7 +91,7 @@ describe('function hash', () => { const stack2 = new Stack(); const fn2 = new lambda.Function(stack2, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromAsset(path.join(__dirname, 'my-lambda-handler')), handler: 'index.handler', environment: { @@ -100,7 +100,7 @@ describe('function hash', () => { }); expect(calculateFunctionHash(fn1)).toEqual('528dd04e66817b3b439b5e9a17d239c9'); - expect(calculateFunctionHash(fn2)).toEqual('0f168f0772463e8e547bb3800937e54d'); + expect(calculateFunctionHash(fn2)).toEqual('d2387f9fda6c27296931cf4c57be82d9'); }); test('inline code change impacts the hash', () => { @@ -113,13 +113,13 @@ describe('function hash', () => { const stack2 = new Stack(); const fn2 = new lambda.Function(stack2, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo bar'), handler: 'index.handler', }); expect(calculateFunctionHash(fn1)).toEqual('71fe99b1b2c3eae062ccc42144608827'); - expect(calculateFunctionHash(fn2)).toEqual('ffedf6424a18a594a513129dc97bf53c'); + expect(calculateFunctionHash(fn2)).toEqual('df536bcbc0a214971aa22d9d3cf259d4'); }); describe('lambda layers', () => { diff --git a/packages/@aws-cdk/aws-lambda/test/function-url.test.ts b/packages/@aws-cdk/aws-lambda/test/function-url.test.ts index 89b6747e831e2..06fc55f04f7b2 100644 --- a/packages/@aws-cdk/aws-lambda/test/function-url.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/function-url.test.ts @@ -10,7 +10,7 @@ describe('FunctionUrl', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -36,7 +36,7 @@ describe('FunctionUrl', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -94,7 +94,7 @@ describe('FunctionUrl', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const aliasName = 'prod'; const alias = new lambda.Alias(stack, 'Alias', { @@ -121,7 +121,7 @@ describe('FunctionUrl', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version = new lambda.Version(stack, 'Version', { lambda: fn, @@ -146,7 +146,7 @@ describe('FunctionUrl', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const fnUrl = new lambda.FunctionUrl(stack, 'FunctionUrl', { function: fn, diff --git a/packages/@aws-cdk/aws-lambda/test/function.test.ts b/packages/@aws-cdk/aws-lambda/test/function.test.ts index 3f883e751517c..89e95aee856fc 100644 --- a/packages/@aws-cdk/aws-lambda/test/function.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/function.test.ts @@ -26,7 +26,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', { @@ -50,7 +50,7 @@ describe('function', () => { Code: { ZipFile: 'foo' }, Handler: 'index.handler', Role: { 'Fn::GetAtt': ['MyLambdaServiceRole4539ECB6', 'Arn'] }, - Runtime: 'nodejs10.x', + Runtime: 'nodejs14.x', }, DependsOn: ['MyLambdaServiceRole4539ECB6'], }); @@ -61,7 +61,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, initialPolicy: [new iam.PolicyStatement({ actions: ['*'], resources: ['*'] })], }); Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', { @@ -103,7 +103,7 @@ describe('function', () => { Code: { ZipFile: 'foo' }, Handler: 'index.handler', Role: { 'Fn::GetAtt': ['MyLambdaServiceRole4539ECB6', 'Arn'] }, - Runtime: 'nodejs10.x', + Runtime: 'nodejs14.x', }, DependsOn: ['MyLambdaServiceRoleDefaultPolicy5BBC6F68', 'MyLambdaServiceRole4539ECB6'], }); @@ -639,7 +639,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, functionName: 'OneFunctionToRuleThemAll', deadLetterQueueEnabled: true, }); @@ -707,7 +707,7 @@ describe('function', () => { 'Arn', ], }, - Runtime: 'nodejs10.x', + Runtime: 'nodejs14.x', DeadLetterConfig: { TargetArn: { 'Fn::GetAtt': [ @@ -731,7 +731,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterQueueEnabled: true, }); @@ -757,7 +757,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterQueueEnabled: false, }); @@ -772,7 +772,7 @@ describe('function', () => { 'Arn', ], }, - Runtime: 'nodejs10.x', + Runtime: 'nodejs14.x', }); }); @@ -787,7 +787,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterQueue: dlQueue, }); @@ -832,7 +832,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterQueueEnabled: true, deadLetterQueue: dlQueue, }); @@ -878,7 +878,7 @@ describe('function', () => { expect(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterQueueEnabled: false, deadLetterQueue: dlQueue, })).toThrow(/deadLetterQueue defined but deadLetterQueueEnabled explicitly set to false/); @@ -892,7 +892,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterTopic: dlTopic, }); @@ -927,7 +927,7 @@ describe('function', () => { expect(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterQueueEnabled: false, deadLetterTopic: dlTopic, })).toThrow(/deadLetterQueue and deadLetterTopic cannot be specified together at the same time/); @@ -941,7 +941,7 @@ describe('function', () => { expect(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterQueueEnabled: true, deadLetterTopic: dlTopic, })).toThrow(/deadLetterQueue and deadLetterTopic cannot be specified together at the same time/); @@ -956,7 +956,7 @@ describe('function', () => { expect(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterQueue: dlQueue, deadLetterTopic: dlTopic, })).toThrow(/deadLetterQueue and deadLetterTopic cannot be specified together at the same time/); @@ -968,7 +968,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, tracing: lambda.Tracing.ACTIVE, }); @@ -1006,7 +1006,7 @@ describe('function', () => { 'Arn', ], }, - Runtime: 'nodejs10.x', + Runtime: 'nodejs14.x', TracingConfig: { Mode: 'Active', }, @@ -1024,7 +1024,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, tracing: lambda.Tracing.PASS_THROUGH, }); @@ -1062,7 +1062,7 @@ describe('function', () => { 'Arn', ], }, - Runtime: 'nodejs10.x', + Runtime: 'nodejs14.x', TracingConfig: { Mode: 'PassThrough', }, @@ -1080,7 +1080,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, tracing: lambda.Tracing.DISABLED, }); @@ -1098,7 +1098,7 @@ describe('function', () => { 'Arn', ], }, - Runtime: 'nodejs10.x', + Runtime: 'nodejs14.x', }, DependsOn: [ 'MyLambdaServiceRole4539ECB6', @@ -1132,7 +1132,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -1162,7 +1162,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const service = new iam.ServicePrincipal('apigateway.amazonaws.com'); @@ -1188,7 +1188,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const account = new iam.AccountPrincipal('123456789012'); @@ -1214,7 +1214,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const account = new iam.ArnPrincipal('arn:aws:iam::123456789012:role/someRole'); @@ -1240,7 +1240,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const service = new iam.ServicePrincipal('elasticloadbalancing.amazonaws.com'); @@ -1269,7 +1269,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -1301,7 +1301,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -1402,7 +1402,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // THEN @@ -1421,7 +1421,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); let bindTarget; @@ -1513,10 +1513,10 @@ describe('function', () => { // THEN expect(() => new lambda.Function(stack, 'Function', { layers: [layer], - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('exports.main = function() { console.log("DONE"); }'), handler: 'index.main', - })).toThrow(/nodejs10.x is not in \[nodejs14.x\]/); + })).toThrow(/nodejs16.x is not in \[nodejs14.x\]/); }); test('using more than 5 layers', () => { @@ -1524,13 +1524,13 @@ describe('function', () => { const stack = new cdk.Stack(undefined, 'TestStack'); const layers = new Array(6).fill(lambda.LayerVersion.fromLayerVersionAttributes(stack, 'TestLayer', { layerVersionArn: 'arn:aws:...', - compatibleRuntimes: [lambda.Runtime.NODEJS_10_X], + compatibleRuntimes: [lambda.Runtime.NODEJS_14_X], })); // THEN expect(() => new lambda.Function(stack, 'Function', { layers, - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('exports.main = function() { console.log("DONE"); }'), handler: 'index.main', })).toThrow(/Unable to add layer:/); @@ -1614,7 +1614,7 @@ describe('function', () => { // WHEN new lambda.Function(stack, 'fn', { code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.bam', events: [ new EventSource(), @@ -1690,7 +1690,7 @@ describe('function', () => { new lambda.Function(stack, 'fn', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, onFailure: { bind: () => ({ destination: 'on-failure-arn' }), }, @@ -1726,7 +1726,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'fn', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, maxEventAge: cdk.Duration.hours(1), }); @@ -1760,7 +1760,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'fn', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -1891,7 +1891,7 @@ describe('function', () => { // WHEN/THEN expect(() => new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline(''), })).toThrow(/Lambda inline code cannot be empty/); }); @@ -1900,7 +1900,7 @@ describe('function', () => { const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), }); const logGroup = fn.logGroup; @@ -1918,7 +1918,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), deadLetterQueue: dlQueue, }); @@ -1940,7 +1940,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), deadLetterTopic: dlTopic, }); @@ -1957,7 +1957,7 @@ describe('function', () => { const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), deadLetterQueueEnabled: true, }); @@ -1974,7 +1974,7 @@ describe('function', () => { const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), }); const deadLetterQueue = fn.deadLetterQueue; @@ -1988,7 +1988,7 @@ describe('function', () => { const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), logRetention: logs.RetentionDays.FIVE_DAYS, }); @@ -2015,7 +2015,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version1 = fn.latestVersion; @@ -2043,7 +2043,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, environment: { SOME: 'Variable', }, @@ -2234,7 +2234,7 @@ describe('function', () => { expect(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, profilingGroup: new ProfilingGroup(stack, 'ProfilingGroup'), environment: { AWS_CODEGURU_PROFILER_GROUP_ARN: 'profiler_group_arn', @@ -2580,7 +2580,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, codeSigningConfig, }); @@ -2745,7 +2745,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -2769,7 +2769,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -2818,7 +2818,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); fn.addFunctionUrl(); diff --git a/packages/@aws-cdk/aws-lambda/test/lambda-insights.test.ts b/packages/@aws-cdk/aws-lambda/test/lambda-insights.test.ts index ac758ab4be5ad..a2e3f5a9cc484 100644 --- a/packages/@aws-cdk/aws-lambda/test/lambda-insights.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/lambda-insights.test.ts @@ -17,7 +17,7 @@ function functionWithInsightsVersion( functionName: id, code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, architecture, insightsVersion, }); diff --git a/packages/@aws-cdk/aws-lambda/test/lambda-version.test.ts b/packages/@aws-cdk/aws-lambda/test/lambda-version.test.ts index 84b96e4f55505..12ddeac1f9932 100644 --- a/packages/@aws-cdk/aws-lambda/test/lambda-version.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/lambda-version.test.ts @@ -31,7 +31,7 @@ describe('lambda version', () => { // GIVEN const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'Fn', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); @@ -63,7 +63,7 @@ describe('lambda version', () => { // GIVEN const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'Fn', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); @@ -108,7 +108,7 @@ describe('lambda version', () => { // GIVEN const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'Fn', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); @@ -124,7 +124,7 @@ describe('lambda version', () => { }, FunctionVersion: { 'Fn::GetAtt': [ - 'FnCurrentVersion17A89ABBab5c765f3c55e4e61583b51b00a95742', + 'FnCurrentVersion17A89ABB7527c444753eb2d3d507176640bb9882', 'Version', ], }, @@ -136,14 +136,14 @@ describe('lambda version', () => { // GIVEN const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'Fn', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); const version = fn.currentVersion; // THEN - expect(stack.resolve(version.edgeArn)).toEqual({ Ref: 'FnCurrentVersion17A89ABB19ed45993ff69fd011ae9fd4ab6e2005' }); + expect(stack.resolve(version.edgeArn)).toEqual({ Ref: 'FnCurrentVersion17A89ABBf64bbf789fffad4a1acead2dead411ba' }); }); test('edgeArn throws with $LATEST', () => { @@ -189,7 +189,7 @@ describe('lambda version', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version = new lambda.Version(stack, 'Version', { lambda: fn, diff --git a/packages/@aws-cdk/aws-lambda/test/layers.test.ts b/packages/@aws-cdk/aws-lambda/test/layers.test.ts index 5f818c480e2da..95f555263f775 100644 --- a/packages/@aws-cdk/aws-lambda/test/layers.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/layers.test.ts @@ -15,7 +15,7 @@ describe('layers', () => { // WHEN new lambda.LayerVersion(stack, 'LayerVersion', { code, - compatibleRuntimes: [lambda.Runtime.NODEJS_10_X], + compatibleRuntimes: [lambda.Runtime.NODEJS_14_X], }); // THEN @@ -24,7 +24,7 @@ describe('layers', () => { S3Bucket: stack.resolve(bucket.bucketName), S3Key: 'ObjectKey', }, - CompatibleRuntimes: ['nodejs10.x'], + CompatibleRuntimes: ['nodejs14.x'], }); }); @@ -35,7 +35,7 @@ describe('layers', () => { const code = new lambda.S3Code(bucket, 'ObjectKey'); const layer = new lambda.LayerVersion(stack, 'LayerVersion', { code, - compatibleRuntimes: [lambda.Runtime.NODEJS_10_X], + compatibleRuntimes: [lambda.Runtime.NODEJS_14_X], }); // WHEN diff --git a/packages/@aws-cdk/aws-lambda/test/vpc-lambda.test.ts b/packages/@aws-cdk/aws-lambda/test/vpc-lambda.test.ts index d8ad105edaa6d..f1811b59e8f03 100644 --- a/packages/@aws-cdk/aws-lambda/test/vpc-lambda.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/vpc-lambda.test.ts @@ -21,7 +21,7 @@ describe('lambda + vpc', () => { fn = new lambda.Function(stack, 'Lambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, vpc: vpc, allowAllOutbound: false, }); @@ -47,7 +47,7 @@ describe('lambda + vpc', () => { new lambda.Function(stack, 'LambdaWithCustomSG', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, vpc, securityGroup: new ec2.SecurityGroup(stack, 'CustomSecurityGroupX', { vpc }), }); @@ -70,7 +70,7 @@ describe('lambda + vpc', () => { new lambda.Function(stack, 'LambdaWithCustomSGList', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, vpc, securityGroups: [ new ec2.SecurityGroup(stack, 'CustomSecurityGroupA', { vpc }), @@ -98,7 +98,7 @@ describe('lambda + vpc', () => { new lambda.Function(stack, 'LambdaWithWrongProps', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, vpc, securityGroup: new ec2.SecurityGroup(stack, 'CustomSecurityGroupB', { vpc }), securityGroups: [ @@ -189,7 +189,7 @@ describe('lambda + vpc', () => { const lambdaFn = new lambda.Function(stack, 'Lambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -208,7 +208,7 @@ describe('lambda + vpc', () => { allowPublicSubnet: true, code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, vpc, vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC }, }); @@ -236,7 +236,7 @@ describe('lambda + vpc', () => { new lambda.Function(stack, 'PrivateLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, vpc, vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT }, }); @@ -272,7 +272,7 @@ describe('lambda + vpc', () => { new lambda.Function(stack, 'IsolatedLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, vpc, vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_ISOLATED }, }); @@ -317,7 +317,7 @@ describe('lambda + vpc', () => { new lambda.Function(stack, 'PublicLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, vpc, vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC }, }); diff --git a/packages/@aws-cdk/aws-logs-destinations/test/lambda.test.ts b/packages/@aws-cdk/aws-logs-destinations/test/lambda.test.ts index f5a80285c8146..19332cb4de198 100644 --- a/packages/@aws-cdk/aws-logs-destinations/test/lambda.test.ts +++ b/packages/@aws-cdk/aws-logs-destinations/test/lambda.test.ts @@ -14,7 +14,7 @@ beforeEach(() => { fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); logGroup = new logs.LogGroup(stack, 'LogGroup'); }); diff --git a/packages/@aws-cdk/aws-rds/README.md b/packages/@aws-cdk/aws-rds/README.md index 76290625b3d90..6a477438c415f 100644 --- a/packages/@aws-cdk/aws-rds/README.md +++ b/packages/@aws-cdk/aws-rds/README.md @@ -668,7 +668,7 @@ const cluster = new rds.ServerlessCluster(this, 'AnotherCluster', { declare const code: lambda.Code; const fn = new lambda.Function(this, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code, environment: { @@ -685,8 +685,8 @@ To learn more about using the Data API, see the [documentation](https://docs.aws ### Default VPC -The `vpc` parameter is optional. +The `vpc` parameter is optional. If not provided, the cluster will be created in the default VPC of the account and region. -As this VPC is not deployed with AWS CDK, you can't configure the `vpcSubnets`, `subnetGroup` or `securityGroups` of the Aurora Serverless Cluster. +As this VPC is not deployed with AWS CDK, you can't configure the `vpcSubnets`, `subnetGroup` or `securityGroups` of the Aurora Serverless Cluster. If you want to provide one of `vpcSubnets`, `subnetGroup` or `securityGroups` parameter, please provide a `vpc`. diff --git a/packages/@aws-cdk/aws-rds/test/instance.test.ts b/packages/@aws-cdk/aws-rds/test/instance.test.ts index 695342f02f255..8ddc2b92dd697 100644 --- a/packages/@aws-cdk/aws-rds/test/instance.test.ts +++ b/packages/@aws-cdk/aws-rds/test/instance.test.ts @@ -505,7 +505,7 @@ describe('instance', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('dummy'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN diff --git a/packages/@aws-cdk/aws-s3-notifications/README.md b/packages/@aws-cdk/aws-s3-notifications/README.md index 75fba9152e2b8..c16b206f52854 100644 --- a/packages/@aws-cdk/aws-s3-notifications/README.md +++ b/packages/@aws-cdk/aws-s3-notifications/README.md @@ -45,7 +45,7 @@ import * as lambda from '@aws-cdk/aws-lambda'; const bucket = new s3.Bucket(this, 'Bucket'); const fn = new lambda.Function(this, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')), }); diff --git a/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts b/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts index d6e563a4438ca..1b886de0f157c 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts +++ b/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts @@ -9,13 +9,13 @@ test('add notifications to multiple functions', () => { const stack = new Stack(); const bucket = new s3.Bucket(stack, 'MyBucket'); const fn1 = new lambda.Function(stack, 'MyFunction1', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); const fn2 = new lambda.Function(stack, 'MyFunction2', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); @@ -80,7 +80,7 @@ test('lambda in a different stack as notification target', () => { const lambdaFunction = new lambda.Function(lambdaStack, 'lambdaFunction', { code: lambda.Code.fromInline('whatever'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const bucket = new s3.Bucket(bucketStack, 'bucket'); @@ -121,7 +121,7 @@ test('lambda as notification target', () => { const stack = new Stack(); const bucketA = new s3.Bucket(stack, 'MyBucket'); const fn = new lambda.Function(stack, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); @@ -188,7 +188,7 @@ test('permissions are added as a dependency to the notifications resource when u const bucket = new s3.Bucket(stack, 'MyBucket'); const fn = new lambda.SingletonFunction(stack, 'MyFunction', { uuid: 'uuid', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); @@ -208,7 +208,7 @@ test('add multiple event notifications using a singleton function', () => { const bucket = new s3.Bucket(stack, 'MyBucket'); const fn = new lambda.SingletonFunction(stack, 'MyFunction', { uuid: 'uuid', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); diff --git a/packages/@aws-cdk/aws-secretsmanager/test/rotation-schedule.test.ts b/packages/@aws-cdk/aws-secretsmanager/test/rotation-schedule.test.ts index 26f4ad5a753f5..bd183b8d89291 100644 --- a/packages/@aws-cdk/aws-secretsmanager/test/rotation-schedule.test.ts +++ b/packages/@aws-cdk/aws-secretsmanager/test/rotation-schedule.test.ts @@ -15,7 +15,7 @@ test('create a rotation schedule with a rotation Lambda', () => { // GIVEN const secret = new secretsmanager.Secret(stack, 'Secret'); const rotationLambda = new lambda.Function(stack, 'Lambda', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); @@ -47,7 +47,7 @@ test('assign permissions for rotation schedule with a rotation Lambda', () => { // GIVEN const secret = new secretsmanager.Secret(stack, 'Secret'); const rotationLambda = new lambda.Function(stack, 'Lambda', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); @@ -106,7 +106,7 @@ test('grants correct permissions for secret imported by name', () => { // GIVEN const secret = secretsmanager.Secret.fromSecretNameV2(stack, 'Secret', 'mySecretName'); const rotationLambda = new lambda.Function(stack, 'Lambda', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); @@ -158,7 +158,7 @@ test('assign kms permissions for rotation schedule with a rotation Lambda', () = const encryptionKey = new kms.Key(stack, 'Key'); const secret = new secretsmanager.Secret(stack, 'Secret', { encryptionKey }); const rotationLambda = new lambda.Function(stack, 'Lambda', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); @@ -523,7 +523,7 @@ describe('manual rotations', () => { const localStack = new cdk.Stack(); const secret = new secretsmanager.Secret(localStack, 'Secret'); const rotationLambda = new lambda.Function(localStack, 'Lambda', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); diff --git a/packages/@aws-cdk/aws-secretsmanager/test/secret.test.ts b/packages/@aws-cdk/aws-secretsmanager/test/secret.test.ts index 164dc216357d4..6caa06421d04e 100644 --- a/packages/@aws-cdk/aws-secretsmanager/test/secret.test.ts +++ b/packages/@aws-cdk/aws-secretsmanager/test/secret.test.ts @@ -1209,7 +1209,7 @@ test('add a rotation schedule to an attached secret', () => { }), }); const rotationLambda = new lambda.Function(stack, 'Lambda', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); diff --git a/packages/@aws-cdk/aws-ses-actions/test/actions.test.ts b/packages/@aws-cdk/aws-ses-actions/test/actions.test.ts index 845f99c963aa7..1c278eb93c92f 100644 --- a/packages/@aws-cdk/aws-ses-actions/test/actions.test.ts +++ b/packages/@aws-cdk/aws-ses-actions/test/actions.test.ts @@ -85,7 +85,7 @@ test('add lambda action', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('boom'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); rule.addAction(new actions.Lambda({ diff --git a/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts b/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts index 546fe9a3c6dae..f5015d4deb6ec 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts @@ -1060,7 +1060,7 @@ test('encrypted queue subscription', () => { test('lambda subscription', () => { const fction = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1120,7 +1120,7 @@ test('lambda subscription', () => { 'Arn', ], }, - 'Runtime': 'nodejs10.x', + 'Runtime': 'nodejs14.x', }, 'DependsOn': [ 'MyFuncServiceRole54065130', @@ -1171,7 +1171,7 @@ test('lambda subscription, cross region env agnostic', () => { displayName: 'displayName', }); const fction = new lambda.Function(lambdaStack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1224,7 +1224,7 @@ test('lambda subscription, cross region env agnostic', () => { ], }, 'Handler': 'index.handler', - 'Runtime': 'nodejs10.x', + 'Runtime': 'nodejs14.x', }, 'DependsOn': [ 'MyFuncServiceRole54065130', @@ -1285,7 +1285,7 @@ test('lambda subscription, cross region', () => { displayName: 'displayName', }); const fction = new lambda.Function(lambdaStack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1338,7 +1338,7 @@ test('lambda subscription, cross region', () => { ], }, 'Handler': 'index.handler', - 'Runtime': 'nodejs10.x', + 'Runtime': 'nodejs14.x', }, 'DependsOn': [ 'MyFuncServiceRole54065130', @@ -1571,7 +1571,7 @@ test('email and url subscriptions with unresolved - four subscriptions', () => { test('multiple subscriptions', () => { const queue = new sqs.Queue(stack, 'MyQueue'); const func = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1687,7 +1687,7 @@ test('multiple subscriptions', () => { 'Arn', ], }, - 'Runtime': 'nodejs10.x', + 'Runtime': 'nodejs14.x', }, 'DependsOn': [ 'MyFuncServiceRole54065130', @@ -1739,7 +1739,7 @@ test('throws with mutliple subscriptions of the same subscriber', () => { test('with filter policy', () => { const fction = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1818,7 +1818,7 @@ test('region property on an imported topic as a parameter - sqs', () => { test('region property is present on an imported topic - lambda', () => { const imported = sns.Topic.fromTopicArn(stack, 'mytopic', 'arn:aws:sns:us-east-1:1234567890:mytopic'); const func = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1833,7 +1833,7 @@ test('region property on an imported topic as a parameter - lambda', () => { const topicArn = new CfnParameter(stack, 'topicArn'); const imported = sns.Topic.fromTopicArn(stack, 'mytopic', topicArn.valueAsString); const func = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); diff --git a/packages/@aws-cdk/core/README.md b/packages/@aws-cdk/core/README.md index d1a96ce01b8c4..be51030190d39 100644 --- a/packages/@aws-cdk/core/README.md +++ b/packages/@aws-cdk/core/README.md @@ -493,7 +493,7 @@ stack-unique identifier and returns the service token: ```ts const serviceToken = CustomResourceProvider.getOrCreate(this, 'Custom::MyCustomResourceType', { codeDirectory: `${__dirname}/my-handler`, - runtime: CustomResourceProviderRuntime.NODEJS_12_X, + runtime: CustomResourceProviderRuntime.NODEJS_14_X, description: "Lambda function created by the custom resource provider", }); @@ -588,7 +588,7 @@ export class Sum extends Construct { const resourceType = 'Custom::Sum'; const serviceToken = CustomResourceProvider.getOrCreate(this, resourceType, { codeDirectory: `${__dirname}/sum-handler`, - runtime: CustomResourceProviderRuntime.NODEJS_12_X, + runtime: CustomResourceProviderRuntime.NODEJS_14_X, }); const resource = new CustomResource(this, 'Resource', { @@ -618,7 +618,7 @@ built-in singleton method: ```ts const provider = CustomResourceProvider.getOrCreateProvider(this, 'Custom::MyCustomResourceType', { codeDirectory: `${__dirname}/my-handler`, - runtime: CustomResourceProviderRuntime.NODEJS_12_X, + runtime: CustomResourceProviderRuntime.NODEJS_14_X, }); const roleArn = provider.roleArn; diff --git a/packages/@aws-cdk/custom-resources/test/provider-framework/provider.test.ts b/packages/@aws-cdk/custom-resources/test/provider-framework/provider.test.ts index ecab3a86edc7a..a7188f5ec596b 100644 --- a/packages/@aws-cdk/custom-resources/test/provider-framework/provider.test.ts +++ b/packages/@aws-cdk/custom-resources/test/provider-framework/provider.test.ts @@ -21,12 +21,12 @@ test('security groups are applied to all framework functions', () => { onEventHandler: new lambda.Function(stack, 'OnEvent', { code: lambda.Code.fromInline('foo'), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), isCompleteHandler: new lambda.Function(stack, 'IsComplete', { code: lambda.Code.fromInline('foo'), handler: 'index.isComplete', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), vpc: vpc, vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT }, @@ -89,12 +89,12 @@ test('vpc is applied to all framework functions', () => { onEventHandler: new lambda.Function(stack, 'OnEvent', { code: lambda.Code.fromInline('foo'), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), isCompleteHandler: new lambda.Function(stack, 'IsComplete', { code: lambda.Code.fromInline('foo'), handler: 'index.isComplete', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), vpc: vpc, vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT }, @@ -141,7 +141,7 @@ test('minimal setup', () => { onEventHandler: new lambda.Function(stack, 'MyHandler', { code: lambda.Code.fromAsset(path.join(__dirname, './integration-test-fixtures/s3-file-handler')), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), }); @@ -173,7 +173,7 @@ test('if isComplete is specified, the isComplete framework handler is also inclu const handler = new lambda.Function(stack, 'MyHandler', { code: lambda.Code.fromAsset(path.join(__dirname, './integration-test-fixtures/s3-file-handler')), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -247,7 +247,7 @@ test('fails if "queryInterval" and/or "totalTimeout" are set without "isComplete const handler = new lambda.Function(stack, 'MyHandler', { code: lambda.Code.fromAsset(path.join(__dirname, './integration-test-fixtures/s3-file-handler')), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // THEN @@ -303,7 +303,7 @@ describe('log retention', () => { onEventHandler: new lambda.Function(stack, 'MyHandler', { code: lambda.Code.fromAsset(path.join(__dirname, './integration-test-fixtures/s3-file-handler')), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), logRetention: logs.RetentionDays.ONE_WEEK, }); @@ -334,7 +334,7 @@ describe('log retention', () => { onEventHandler: new lambda.Function(stack, 'MyHandler', { code: lambda.Code.fromAsset(path.join(__dirname, './integration-test-fixtures/s3-file-handler')), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), }); @@ -353,7 +353,7 @@ describe('role', () => { onEventHandler: new lambda.Function(stack, 'MyHandler', { code: lambda.Code.fromAsset(path.join(__dirname, './integration-test-fixtures/s3-file-handler')), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), role: new iam.Role(stack, 'MyRole', { assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'), @@ -381,7 +381,7 @@ describe('role', () => { onEventHandler: new lambda.Function(stack, 'MyHandler', { code: lambda.Code.fromAsset(path.join(__dirname, './integration-test-fixtures/s3-file-handler')), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), }); @@ -408,7 +408,7 @@ describe('name', () => { onEventHandler: new lambda.Function(stack, 'MyHandler', { code: lambda.Code.fromAsset(path.join(__dirname, './integration-test-fixtures/s3-file-handler')), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), providerFunctionName, }); diff --git a/packages/@aws-cdk/integ-tests/README.md b/packages/@aws-cdk/integ-tests/README.md index 414f21e5a61fd..a9e2078888390 100644 --- a/packages/@aws-cdk/integ-tests/README.md +++ b/packages/@aws-cdk/integ-tests/README.md @@ -33,7 +33,7 @@ we would need to create a file to contain our integration test application. const app = new App(); const stack = new Stack(); new lambda.Function(stack, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')), }); @@ -73,9 +73,9 @@ interface StackUnderTestProps extends StackProps { class StackUnderTest extends Stack { constructor(scope: Construct, id: string, props: StackUnderTestProps) { super(scope, id, props); - + new lambda.Function(this, 'Handler', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')), architecture: props.architecture, @@ -97,9 +97,9 @@ interface StackUnderTestProps extends StackProps { class StackUnderTest extends Stack { constructor(scope: Construct, id: string, props: StackUnderTestProps) { super(scope, id, props); - + new lambda.Function(this, 'Handler', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')), architecture: props.architecture, @@ -269,7 +269,7 @@ integ.assertions.awsApiCall('SQS', 'receiveMessage', { This library currently provides the ability to assert that two values are equal to one another by utilizing the `EqualsAssertion` class. This utilizes a Lambda backed `CustomResource` which in tern uses the [Match](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.assertions.Match.html) utility from the -[@aws-cdk/assertions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.assertions-readme.html) library. +[@aws-cdk/assertions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.assertions-readme.html) library. ```ts diff --git a/packages/@aws-cdk/triggers/README.md b/packages/@aws-cdk/triggers/README.md index 4ed41ce05ca0a..2c86e946c1941 100644 --- a/packages/@aws-cdk/triggers/README.md +++ b/packages/@aws-cdk/triggers/README.md @@ -30,7 +30,7 @@ import { Stack } from '@aws-cdk/core'; declare const stack: Stack; new triggers.TriggerFunction(stack, 'MyTrigger', { - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromAsset(__dirname + '/my-trigger'), }); diff --git a/packages/aws-cdk-lib/README.md b/packages/aws-cdk-lib/README.md index ce963c125c7f9..b9e48da31f524 100644 --- a/packages/aws-cdk-lib/README.md +++ b/packages/aws-cdk-lib/README.md @@ -524,7 +524,7 @@ stack-unique identifier and returns the service token: ```ts const serviceToken = CustomResourceProvider.getOrCreate(this, 'Custom::MyCustomResourceType', { codeDirectory: `${__dirname}/my-handler`, - runtime: CustomResourceProviderRuntime.NODEJS_12_X, + runtime: CustomResourceProviderRuntime.NODEJS_14_X, description: "Lambda function created by the custom resource provider", }); @@ -619,7 +619,7 @@ export class Sum extends Construct { const resourceType = 'Custom::Sum'; const serviceToken = CustomResourceProvider.getOrCreate(this, resourceType, { codeDirectory: `${__dirname}/sum-handler`, - runtime: CustomResourceProviderRuntime.NODEJS_12_X, + runtime: CustomResourceProviderRuntime.NODEJS_14_X, }); const resource = new CustomResource(this, 'Resource', { @@ -649,7 +649,7 @@ built-in singleton method: ```ts const provider = CustomResourceProvider.getOrCreateProvider(this, 'Custom::MyCustomResourceType', { codeDirectory: `${__dirname}/my-handler`, - runtime: CustomResourceProviderRuntime.NODEJS_12_X, + runtime: CustomResourceProviderRuntime.NODEJS_14_X, }); const roleArn = provider.roleArn; diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index 7a22629e953a5..4ff94c9cf04a8 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -451,6 +451,7 @@ "./aws-cognito": "./aws-cognito/index.js", "./aws-config": "./aws-config/index.js", "./aws-connect": "./aws-connect/index.js", + "./aws-controltower": "./aws-controltower/index.js", "./aws-cur": "./aws-cur/index.js", "./aws-customerprofiles": "./aws-customerprofiles/index.js", "./aws-databrew": "./aws-databrew/index.js", @@ -537,6 +538,7 @@ "./aws-lookoutequipment": "./aws-lookoutequipment/index.js", "./aws-lookoutmetrics": "./aws-lookoutmetrics/index.js", "./aws-lookoutvision": "./aws-lookoutvision/index.js", + "./aws-m2": "./aws-m2/index.js", "./aws-macie": "./aws-macie/index.js", "./aws-managedblockchain": "./aws-managedblockchain/index.js", "./aws-mediaconnect": "./aws-mediaconnect/index.js", @@ -564,6 +566,7 @@ "./aws-ram": "./aws-ram/index.js", "./aws-rds": "./aws-rds/index.js", "./aws-redshift": "./aws-redshift/index.js", + "./aws-redshiftserverless": "./aws-redshiftserverless/index.js", "./aws-refactorspaces": "./aws-refactorspaces/index.js", "./aws-rekognition": "./aws-rekognition/index.js", "./aws-resiliencehub": "./aws-resiliencehub/index.js", @@ -602,6 +605,7 @@ "./aws-sso": "./aws-sso/index.js", "./aws-stepfunctions": "./aws-stepfunctions/index.js", "./aws-stepfunctions-tasks": "./aws-stepfunctions-tasks/index.js", + "./aws-supportapp": "./aws-supportapp/index.js", "./aws-synthetics": "./aws-synthetics/index.js", "./aws-timestream": "./aws-timestream/index.js", "./aws-transfer": "./aws-transfer/index.js", diff --git a/packages/aws-cdk/README.md b/packages/aws-cdk/README.md index 47ae9054fed83..290f79c4865dc 100644 --- a/packages/aws-cdk/README.md +++ b/packages/aws-cdk/README.md @@ -229,7 +229,7 @@ Usage of output in a CDK stack const fn = new lambda.Function(this, "fn", { handler: "index.handler", code: lambda.Code.fromInline(`exports.handler = \${handler.toString()}`), - runtime: lambda.Runtime.NODEJS_12_X + runtime: lambda.Runtime.NODEJS_14_X }); new cdk.CfnOutput(this, 'FunctionArn', { @@ -510,10 +510,10 @@ $ cdk destroy --app='node bin/main.js' MyStackName ### `cdk bootstrap` -Deploys a `CDKToolkit` CloudFormation stack into the specified environment(s), that provides an S3 bucket -and ECR reposity that `cdk deploy` will use to store synthesized templates and the related assets, before -triggering a CloudFormation stack update. The name of the deployed stack can be configured using the -`--toolkit-stack-name` argument. The S3 Bucket Public Access Block Configuration can be configured using +Deploys a `CDKToolkit` CloudFormation stack into the specified environment(s), that provides an S3 bucket +and ECR reposity that `cdk deploy` will use to store synthesized templates and the related assets, before +triggering a CloudFormation stack update. The name of the deployed stack can be configured using the +`--toolkit-stack-name` argument. The S3 Bucket Public Access Block Configuration can be configured using the `--public-access-block-configuration` argument. ECR uses immutable tags for images. ```console diff --git a/packages/aws-cdk/does-not-exist.json b/packages/aws-cdk/does-not-exist.json index 44efb5098e48f..02ef1794b8acb 100644 --- a/packages/aws-cdk/does-not-exist.json +++ b/packages/aws-cdk/does-not-exist.json @@ -1 +1 @@ -{"expiration":1656407830087,"notices":[{"title":"Error when building EKS cluster with monocdk import","issueNumber":17061,"overview":"When using monocdk/aws-eks to build a stack containing an EKS cluster, error is thrown about missing lambda-layer-node-proxy-agent/layer/package.json.","components":[{"name":"cli","version":"<1.130.0 >=1.126.0"}],"schemaVersion":"1"}]} +{"expiration":1664458298949,"notices":[{"title":"Error when building EKS cluster with monocdk import","issueNumber":17061,"overview":"When using monocdk/aws-eks to build a stack containing an EKS cluster, error is thrown about missing lambda-layer-node-proxy-agent/layer/package.json.","components":[{"name":"cli","version":"<1.130.0 >=1.126.0"}],"schemaVersion":"1"}]} diff --git a/packages/aws-cdk/test/integ/cli/app/app.js b/packages/aws-cdk/test/integ/cli/app/app.js index c98afe071d1fb..696c72f7b3237 100644 --- a/packages/aws-cdk/test/integ/cli/app/app.js +++ b/packages/aws-cdk/test/integ/cli/app/app.js @@ -220,7 +220,7 @@ class LambdaStack extends cdk.Stack { const fn = new lambda.Function(this, 'my-function', { code: lambda.Code.asset(path.join(__dirname, 'lambda')), - runtime: lambda.Runtime.NODEJS_12_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler' }); diff --git a/tools/@aws-cdk/node-bundle/src/api/bundle.ts b/tools/@aws-cdk/node-bundle/src/api/bundle.ts index e48fc5a78e2e0..302422075f0ef 100644 --- a/tools/@aws-cdk/node-bundle/src/api/bundle.ts +++ b/tools/@aws-cdk/node-bundle/src/api/bundle.ts @@ -392,7 +392,7 @@ export class Bundle { const bundle = esbuild.buildSync({ entryPoints: this.entryPoints, bundle: true, - target: 'node12', + target: 'node14', platform: 'node', sourcemap: 'inline', metafile: true,