sparkleformation / sfn

SparkleFormation CLI
http://www.sparkleformation.io
Apache License 2.0
63 stars 24 forks source link

SFN Validate fails when it shouldn't for nested templates #272

Closed ls-pieter-vanisacker closed 6 years ago

ls-pieter-vanisacker commented 6 years ago

While validating stacks it seems like SFN provides the stack as template body to the AWS CloudFormation API. When uploading in such a way there's a limit of 51200 bytes for a template. This happens for the root stack and for the nested stacks.

But for nested stacks there's a much higher character limit: 460800 bytes. See: https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ValidateTemplate.html

https://github.com/sparkleformation/sfn/blob/develop/lib/sfn/command/validate.rb would probably need to be fixed so that it recognizes uploading nested stacks. And validates these using a template url parameter.

$ sfn -v
sfn - SparkleFormation CLI - [Version: 3.0.22]
jimcroft commented 6 years ago

IIRC you can add upload_root_template true to your .sfn config file or pass --upload-root-template on the command line to ensure root (and nested if being used) templates are uploaded to S3 first. You'll also need the nesting_bucket config set and appropriate permissions in place.

Hope that helps.

ls-pieter-vanisacker commented 6 years ago

Great, that seems to have done the trick and upload the files through S3!