Skip to content

Commit acd6595

Browse files
authored
Merge pull request #54 from oss-serverless/deprecated-node
Update examples to use non-deprecated nodejs versions
2 parents 090710f + 5fe4cd2 commit acd6595

File tree

10 files changed

+28
-28
lines changed

10 files changed

+28
-28
lines changed

docs/cli-reference/print.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ custom:
3030

3131
provider:
3232
name: aws
33-
runtime: nodejs14.x
33+
runtime: nodejs18.x
3434

3535
functions:
3636
hello:
@@ -53,7 +53,7 @@ custom:
5353
bucketName: test
5454
provider:
5555
name: aws
56-
runtime: nodejs14.x
56+
runtime: nodejs18.x
5757
stage: dev # <-- Resolved
5858
functions:
5959
hello:

docs/events/apigateway.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1456,7 +1456,7 @@ service: my-api
14561456
14571457
provider:
14581458
name: aws
1459-
runtime: nodejs14.x
1459+
runtime: nodejs18.x
14601460
stage: dev
14611461
region: eu-west-2
14621462
@@ -1645,7 +1645,7 @@ Resource policies are policy documents that are used to control the invocation o
16451645
```yml
16461646
provider:
16471647
name: aws
1648-
runtime: nodejs14.x
1648+
runtime: nodejs18.x
16491649
16501650
apiGateway:
16511651
resourcePolicy:

docs/events/websocket.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ service: serverless-ws-test
6161
6262
provider:
6363
name: aws
64-
runtime: nodejs14.x
64+
runtime: nodejs18.x
6565
websocketsApiName: custom-websockets-api-name
6666
websocketsApiRouteSelectionExpression: $request.body.action # custom routes are selected by the value of the action property in the body
6767
websocketsDescription: Custom Serverless Websockets

docs/guides/credentials.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ You can even set up different profiles for different accounts, which can be used
127127
service: new-service
128128
provider:
129129
name: aws
130-
runtime: nodejs14.x
130+
runtime: nodejs18.x
131131
stage: dev
132132
profile: devProfile
133133
```
@@ -175,7 +175,7 @@ This example `serverless.yml` snippet will load the profile depending upon the s
175175
service: new-service
176176
provider:
177177
name: aws
178-
runtime: nodejs14.x
178+
runtime: nodejs18.x
179179
profile: ${self:custom.profiles.${sls:stage}}
180180
custom:
181181
profiles:

docs/guides/functions.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ service: myService
1212

