Skip to content

Fix hitting CloudFormation TemplateBody limit - #1886

Merged
pmuens merged 2 commits into
masterfrom
fix-hitting-cloudformation-template-body-limit
Aug 19, 2016
Merged

pmuens merged 2 commits into
masterfrom
fix-hitting-cloudformation-template-body-limit

Conversation

@pmuens

@pmuens pmuens commented Aug 17, 2016

Copy link
Copy Markdown
Contributor

The CloudFormation template will now be uploaded to S3 and referenced from there
in the updateStack method.

Corresponding issue is #1740

/cc @flomotlik @eahefnawy

@pmuens pmuens added this to the v1.0.0-beta.3 milestone Aug 17, 2016
@pmuens pmuens self-assigned this Aug 17, 2016

module.exports = {
update() {
const templateUrl = `https://s3.amazonaws.com/${this.bucketName}/compiled-cloudformation-template.json`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make this a bit more random, or with a timestamp in the file name? This way you could potentially rollback if needed? Otherwise the file would be overwritten.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm not sure about that. We don't wanna mess up the bucket, and the name should be predictable/constructible in case we wanna access it programmatically later. What's your thoughts on this @pmuens ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nicka / @eahefnawy for your comments!
Yep. Was also thinking about to add a timestamp and deploy it (like we do with the 5 last versions of the .zip file) but IMHO it's too much overhead for now. Maybe we can include this in another PR but dealing with the S3 bucket cleanup is kind of tedious.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 For separate PR

The CloudFormation template will now be uploaded to S3 and referenced from there
in the updateStack method.
@pmuens
pmuens force-pushed the fix-hitting-cloudformation-template-body-limit branch from 5519402 to ac6e040 Compare August 18, 2016 10:10
@pmuens
pmuens merged commit f63a481 into master Aug 19, 2016
@pmuens
pmuens deleted the fix-hitting-cloudformation-template-body-limit branch August 19, 2016 06:15
@asantibanez

Copy link
Copy Markdown

Hi! Is this feature in Serverless v1.3 or will get into a new release? Thanks.

@asantibanez

Copy link
Copy Markdown

Just found out it was pushed on v1.3. Although the applied solution does not work. The Cloud Formation limits indicates you can't have more than 200 resources on a CF stack. If in need of more, it can only be done using Nested Stacks.

I am currently using a micro-service approach for all the lambdas in my project and I have reached the 200 resources limit (214 according to CF error).

cc @pmuens @nicka @eahefnawy

@nicka

nicka commented Dec 5, 2016

Copy link
Copy Markdown
Contributor

@asantibanez This PR had to do with the CloudFormation template file size in bytes. Unfortunately it has nothing to do with the amount of CloudFormation resources. I know it sucks when you reach this state (encountered it myself a few times in the past).

To my knowledge AWS will not bump to amount of resources. Best you could do is try to split your service into smaller 'services'. AWS recently added support for Fn::ImportValue which makes it a lot easier to connect/link multiple CloudFormation stacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants