Skip to content

Commit 40ddfdd

Browse files
chore: remove usage of Node12 runtime in tests (aws#22256)
Removes usage of NodeJS 12 runtime in some of our tests in preparation for deprecation of the runtime. Tests already cover Node 14 and 16 so removal is all that was necessary. ---- ### All Submissions: * [X] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent e4e0fa7 commit 40ddfdd

File tree

5 files changed

+22
-175
lines changed

5 files changed

+22
-175
lines changed

packages/@aws-cdk/aws-lambda/test/integ.runtime.inlinecode.ts

-7
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ const app = new App();
1515

1616
const stack = new Stack(app, 'aws-cdk-lambda-runtime-inlinecode');
1717

18-
const node12xfn = new Function(stack, 'NODEJS_12_X', {
19-
code: new InlineCode('exports.handler = async function(event) { return "success" }'),
20-
handler: 'index.handler',
21-
runtime: Runtime.NODEJS_12_X,
22-
});
23-
new CfnOutput(stack, 'NODEJS_12_X-functionName', { value: node12xfn.functionName });
24-
2518
const python37 = new Function(stack, 'PYTHON_3_7', {
2619
code: new InlineCode('def handler(event, context):\n return "success"'),
2720
handler: 'index.handler',

packages/@aws-cdk/aws-lambda/test/runtime.inlinecode.integ.snapshot/aws-cdk-lambda-runtime-inlinecode.assets.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"version": "21.0.0",
33
"files": {
4-
"fc0190b17e2248f645e6fb64b3fcc344774325a53c839f3e3d06cf7c1ba8b516": {
4+
"33c56e02291eaea4afa147afc5d42ce6d80c4f482906b78fa47ddbe2582f19bc": {
55
"source": {
66
"path": "aws-cdk-lambda-runtime-inlinecode.template.json",
77
"packaging": "file"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "fc0190b17e2248f645e6fb64b3fcc344774325a53c839f3e3d06cf7c1ba8b516.json",
12+
"objectKey": "33c56e02291eaea4afa147afc5d42ce6d80c4f482906b78fa47ddbe2582f19bc.json",
1313
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
1414
}
1515
}

packages/@aws-cdk/aws-lambda/test/runtime.inlinecode.integ.snapshot/aws-cdk-lambda-runtime-inlinecode.template.json

-55
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,5 @@
11
{
22
"Resources": {
3-
"NODEJS12XServiceRole59E71436": {
4-
"Type": "AWS::IAM::Role",
5-
"Properties": {
6-
"AssumeRolePolicyDocument": {
7-
"Statement": [
8-
{
9-
"Action": "sts:AssumeRole",
10-
"Effect": "Allow",
11-
"Principal": {
12-
"Service": "lambda.amazonaws.com"
13-
}
14-
}
15-
],
16-
"Version": "2012-10-17"
17-
},
18-
"ManagedPolicyArns": [
19-
{
20-
"Fn::Join": [
21-
"",
22-
[
23-
"arn:",
24-
{
25-
"Ref": "AWS::Partition"
26-
},
27-
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
28-
]
29-
]
30-
}
31-
]
32-
}
33-
},
34-
"NODEJS12X8B8075A4": {
35-
"Type": "AWS::Lambda::Function",
36-
"Properties": {
37-
"Code": {
38-
"ZipFile": "exports.handler = async function(event) { return \"success\" }"
39-
},
40-
"Role": {
41-
"Fn::GetAtt": [
42-
"NODEJS12XServiceRole59E71436",
43-
"Arn"
44-
]
45-
},
46-
"Handler": "index.handler",
47-
"Runtime": "nodejs12.x"
48-
},
49-
"DependsOn": [
50-
"NODEJS12XServiceRole59E71436"
51-
]
52-
},
533
"PYTHON37ServiceRoleDE7E561E": {
544
"Type": "AWS::IAM::Role",
555
"Properties": {
@@ -302,11 +252,6 @@
302252
}
303253
},
304254
"Outputs": {
305-
"NODEJS12XfunctionName": {
306-
"Value": {
307-
"Ref": "NODEJS12X8B8075A4"
308-
}
309-
},
310255
"PYTHON37functionName": {
311256
"Value": {
312257
"Ref": "PYTHON37D3A10E04"

packages/@aws-cdk/aws-lambda/test/runtime.inlinecode.integ.snapshot/manifest.json

+19-19
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"validateOnSynth": false,
2424
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
2525
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
26-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/fc0190b17e2248f645e6fb64b3fcc344774325a53c839f3e3d06cf7c1ba8b516.json",
26+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/33c56e02291eaea4afa147afc5d42ce6d80c4f482906b78fa47ddbe2582f19bc.json",
2727
"requiresBootstrapStackVersion": 6,
2828
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2929
"additionalDependencies": [
@@ -39,24 +39,6 @@
3939
"aws-cdk-lambda-runtime-inlinecode.assets"
4040
],
4141
"metadata": {
42-
"/aws-cdk-lambda-runtime-inlinecode/NODEJS_12_X/ServiceRole/Resource": [
43-
{
44-
"type": "aws:cdk:logicalId",
45-
"data": "NODEJS12XServiceRole59E71436"
46-
}
47-
],
48-
"/aws-cdk-lambda-runtime-inlinecode/NODEJS_12_X/Resource": [
49-
{
50-
"type": "aws:cdk:logicalId",
51-
"data": "NODEJS12X8B8075A4"
52-
}
53-
],
54-
"/aws-cdk-lambda-runtime-inlinecode/NODEJS_12_X-functionName": [
55-
{
56-
"type": "aws:cdk:logicalId",
57-
"data": "NODEJS12XfunctionName"
58-
}
59-
],
6042
"/aws-cdk-lambda-runtime-inlinecode/PYTHON_3_7/ServiceRole/Resource": [
6143
{
6244
"type": "aws:cdk:logicalId",
@@ -158,6 +140,24 @@
158140
"type": "aws:cdk:logicalId",
159141
"data": "CheckBootstrapVersion"
160142
}
143+
],
144+
"NODEJS12XServiceRole59E71436": [
145+
{
146+
"type": "aws:cdk:logicalId",
147+
"data": "NODEJS12XServiceRole59E71436",
148+
"trace": [
149+
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
150+
]
151+
}
152+
],
153+
"NODEJS12X8B8075A4": [
154+
{
155+
"type": "aws:cdk:logicalId",
156+
"data": "NODEJS12X8B8075A4",
157+
"trace": [
158+
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
159+
]
160+
}
161161
]
162162
},
163163
"displayName": "aws-cdk-lambda-runtime-inlinecode"

packages/@aws-cdk/aws-lambda/test/runtime.inlinecode.integ.snapshot/tree.json

+1-92
Original file line numberDiff line numberDiff line change
@@ -9,104 +9,13 @@
99
"path": "Tree",
1010
"constructInfo": {
1111
"fqn": "constructs.Construct",
12-
"version": "10.1.85"
12+
"version": "10.1.108"
1313
}
1414
},
1515
"aws-cdk-lambda-runtime-inlinecode": {
1616
"id": "aws-cdk-lambda-runtime-inlinecode",
1717
"path": "aws-cdk-lambda-runtime-inlinecode",
1818
"children": {
19-
"NODEJS_12_X": {
20-
"id": "NODEJS_12_X",
21-
"path": "aws-cdk-lambda-runtime-inlinecode/NODEJS_12_X",
22-
"children": {
23-
"ServiceRole": {
24-
"id": "ServiceRole",
25-
"path": "aws-cdk-lambda-runtime-inlinecode/NODEJS_12_X/ServiceRole",
26-
"children": {
27-
"Resource": {
28-
"id": "Resource",
29-
"path": "aws-cdk-lambda-runtime-inlinecode/NODEJS_12_X/ServiceRole/Resource",
30-
"attributes": {
31-
"aws:cdk:cloudformation:type": "AWS::IAM::Role",
32-
"aws:cdk:cloudformation:props": {
33-
"assumeRolePolicyDocument": {
34-
"Statement": [
35-
{
36-
"Action": "sts:AssumeRole",
37-
"Effect": "Allow",
38-
"Principal": {
39-
"Service": "lambda.amazonaws.com"
40-
}
41-
}
42-
],
43-
"Version": "2012-10-17"
44-
},
45-
"managedPolicyArns": [
46-
{
47-
"Fn::Join": [
48-
"",
49-
[
50-
"arn:",
51-
{
52-
"Ref": "AWS::Partition"
53-
},
54-
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
55-
]
56-
]
57-
}
58-
]
59-
}
60-
},
61-
"constructInfo": {
62-
"fqn": "@aws-cdk/aws-iam.CfnRole",
63-
"version": "0.0.0"
64-
}
65-
}
66-
},
67-
"constructInfo": {
68-
"fqn": "@aws-cdk/aws-iam.Role",
69-
"version": "0.0.0"
70-
}
71-
},
72-
"Resource": {
73-
"id": "Resource",
74-
"path": "aws-cdk-lambda-runtime-inlinecode/NODEJS_12_X/Resource",
75-
"attributes": {
76-
"aws:cdk:cloudformation:type": "AWS::Lambda::Function",
77-
"aws:cdk:cloudformation:props": {
78-
"code": {
79-
"zipFile": "exports.handler = async function(event) { return \"success\" }"
80-
},
81-
"role": {
82-
"Fn::GetAtt": [
83-
"NODEJS12XServiceRole59E71436",
84-
"Arn"
85-
]
86-
},
87-
"handler": "index.handler",
88-
"runtime": "nodejs12.x"
89-
}
90-
},
91-
"constructInfo": {
92-
"fqn": "@aws-cdk/aws-lambda.CfnFunction",
93-
"version": "0.0.0"
94-
}
95-
}
96-
},
97-
"constructInfo": {
98-
"fqn": "@aws-cdk/aws-lambda.Function",
99-
"version": "0.0.0"
100-
}
101-
},
102-
"NODEJS_12_X-functionName": {
103-
"id": "NODEJS_12_X-functionName",
104-
"path": "aws-cdk-lambda-runtime-inlinecode/NODEJS_12_X-functionName",
105-
"constructInfo": {
106-
"fqn": "@aws-cdk/core.CfnOutput",
107-
"version": "0.0.0"
108-
}
109-
},
11019
"PYTHON_3_7": {
11120
"id": "PYTHON_3_7",
11221
"path": "aws-cdk-lambda-runtime-inlinecode/PYTHON_3_7",

0 commit comments

Comments
 (0)