Skip to content

Large Cloudformation Templates (>51,200 Bytes) cause error on alias remove #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mbruning24 opened this issue Mar 6, 2018 · 4 comments

Comments

@mbruning24
Copy link

We have a particularly large serverless package (~15 functions) and when we try to remove an alias on it, we get the error:

'templateBody' failed to satisfy constraint: Member must have length less than or equal to 51200

It seems to actually remove the alias, but the serverless execution does not run to completion. Is there a way for the plugin to use S3 as a mechanism for CF templates that are really really big?

@HyperBrain
Copy link
Member

@mbruning24 Thanks for the report. Oh, I think you're right. Deployment & co use S3 already (in the same way as Serverless does), but remove alias also generates a new CF template for the base stack. I think I just missed to apply the same mechanism there.

It would be great if someone could provide a PR to solve the issue.

@dgoradia
Copy link

dgoradia commented Jul 2, 2018

I hit that same issue today as well. @HyperBrain are you working on this? Not sure where to start on PR myself but if you point me I can give it a go.

@HyperBrain
Copy link
Member

@dgoradia Thanks for helping out 👍 . The remove command is a separate file and the specific errorneous line is here: https://github.com/HyperBrain/serverless-aws-alias/blob/master/lib/removeAlias.js#L158

Instead of putting the template into the TemplateBody property, it should be uploaded to S3 (same as with the deploy) and only the S3 object should be referenced there.

@mattsemar
Copy link

@HyperBrain I took a stab at this. Would appreciate any feedback. #150

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

No branches or pull requests

4 participants