diff --git a/lib/actions/EndpointDeployApiGateway.js b/lib/actions/EndpointDeployApiGateway.js index 30d8bf011..147cfb3d0 100644 --- a/lib/actions/EndpointDeployApiGateway.js +++ b/lib/actions/EndpointDeployApiGateway.js @@ -405,7 +405,7 @@ module.exports = function(S) { _this.authorizers[f.name] = a.id; // Add permission to the authorizer Lambda so API G can access it - let functionName = f.getDeployedName({ stage: _this.evt.options.stage, region}); + let functionName = f.getDeployedName({ stage: _this.evt.options.stage, region }); return _this._removeLambdaPermissionForAuthorizer(functionName, region) .then(function() { return _this._addLambdaPermissionForAuthorizer(functionName, region); @@ -490,6 +490,7 @@ module.exports = function(S) { let params = {}; params.Action = 'lambda:InvokeFunction'; params.FunctionName = functionName; + params.Qualifier = _this.evt.options.stage; params.Principal = 'apigateway.amazonaws.com'; params.StatementId = lambdaPolicyStatementId; params.SourceArn = 'arn:aws:execute-api:' @@ -559,7 +560,7 @@ module.exports = function(S) { + 'removed existing lambda access policy statement for this authorizer'); }) }) - .catch(function(error) {}); + .catch(function(error) {console.log(error)}); } }