Skip to content

Plugin issue with serverless 3.39.0 #252

@grzes-94

Description

@grzes-94

custom-resources lambda is not being updated properly after updating to serveless 3.39.0 which changed lambda runtime to node18

Plugin searches for AWS.config.logger = console; here which was recently removed from serverless code.

In a result AWS.config.s3ForcePathStyle = true; is added at the end of the utils.js file

module.exports = {
  logger,
  response,
  getEnvironment,
  getLambdaArn,
  handlerWrapper,
  wait,
  MAX_AWS_REQUEST_TRY,
};AWS.config.s3ForcePathStyle = true;

Running lambda fails with exception as node18 lambdas uses AWS SDK v3

2024-06-18T09:45:55.149Z	undefined	ERROR	Uncaught Exception 	
{
    "errorType": "ReferenceError",
    "errorMessage": "AWS is not defined",
    "stack": [
        "ReferenceError: AWS is not defined",
        "    at Object.<anonymous> (/var/task/utils.js:107:3)",
        "    at Module._compile (node:internal/modules/cjs/loader:1364:14)",
        "    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)",
        "    at Module.load (node:internal/modules/cjs/loader:1203:32)",
        "    at Module._load (node:internal/modules/cjs/loader:1019:12)",
        "    at Module.require (node:internal/modules/cjs/loader:1231:19)",
        "    at require (node:internal/modules/helpers:177:18)",
        "    at Object.<anonymous> (/var/task/api-gateway-cloud-watch-role/handler.js:3:39)",
        "    at Module._compile (node:internal/modules/cjs/loader:1364:14)",
        "    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)"
    ]
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions