@@ -225,7 +225,8 @@ module.exports = function(currentTemplate, aliasStackTemplates, currentAliasStac
225
225
const authorizerType = _ . get ( authorizer , 'Properties.Type' ) ;
226
226
if ( authorizerType === 'TOKEN' || authorizerType === 'REQUEST' ) {
227
227
const uriParts = authorizer . Properties . AuthorizerUri [ 'Fn::Join' ] [ 1 ] ;
228
- if ( _ . every ( uriParts , part => ! _ . startsWith ( part , 'arn:aws:lambda' ) ) ) {
228
+ const isExternalRefAuthorizer = _ . every ( uriParts , part => ! _ . startsWith ( part , 'arn:aws:lambda' ) ) ;
229
+ if ( isExternalRefAuthorizer ) {
229
230
const funcIndex = _ . findIndex ( uriParts , part =>
230
231
_ . has ( part , 'Fn::GetAtt' ) || _ . startsWith ( part , 'arn:aws:lambda' ) ) ;
231
232
@@ -269,8 +270,7 @@ module.exports = function(currentTemplate, aliasStackTemplates, currentAliasStac
269
270
const versionName = _ . find ( _ . keys ( versions ) , version => _ . startsWith ( version , functionName ) ) ;
270
271
const aliasName = _ . find ( _ . keys ( aliases ) , alias => _ . startsWith ( alias , functionName ) ) ;
271
272
const isExternalRef = _ . startsWith ( permission . Properties . FunctionName , 'arn:aws:lambda' ) ;
272
-
273
- console . log ( 'checking permission: ' , name , JSON . stringify ( permission ) , ' isExternalRef: ' + isExternalRef ) ;
273
+
274
274
// Adjust references and alias permissions
275
275
if ( ! isExternalRef ) {
276
276
permission . Properties . FunctionName = { Ref : aliasName } ;
0 commit comments