nervous-systems / cljs-lambda

Utilities around deploying Clojurescript functions to AWS Lambda
The Unlicense
310 stars 34 forks source link

Default Node v4.3 End-of-Life'ed #107

Open adamneilson opened 6 years ago

adamneilson commented 6 years ago

I understand from the README that io.nervous/lein-cljs-lambda 0.6.0 defaults the runtime of deployed functions to nodejs4.3. However, I received the following message from AWS

Your AWS Account currently has one or more Lambda functions configured to use the Node.js v4.3 runtime. The Node Foundation declared End-of-Life (EOL) for Node.js v4 on April 30, 2018. As a result, this version of Node.js is no longer receiving bug fixes, security updates, or performance improvements from the Node Foundation. Per the AWS Lambda runtime support policy [2] , language runtimes that have been end-of-lifed by the supplier are deprecated in AWS Lambda. While invocations of Lambda functions configured to use Node.js v4.3 will continue to work normally, the ability to create new Lambda functions configured to use the Node.js v4.3 runtime will be disabled on July 31, 2018. Code updates to existing functions using Node.js v4.3 will be disabled on October 31, 2018. We strongly encourage you to update all your functions to a newer version of Node.js (v6.10 or v8.10) so that you continue to benefit from important security, performance, and functionality enhancements offered by the Node Foundation via more recent releases.

The README states this can be overriden with :runtime in the fn-spec or on the command-line. Does this mean something like this in the project.clj?

  :cljs-lambda
  {:defaults      {:role "FIXME"}
   :resource-dirs ["static"]
   :functions
   [{:name   "work-magic"
     :runtime  "nodejs8.10"
     :invoke example.core/work-magic}]}

If not, can anyone give me some guidance?

Given that functions using Node 4.3 will be disabled by the end of October, it might be prudent to default to a newer version of Node and let people set the :runtime back to v4.3 if they really need it?

moea commented 6 years ago

It seems like only yesterday that I upgraded it to 4.3!

Yeah, so doing that in project.clj will DTRT. If you run lein cljs-lambda update-config after making those changes, the runtime change ought to be reflected remotely.

I would happily accept a pull request to change the default, or else I'll get to it shortly.

If you're doing anything involved in terms of service structure, you want to consider using Serverless to deploy your cljs-lambda functions, with serverless-cljs-plugin.

prees1 commented 6 years ago

I see this has been resolved in #109 - What is the best way to utilize this, I don't see a new release.

Should I reference this repo in the project.clj file? (I've never done that)

I also couldn't get the :functions key to work, as described in the initial post.

Sorry if this is all obvious, but I am not a pro with cljs-lambda or a lot of this tooling.

Thanks!

moea commented 6 years ago

I should make a release.

phunanon commented 5 years ago

Nodejs 4.3 is still being used on my machine.

lein new cljs-lambda my-lambda-project
cd my-lambda-project
lein cljs-lambda default-iam-role
lein cljs-lambda deploy

Output:

...
aws lambda get-function-configuration --function-name work-magic
aws lambda create-function --role arn:aws:iam::xxxxxxxxxxxx:role/cljs-lambda-default --output text --runtime nodejs4.3 --zip-file fileb:///tmp/my-lambda-project/target/my-lambda-project/my-lambda-project.zip --query Version --handler index.my_lambda_project_core_SLASH_work_magic --function-name work-magic

An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The runtime parameter of nodejs4.3 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs10.x) while creating or updating functions.

Apologies if I should open a new issue for this.