diff --git a/lib/stackops/apiGateway.js b/lib/stackops/apiGateway.js index 26e069b..7c5669e 100644 --- a/lib/stackops/apiGateway.js +++ b/lib/stackops/apiGateway.js @@ -230,6 +230,15 @@ module.exports = function(currentTemplate, aliasStackTemplates, currentAliasStac } stageStack.Resources[name] = method; + + // Remove DependsOn for LambdaPermissionApiGateway since it is now owned by the alias stack + if (_.isArray(method.DependsOn)) { + _.forEach(method.DependsOn, (val, key) => { + if (_.endsWith(val, 'LambdaPermissionApiGateway')) { + method.DependsOn.splice(key, 1); + } + }); + } }); // Audjust authorizer Uri and name (stage variables are not allowed in Uris here)