araines / serverless-php

PHP for AWS Lambda via Serverless Framework
MIT License
150 stars 22 forks source link

SLS deploy not working anymore after nodjes6 deprecation #18

Open pcvvelzen opened 4 years ago

pcvvelzen commented 4 years ago

After the NodeJS 6 deprecation by AWS the serverless deploy no longer works.

The runtime configured to NodeJS 6.10 in serverless.yml:

...
provider:
  name: aws
  runtime: nodejs6.10
...

Causes the following error on Serverless deploy

$ serverless deploy
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Creating Stack...
Serverless: Checking Stack create progress...
........
Serverless: Stack create finished...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service xxx-serverless-php.zip file to S3 (3.92 KB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
................
Serverless: Operation failed!
Serverless: View the full error output: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stack/detail?stackId=xxxxxxxxxxxxx

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

  An error occurred: HelloLambdaFunction - The runtime parameter of nodejs6.10 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs12.x) while creating or updating functions. (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx).
araines commented 4 years ago

This should be as simple as changing the runtime value within the serverless.yml (contributions welcomed!). However I would also say that this way of building PHP services on top of Lambda is probably a bit out of date now since AWS introduced Lambda Layers.

Unfortunately I'm somewhat out of the PHP/Serverless community now, so I'm not actively maintaining this project, but hopefully that helps get you going in the right direction.