# Update node version of the -custom-resource-apigw-cw-role

**URL:** <https://forum.serverless.com/t/update-node-version-of-the-custom-resource-apigw-cw-role/19160>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [July 17, 2023, 10:07am UTC](https://forum.serverless.com/t/update-node-version-of-the-custom-resource-apigw-cw-role/19160 "2023-07-17T10:07:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rlillo](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@rlillo](https://forum.serverless.com/u/rlillo)\
**Post date:** [July 17, 2023, 10:07am UTC](https://forum.serverless.com/t/update-node-version-of-the-custom-resource-apigw-cw-role/19160/1 "2023-07-17T10:07:19Z")

</div>

Hi,

Node version 16.X will be deprecated soon, and I need to upgrade my lambdas (-custom-resource-apigw-cw-role) to node 18.X or higher, how can I do it?

---

<div class="post-metadata">

**Author:** ![buggy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/buggy/32/177_2.png) [@buggy](https://forum.serverless.com/u/buggy)\
**Post date:** [July 18, 2023, 11:05am UTC](https://forum.serverless.com/t/update-node-version-of-the-custom-resource-apigw-cw-role/19160/2 "2023-07-18T11:05:58Z")

</div>

Do you see a `runtime:` under either `provider` or each of the functions? It probably says `runtime: nodejs16.x`. Change that to `runtime: nodejs18.x`

---

<div class="post-metadata">

**Author:** ![rlillo](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@rlillo](https://forum.serverless.com/u/rlillo)\
**Post date:** [July 18, 2023, 11:14am UTC](https://forum.serverless.com/t/update-node-version-of-the-custom-resource-apigw-cw-role/19160/3 "2023-07-18T11:14:18Z")

</div>

> [@buggy](#):
>
> `16.x`. Change that to `runtime: nodejs18.x`

My functions are running in dotnet6.

In my serveless.yml file I don’t have nodejs reference directly

---

<div class="post-metadata">

**Author:** ![buggy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/buggy/32/177_2.png) [@buggy](https://forum.serverless.com/u/buggy)\
**Post date:** [July 18, 2023, 11:36am UTC](https://forum.serverless.com/t/update-node-version-of-the-custom-resource-apigw-cw-role/19160/4 "2023-07-18T11:36:58Z")

</div>

Are you using any custom plugins?

---

<div class="post-metadata">

**Author:** ![rlillo](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@rlillo](https://forum.serverless.com/u/rlillo)\
**Post date:** [July 18, 2023, 11:51am UTC](https://forum.serverless.com/t/update-node-version-of-the-custom-resource-apigw-cw-role/19160/5 "2023-07-18T11:51:14Z")

</div>

Yes, I’m using a serverless plugin, but the \ ***-custom-resource-apigw-cw-role** isn’t created by serverless framework in REST API functions?

---

<div class="post-metadata">

**Author:** ![buggy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/buggy/32/177_2.png) [@buggy](https://forum.serverless.com/u/buggy)\
**Post date:** [July 20, 2023, 7:57am UTC](https://forum.serverless.com/t/update-node-version-of-the-custom-resource-apigw-cw-role/19160/6 "2023-07-20T07:57:04Z")

</div>

There’s a good chance that plugin is creating the Lambda that’s causing the problem. Potentially the easiest solution is just to update the plugin version and deploy again. You can be certain by looking through the Lambda console to find the Lambda function that is causing the problem then use the CloudFormation console to determine how it’s being deployed.

---

<div class="post-metadata">

**Author:** ![chris](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/chris/32/279_2.png) [@chris](https://forum.serverless.com/u/chris)\
**Post date:** [December 20, 2023, 8:33pm UTC](https://forum.serverless.com/t/update-node-version-of-the-custom-resource-apigw-cw-role/19160/7 "2023-12-20T20:33:48Z")

</div>

To my understanding, these resources are created by the Serverless framework, when you enable API Gateway logs. This is not a plugin, but part of core Serverless framework. Since these resources are done by the framework, we as framework users don’t have any ability to set the runtime used (e.g. my project is all Go code, I don’t use JS at all, but these resources are created behind the scenes with JS by Serverless). This is problematic, as everyone is now seeing in that AWS is deprecating these older Node versions, but this code and the runtime it uses doesn’t seem to be getting updated along with updates to the Serverless framework. Since this is somewhat of a black box, it’s not clear how safe it is for us to just go into the AWS console and change the runtime (i.e. from 16 to 20, which is now the current recommended).

---

<div class="post-metadata">

**Author:** ![robin\_w](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/robin_w/32/7775_2.png) [@robin\_w](https://forum.serverless.com/u/robin_w)\
**Post date:** [January 16, 2024, 3:24pm UTC](https://forum.serverless.com/t/update-node-version-of-the-custom-resource-apigw-cw-role/19160/8 "2024-01-16T15:24:31Z")

</div>

I’m also trying to upgrade nodejs16 lambdas and got the same issue. Is there any pernament solution?

---

<div class="post-metadata">

**Author:** ![tonivdv](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/tonivdv/32/4062_2.png) [@tonivdv](https://forum.serverless.com/u/tonivdv)\
**Post date:** [January 30, 2024, 1:28pm UTC](https://forum.serverless.com/t/update-node-version-of-the-custom-resource-apigw-cw-role/19160/9 "2024-01-30T13:28:34Z")

</div>

this is the solution [Use nodejs18 in custom-resources by svoychik · Pull Request #12146 · serverless/serverless · GitHub](https://github.com/serverless/serverless/pull/12146) … but needs some love from Serverless Inc to get it merged …
