Skip to content

Commit 7e8f97a

Browse files
committed
feat: check if the returned runtime is indeed a valid node runtime
1 parent 98292fd commit 7e8f97a

File tree

1 file changed

+5
-1
lines changed
  • lib/plugins/aws/custom-resources

1 file changed

+5
-1
lines changed

lib/plugins/aws/custom-resources/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,11 @@ async function addCustomResourceToService(awsProvider, resourceName, iamRoleStat
162162
});
163163
}
164164

165-
const runtimeVersion = providerConfig.runtime ? providerConfig.runtime : 'nodejs18.x';
165+
let runtimeVersion = 'nodejs18.x';
166+
const providerRuntime = awsProvider.getRuntime();
167+
if (providerRuntime.indexOf('nodejs') !== -1) {
168+
runtimeVersion = providerRuntime;
169+
}
166170

167171
const customResourceFunction = {
168172
Type: 'AWS::Lambda::Function',

0 commit comments

Comments
 (0)