diff --git a/lib/commands/template.js b/lib/commands/template.js index 8d9932f..fab5364 100644 --- a/lib/commands/template.js +++ b/lib/commands/template.js @@ -43,6 +43,8 @@ const findResources = (template, type) => { }, {}) } +const isLambdaIntegrationType = type => (['aws', 'aws_proxy'].indexOf(type) !== -1) + const addApiLambdaPermissions = template => { log.title('Adding API Lambda invoke permissions') const apiResources = findResources(template, 'AWS::Serverless::Api') @@ -54,7 +56,7 @@ const addApiLambdaPermissions = template => { Object.keys(paths).map(pathName => paths[pathName]).forEach(path => { Object.keys(path).map(methodName => path[methodName]).forEach((method) => { const integration = method['x-amazon-apigateway-integration'] - if (integration && integration.type === 'aws_proxy' && integration.uri) { + if (integration && isLambdaIntegrationType(integration.type) && integration.uri) { const lambdaArn = extractLambdaArn(integration.uri) if (lambdaArn) { arns.add(lambdaArn)