puresec / serverless-puresec-cli

Serverless plugin for least privileges.
Other
247 stars 11 forks source link

Update to support node 10 runtime #16

Open hotgazpacho opened 5 years ago

hotgazpacho commented 5 years ago

I tried running this on my serverless project, which uses node 10 as the runtime. I got the following warning for all my functions, and no roles generated:

warn: lambda runtime not yet supported: `nodejs10.x` (for `xxx`)
raspy8766 commented 4 years ago

Same for Node 12:

warn: lambda runtime not yet supported: `nodejs12.x` (for `xxx`)
ashu3496 commented 4 years ago

@raspy8766 @hotgazpacho remove '.x' from runtime i.e. change 'nodejs10.x' to 'nodejs10' in serverless.yml and it should work.

It worked for me.

mcat-ee commented 3 years ago

The solution by @ashu3496 above still works, however Serverless will now fail to deploy if the '.x' is missing from the runtime.

Serverless: Updating Stack...
Serverless: Checking Stack update progress...
.......
Serverless: Operation failed!
Serverless: View the full error output: https://ap-southeast-2.console.aws.amazon.com/cloudformation/home?region=ap-southeast-2#/stack/detail?stackId=arn*

 Serverless Error ----------------------------------------

  ServerlessError: An error occurred: FUNCTIONNAME- Resource handler returned message: "Value nodejs12 at 'runtime' failed to satisfy constraint: Member must satisfy enum value set: [java8, java11, nodejs10.x, nodejs12.x, python2.7, python3.6, python3.7, python3.8, dotnetcore2.1, go1.x, ruby2.5] or be a valid ARN (Service: Lambda, Status Code: 400, Request ID: *, Extended Request ID: null)" (RequestToken: *, HandlerErrorCode: InvalidRequest).
      at /usr/lib/node_modules/serverless/lib/plugins/aws/lib/monitorStack.js:129:23
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
      at async AwsDeploy.update (/usr/lib/node_modules/serverless/lib/plugins/aws/lib/updateStack.js:144:5)

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              14.16.1
     Framework Version:         2.51.2
     Plugin Version:            5.4.3
     SDK Version:               4.2.3
     Components Version:        3.13.3

Serverless: Deprecation warnings:

CLI options definitions were upgraded with "type" property (which could be one of "string", "boolean", "multiple"). Below listed plugins do not predefine type for introduced options:
 - PureSecCLI for "function", "overwrite", "no-overwrite", "reference", "no-reference", "remove-obsolete", "no-remove-obsolete", "yes"
Please report this issue in plugin issue tracker.
Starting with next major release, this will be communicated with a thrown error.
More Info: https://www.serverless.com/framework/docs/deprecations/#CLI_OPTIONS_SCHEMA

Starting with next major, Serverless will throw on configuration errors by default. Adapt to this behavior now by adding "configValidationMode: error" to service configuration
More Info: https://www.serverless.com/framework/docs/deprecations/#CONFIG_VALIDATION_MODE_DEFAULT