rubyonjets / jets

Ruby on Jets
http://rubyonjets.com
MIT License
2.6k stars 181 forks source link

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

Closed galetahub closed 4 years ago

galetahub commented 4 years ago

Checklist

My Environment

Software Version
Operating System Linux
Jets 2.3.0
Ruby 2.5.5

Expected Behaviour

Successfully deploy the project to AWS without any limitation errors

Current Behavior

AWS Template body size in a request is limited to 51,200 bytes https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html

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

Step-by-step reproduction instructions

Create a lot of routes with namespace and controllers for if.

Code Sample

Jets.application.routes.draw do
  namespace :api do
    namespace :v1 do
      namespace :feedbacks do
        resources :messages, only: [:index, :create]
      end

     # More then 100 lines of other routes
  end
end

Solution Suggestion

The most better solution is to upload the template file to s3. AWS says that the limit will be 460,800 bytes in this case. Then replace "template-body" with "template-url" when deploying stack to AWS

Thanks!

tongueroo commented 4 years ago

Done in #384 Thanks!