I'm seeing this after deploy serverless: "Resource handler returned message: "The runtime parameter of nodejs12.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs18.x) while creating or updating functions." #12080
Unanswered
robertomorel
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Issue:
I'm seeing this after deploy serverless: "Resource handler returned message: "The runtime parameter of nodejs12.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs18.x) while creating or updating functions."
File: package.json
{$npm_config_action -v --env $ {npm_config_env:-dev}",
"name": "vc-serverless",
"version": "0.0.0",
"license": "MIT",
"private": true,
"scripts": {
"sls:apps": "cd apps/$npm_config_app && sls
"package": "npm run sls:apps --app=$npm_config_app package",
"package:vc-integration-api": "npm run package --app=vc-integration-api",
"package:vc-data-ingestion-api": "npm run package --app=vc-data-ingestion-api",
"package:vc-data-processing-api": "npm run package --app=vc-data-processing-api",
"deploy": "npm run sls:apps --app=$npm_config_app deploy",
"deploy:vc-integration-api": "npm run sls:apps --app=vc-integration-api --action=create_domain && npm run deploy --app=vc-integration-api",
"deploy:vc-data-ingestion-api": "npm run deploy --app=vc-data-ingestion-api",
"deploy:vc-data-processing-api": "npm run deploy --app=vc-data-processing-api",
"test": "jest --passWithNoTests --maxWorkers=50% --coverage",
"test:vc-integration-api": "npm test --selectProjects apps/vc-integration-api",
"test:vc-ingestion-api": "npm test --selectProjects apps/vc-data-ingestion-api",
"test:vc-processing-api": "npm test --selectProjects apps/vc-data-processing-api",
"lint": "eslint ./apps ./libs --ext .js,.jsx,.ts,.tsx --fix",
"localstack:up": "docker-compose -f localstack/docker-compose.yml up --detach",
"localstack:down": "docker-compose -f localstack/docker-compose.yml down",
"localstack:init:dynamodb": "localstack/dynamodb-tables-create.sh",
"localstack:reset:dynamodb": "localstack/dynamodb-tables-delete.sh && localstack/dynamodb-tables-create.sh",
"localstack:init:s3": "localstack/s3-buckets-create.sh",
"localstack:reset:s3": "localstack/s3-buckets-delete.sh && localstack/s3-buckets-create.sh",
"localstack:init:sqs": "localstack/sqs-create.sh",
"localstack:reset:sqs": "localstack/sqs-delete.sh && localstack/sqs-create.sh",
"sls:offline:start": "cd apps/$npm_config_app && sls offline start --stage offline --noPrependStageInUrl",
"start": "npm run sls:offline:start --app=vc-data-ingestion-api",
"dynamoDB-admin": "DYNAMO_ENDPOINT=http://localhost:4566 dynamodb-admin",
"dataprocessing": "cd apps/vc-data-processing-api && npx sls invoke local --env offline --function eventListener",
"prepare": "husky install",
"prettier": "npx prettier --check ."
},
"dependencies": {
"@middy/core": "1.5.2",
"@middy/do-not-wait-for-empty-event-loop": "1.5.2",
"@middy/warmup": "1.5.2",
"@sentry/node": "5.30.0",
"@types/oauth": "^0.9.1",
"aws-sdk": "2.847.0",
"axios": "0.21.1",
"dynamodb-toolbox": "0.3.3",
"http-status-codes": "1.4.0",
"joi": "17.4.0",
"json-stringify-safe": "5.0.1",
"ksuid": "2.0.0",
"luxon": "1.26.0",
"oauth": "^0.9.15",
"request-debug": "0.2.0",
"request-promise": "4.2.6",
"source-map-support": "0.5.19",
"uuid": "8.3.2"
},
"devDependencies": {
"@types/aws-lambda": "8.10.72",
"@types/jest": "26.0.20",
"@types/json-stringify-safe": "5.0.0",
"@types/luxon": "1.26.0",
"@types/node": "12.20.2",
"@types/serverless": "1.78.20",
"@types/uuid": "8.3.0",
"@types/validator": "13.1.3",
"@typescript-eslint/eslint-plugin": "4.15.1",
"@typescript-eslint/parser": "4.15.1",
"aws-sdk-mock": "5.1.0",
"copy-webpack-plugin": "6.4.1",
"dotenv": "8.2.0",
"dynamodb-admin": "^4.0.3",
"eslint": "7.20.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jest": "24.1.5",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "4.3.1",
"eslint-plugin-standard": "4.1.0",
"fork-ts-checker-webpack-plugin": "5.2.1",
"husky": "^7.0.0",
"jest": "26.6.3",
"jest-ts-auto-mock": "1.0.12",
"prettier": "^2.4.1",
"serverless": "2.25.2",
"serverless-cloudformation-sub-variables": "0.2.1",
"serverless-domain-manager": "5.1.0",
"serverless-dotenv-plugin": "3.5.1",
"serverless-dynamodb-local": "^0.2.40",
"serverless-offline": "6.8.0",
"serverless-offline-ssm": "5.2.0",
"serverless-plugin-offline-dynamodb-stream": "^1.0.20",
"serverless-plugin-warmup": "4.9.0",
"serverless-s3-local": "^0.6.19",
"serverless-webpack": "5.3.5",
"ts-auto-mock": "2.7.0",
"ts-jest": "26.5.1",
"ts-loader": "8.0.17",
"ts-node": "9.1.1",
"tsconfig-paths-webpack-plugin": "3.3.0",
"ttypescript": "1.5.12",
"typescript": "4.1.5",
"webpack": "4.46.0",
"webpack-node-externals": "2.5.2"
}
}
File: serverless.yml
service: vc-integration-api
plugins:
package:
individually: true
#useDotenv: true
#variablesResolutionMode: 20210326
provider:
name: aws
runtime: nodejs12.x
stage: ${env:STAGE}
region: ${env:AWS_REGION}
apiName: ${self:service.name}-${env:STAGE}
stackName: ${self:service.name}-${env:STAGE}
timeout: 10 # default is 6 seconds
logs:
restApi: true
logRetentionInDays: 90 # Set the default RetentionInDays for a CloudWatch LogGroup
tags:
Env: ${env:ENVIRONMENT}
ManagedBy: "Serverless"
stackTags:
Env: ${env:ENVIRONMENT}
ManagedBy: "Serverless"
apiKeys:
- name: ${env:M2M_MASTER_API_KEY_NAME}
value: ${ssm:${env:M2M_MASTER_API_KEY_VALUE}}
description: API key used for M2M requests (master key)
environment:
CORS_ALLOW_ORIGIN: ${self:custom.corsAllowOrigin}
ENVIRONMENT: ${env:ENVIRONMENT}
VERSION: ${env:VERSION}
custom:
customDomain:
domainName: ${env:VIEWERCENTRIC_API_DOMAIN}
dotenv:
include: none # To avoid all declared .env vars to be injected into all lambda functions (default)
webpack:
webpackConfig: "../../webpack.config.js"
includeModules:
packagePath: "../../package.json"
corsAllowOrigin: ${env:CORS_ALLOW_ORIGIN, '*'}
functions:
info:
handler: src/functions/info.handler
events:
- http:
path: /info
method: get
cors: true
resources:
Outputs:
ApiGatewayRestApiId:
Value:
Ref: ApiGatewayRestApi
Export:
Name: ${self:provider.apiName}-ApiGatewayRestApiId
The main yaml file is running this command:
npm run deploy:vc-integration-api --env=$DEPLOYMENT
I tried a few approaches to update the runtime to node18, but nothing worked so far.
Could anyone help me upgrading these files?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions