Skip to content

Commit 2eee05a

Browse files
committed
fix: correctly resolve lambda function name from Arguments or Parameters
1 parent 67ddb59 commit 2eee05a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/deploy/stepFunctions/compileIamRole.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ function getRedshiftDataPermissions(action, state) {
362362
function getLambdaPermissions(state) {
363363
// function name can be name-only, name-only with alias, full arn or partial arn
364364
// https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_RequestParameters
365-
const functionName = state.Parameters.FunctionName;
365+
const functionName = getParameterOrArgument(state, 'FunctionName');
366366
if (_.isString(functionName)) {
367367
const segments = functionName.split(':');
368368

@@ -429,10 +429,11 @@ function getLambdaPermissions(state) {
429429
}];
430430
}
431431

432-
if (state.Parameters['FunctionName.$']) {
432+
if (getParameterOrArgument(state, 'FunctionName.$')) {
433+
const allowedFunctions = getParameterOrArgument(state, 'AllowedFunctions');
433434
return [{
434435
action: 'lambda:InvokeFunction',
435-
resource: state.Parameters.AllowedFunctions ? state.Parameters.AllowedFunctions : '*',
436+
resource: allowedFunctions || '*',
436437
}];
437438
}
438439

0 commit comments

Comments
 (0)