diff --git a/lib/plugins/aws/custom-resources/index.js b/lib/plugins/aws/custom-resources/index.js index f25eb3d0e..b8b9f8f01 100644 --- a/lib/plugins/aws/custom-resources/index.js +++ b/lib/plugins/aws/custom-resources/index.js @@ -164,7 +164,8 @@ async function addCustomResourceToService(awsProvider, resourceName, iamRoleStat let runtimeVersion = 'nodejs22.x'; const providerRuntime = awsProvider.getRuntime(); - if (providerRuntime.startsWith('nodejs')) { + // AWS SDK v3 is only bundled with Node.js 18 and up + if (providerRuntime.startsWith('nodejs') && Number(providerRuntime.substring(6, 8)) >= 18) { runtimeVersion = providerRuntime; }