EndpointDeployApiGateway: fix custom authorizer to use stages

This commit is contained in:
ac360 2016-03-17 16:27:04 -07:00
parent b7ac4ce073
commit 4113003c1d

View File

@ -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)});
}
}