dougmoscrop / serverless-plugin-split-stacks

A plugin to generate nested stacks to get around CloudFormation resource/parameter/output limits
297 stars 70 forks source link

CloudFormation Output count is greater than max allowed 60 #133

Open raman188 opened 4 years ago

raman188 commented 4 years ago

Using Serverless-split-stacks plugin, we try to split the stacks using two options: i) perType ii) perFunction

i) Using perType option, we receive - "The CloudFormation template is invalid: Template error: instance of Fn::GetAtt references undefined resource CheckIntegrationEventsRuleSchedule1" error. ii) Using perFunction option, we receive - "The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [IamRoleLambdaExecution] in the Resources block of the template" error.

Queries: i) How we can validate serverless.yml on local server? Please elaborate. ii) Is there something else we need to do on aws console to resolve cloud formation template related issues.

morficus commented 3 years ago

this seems to be related to #123

vicary commented 3 years ago

Basically this stack trace,

  1. https://github.com/dougmoscrop/serverless-plugin-split-stacks/blob/master/lib/utils.js#L84
  2. https://github.com/dougmoscrop/serverless-plugin-split-stacks/blob/master/lib/replace-outputs.js#L10
  3. https://github.com/dougmoscrop/serverless-plugin-split-stacks/blob/master/split-stacks.js#L65

replaceOutputs is ran after the migrateExistingResources and migrateNewResources above, and thus, bypasses the stack splitting logic altogether.

All these logics should have the migration logics included above,

      .then(() => this.replaceReferences())
      .then(() => this.replaceOutputs())
      .then(() => this.replaceConditions())
      .then(() => this.mergeStackResources())
      .then(() => this.sequenceStacks())

I am currently deciding if I should hard fork this, or make a huge refactor PR that is almost asking for a grinding halt.

vicary commented 3 years ago

My comment above should also applies to #91 and #123.