1313
provider:
1414
name: aws
15-
runtime: nodejs14.x
15+
runtime: nodejs18.x
1616
runtimeManagement: auto # optional, set how Lambda controls all functions runtime. AWS default is auto; this can either be 'auto' or 'onFunctionUpdate'. For 'manual', see example in hello function below (syntax for both is identical)
1717
memorySize: 512 # optional, in MB, default is 1024
1818
timeout: 10 # optional, in seconds, default is 6
@@ -52,7 +52,7 @@ service: myService
5252
5353
provider:
5454
name: aws
55-
runtime: nodejs14.x
55+
runtime: nodejs18.x
5656
5757
functions:
5858
functionOne:
@@ -72,7 +72,7 @@ service: myService
7272
7373
provider:
7474
name: aws
75-
runtime: nodejs14.x
75+
runtime: nodejs18.x
7676
memorySize: 512 # will be inherited by all functions
7777
7878
functions:
@@ -88,7 +88,7 @@ service: myService
8888
8989
provider:
9090
name: aws
91-
runtime: nodejs14.x
91+
runtime: nodejs18.x
9292
9393
functions:
9494
functionOne:
@@ -124,7 +124,7 @@ service: myService
124124
125125
provider:
126126
name: aws
127-
runtime: nodejs14.x
127+
runtime: nodejs18.x
128128
iam:
129129
role:
130130
statements: # permissions for all of your functions can be set here
@@ -725,7 +725,7 @@ service: service
725725
726726
provider:
727727
name: aws
728-
runtime: nodejs14.x
728+
runtime: nodejs18.x
729729
730730
functions:
731731
hello:
@@ -778,7 +778,7 @@ service: myService
778778
779779
provider:
780780
name: aws
781-
runtime: nodejs14.x
781+
runtime: nodejs18.x
782782
tracing:
783783
lambda: true
784784
```

docs/guides/serverless.yml.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Some function settings can be defined for all functions inside the `provider` ke
101101
# serverless.yml
102102
103103
provider:
104-
runtime: nodejs14.x
104+
runtime: nodejs18.x
105105
runtimeManagement: auto # optional, set how Lambda controls all functions runtime. AWS default is auto; this can either be 'auto' or 'onFunctionUpdate'. For 'manual', see example in hello function below (syntax for both is identical
106106
# Default memory size for functions (default: 1024MB)
107107
memorySize: 512
@@ -607,7 +607,7 @@ functions:
607607
# Container image to use. Cannot be used with 'handler'.
608608
# Can be the URI of an image in ECR, or the name of an image defined in 'provider.ecr.images'
609609
image: baseimage
610-
runtime: nodejs14.x
610+
runtime: nodejs18.x
611611
runtimeManagement:
612612
mode: manual # syntax required for manual, mode property also supports 'auto' or 'onFunctionUpdate' (see provider.runtimeManagement)
613613
arn: <aws runtime arn> # required when mode is manual

docs/guides/services.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ service: users
8585

8686
provider:
8787
name: aws
88-
runtime: nodejs14.x
88+
runtime: nodejs18.x
8989
stage: dev # Set the default stage used. Default is dev
9090
region: us-east-1 # Overwrite the default region used. Default is us-east-1
9191
profile: production # The default profile to use with this service
@@ -164,7 +164,7 @@ service: users
164164
165165
provider:
166166
name: aws
167-
runtime: nodejs14.x
167+
runtime: nodejs18.x
168168
memorySize: 512
169169
170170
@@ -181,7 +181,7 @@ service: users
181181
182182
provider:
183183
name: aws
184-
runtime: nodejs14.x
184+
runtime: nodejs18.x
185185
memorySize: 512
186186
187187

docs/guides/variables.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ You can add such custom output to CloudFormation stack. For example:
199199
service: another-service
200200
provider:
201201
name: aws
202-
runtime: nodejs14.x
202+
runtime: nodejs18.x
203203
region: ap-northeast-1
204204
memorySize: 512
205205
functions:

test/unit/lib/plugins/aws/invoke-local/index.test.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ describe('AwsInvokeLocal', () => {
421421
it(`should call invokeLocalNodeJs for any node.js runtime version for ${item.path}`, async () => {
422422
awsInvokeLocal.options.functionObj.handler = item.path;
423423

424-
awsInvokeLocal.options.functionObj.runtime = 'nodejs16.x';
424+
awsInvokeLocal.options.functionObj.runtime = 'nodejs18.x';
425425
await awsInvokeLocal.invokeLocal();
426426
expect(invokeLocalNodeJsStub.calledOnce).to.be.equal(true);
427427
expect(
@@ -563,8 +563,8 @@ describe('AwsInvokeLocal', () => {
563563
expect(invokeLocalDockerStub.calledWithExactly()).to.be.equal(true);
564564
});
565565

566-
it('should call invokeLocalDocker if using --docker option with nodejs16.x', async () => {
567-
awsInvokeLocal.options.functionObj.runtime = 'nodejs16.x';
566+
it('should call invokeLocalDocker if using --docker option with nodejs18.x', async () => {
567+
awsInvokeLocal.options.functionObj.runtime = 'nodejs18.x';
568568
awsInvokeLocal.options.functionObj.handler = 'handler.foobar';
569569
awsInvokeLocal.options.docker = true;
570570
await awsInvokeLocal.invokeLocal();
@@ -706,7 +706,7 @@ describe('AwsInvokeLocal', () => {
706706
handler: 'handler.hello',
707707
name: 'hello',
708708
timeout: 4,
709-
runtime: 'nodejs16.x',
709+
runtime: 'nodejs18.x',
710710
environment: {
711711
functionVar: 'functionValue',
712712
},
@@ -734,7 +734,7 @@ describe('AwsInvokeLocal', () => {
734734
expect(spawnExtStub.getCall(0).args).to.deep.equal(['docker', ['version']]);
735735
expect(spawnExtStub.getCall(1).args).to.deep.equal([
736736
'docker',
737-
['images', '-q', 'lambci/lambda:nodejs16.x'],
737+
['images', '-q', 'lambci/lambda:nodejs18.x'],
738738
]);
739739
expect(spawnExtStub.getCall(3).args).to.deep.equal([
740740
'docker',
@@ -765,7 +765,7 @@ describe('AwsInvokeLocal', () => {
765765
'commandLineEnvVar=commandLineEnvVarValue',
766766
'-p',
767767
'9292:9292',
768-
'sls-docker-nodejs16.x',
768+
'sls-docker-nodejs18.x',
769769
'handler.hello',
770770
'{}',
771771
],
@@ -1059,7 +1059,7 @@ describe('test/unit/lib/plugins/aws/invokeLocal/index.test.js', () => {
10591059
},
10601060
configExt: {
10611061
provider: {
1062-
runtime: 'nodejs14.x',
1062+
runtime: 'nodejs18.x',
10631063
environment: {
10641064
PROVIDER_LEVEL_VAR: 'PROVIDER_LEVEL_VAR_VALUE',
10651065
NULL_VAR: null,

test/unit/lib/plugins/aws/package/lib/strip-null-props-from-template-resources.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('test/unit/lib/plugins/aws/package/lib/stripNullPropsFromTemplateResour
4343
Code: {
4444
S3Bucket: 's3-containing-lambda',
4545
},
46-
Runtime: 'nodejs16.x',
46+
Runtime: 'nodejs18.x',
4747
},
4848
},
4949
resourceWithNullProperties: {

0 commit comments

Comments
 (0)