Repository navigation
Fix hitting CloudFormation TemplateBody limit - #1886
Conversation
|
|
||
| module.exports = { | ||
| update() { | ||
| const templateUrl = `https://s3.amazonaws.com/${this.bucketName}/compiled-cloudformation-template.json`; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
The CloudFormation template will now be uploaded to S3 and referenced from there in the updateStack method.
5519402 to
ac6e040
Compare
|
Hi! Is this feature in Serverless v1.3 or will get into a new release? Thanks. |
|
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). |
|
@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 |
The CloudFormation template will now be uploaded to S3 and referenced from there
in the updateStack method.
Corresponding issue is #1740
/cc @flomotlik @eahefnawy