mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
EndpointDeployApiGateway: fix custom authorizer to use stages
This commit is contained in:
parent
b7ac4ce073
commit
4113003c1d
@ -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)});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user