From 8c832c2bdddb6e3ca4dd6edecf7ab5225a23e4b5 Mon Sep 17 00:00:00 2001 From: Ari Pringle Date: Tue, 20 Jul 2021 17:06:19 -0600 Subject: [PATCH] remove DependsOn item that was failing CloudFormation template validation --- lib/stackops/apiGateway.js | 9 +++++++++ 1 file changed, 9 insertions(+) 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)