rubyonjets / jets

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

Deploy: ERROR: Template format error: Outputs count 64 is greater than max allowed 60 #392

Closed galetahub closed 5 years ago

galetahub commented 5 years ago

Checklist

My Environment

Software Version
Operating System Linux
Jets 2.3.1
Ruby 2.5.5

Expected Behaviour

Deploy without any errors

Current Behavior

When deploying a big application got the error: ERROR: Template format error: Outputs count x is greater than max allowed 60

Step-by-step reproduction instructions

Code Sample

I think the bug is in the main template. Below Outputs part of my main CFN template. As you can see, Outputs section has more then 60 properties.

Description: 'Jets: 2.3.1 Code: 20ee07e3'
Outputs:
  S3Bucket:
    Value: !Ref S3Bucket
  IamRole:
    Value: !Ref IamRole
  GemLayer:
    Value: !Ref GemLayer
  ApiV1StoreGsmOperatorsController:
    Value: !Ref ApiV1StoreGsmOperatorsController
  ApiV1RsnStaffsController:
    Value: !Ref ApiV1RsnStaffsController
  ApiV1AcquiringProvidersController:
    Value: !Ref ApiV1AcquiringProvidersController
  ApiV1StoreAcquiringDocumentTypesController:
    Value: !Ref ApiV1StoreAcquiringDocumentTypesController
  ApiV1StoreOrdersController:
    Value: !Ref ApiV1StoreOrdersController
  ApiV1StoreCompaniesController:
    Value: !Ref ApiV1StoreCompaniesController
  ApiV1NovaposhtaCitiesController:
    Value: !Ref ApiV1NovaposhtaCitiesController
  ApiV1SignupConfirmationsController:
    Value: !Ref ApiV1SignupConfirmationsController
  ApiV1ManageStoreColorsController:
    Value: !Ref ApiV1ManageStoreColorsController
  ApiV1AuthSessionsController:
    Value: !Ref ApiV1AuthSessionsController
  ApiV1RegionsController:
    Value: !Ref ApiV1RegionsController
  ApiV1ManageStoreProductsController:
    Value: !Ref ApiV1ManageStoreProductsController
  ApiV1InventoryImportProductsController:
    Value: !Ref ApiV1InventoryImportProductsController
  ApiV1ManageRegionsController:
    Value: !Ref ApiV1ManageRegionsController
  ApiV1AssetsEndpointsController:
    Value: !Ref ApiV1AssetsEndpointsController
  ApiV1ManageStoreBusinessCategoriesController:
    Value: !Ref ApiV1ManageStoreBusinessCategoriesController
  ApiV1StoreDeliveriesController:
    Value: !Ref ApiV1StoreDeliveriesController
  ApiV1RsnEmployeesController:
    Value: !Ref ApiV1RsnEmployeesController
  ApiV1StoreInvoicesController:
    Value: !Ref ApiV1StoreInvoicesController
  JetsPreheatJob:
    Value: !Ref JetsPreheatJob
  ApiV1NovaposhtaWarehousesController:
    Value: !Ref ApiV1NovaposhtaWarehousesController
  ApiV1StoreColorsController:
    Value: !Ref ApiV1StoreColorsController
  ApiV1ManageAcquiringProvidersController:
    Value: !Ref ApiV1ManageAcquiringProvidersController
  ApiV1AcquiringRulesController:
    Value: !Ref ApiV1AcquiringRulesController
  ApiV1SignupValidationsController:
    Value: !Ref ApiV1SignupValidationsController
  ApiV1StorePreOrdersController:
    Value: !Ref ApiV1StorePreOrdersController
  ApiV1InventoryProductsController:
    Value: !Ref ApiV1InventoryProductsController
  ApiV1InventoryCoreCategoriesController:
    Value: !Ref ApiV1InventoryCoreCategoriesController
  ApiV1PosCoreTerminalsController:
    Value: !Ref ApiV1PosCoreTerminalsController
  ApiV1ManageStoreAcquiringDocumentTypesController:
    Value: !Ref ApiV1ManageStoreAcquiringDocumentTypesController
  ApiV1ManageDepartmentsController:
    Value: !Ref ApiV1ManageDepartmentsController
  ApiV1FeedbacksMessagesController:
    Value: !Ref ApiV1FeedbacksMessagesController
  ApiV1ManageInventoryCoreProductsController:
    Value: !Ref ApiV1ManageInventoryCoreProductsController
  ApiV1ManageInventoryCoreCategoriesController:
    Value: !Ref ApiV1ManageInventoryCoreCategoriesController
  ApiV1StoreProductsController:
    Value: !Ref ApiV1StoreProductsController
  ApiV1PosPartnersController:
    Value: !Ref ApiV1PosPartnersController
  ApiV1InventoryCategoryTypesController:
    Value: !Ref ApiV1InventoryCategoryTypesController
  ApiV1StoreBusinessCategoriesController:
    Value: !Ref ApiV1StoreBusinessCategoriesController
  ApiV1ManageInventoryCategoryTypesController:
    Value: !Ref ApiV1ManageInventoryCategoryTypesController
  ApiV1AuthRefreshController:
    Value: !Ref ApiV1AuthRefreshController
  NotificationJob:
    Value: !Ref NotificationJob
  ApiV1StoreFopsController:
    Value: !Ref ApiV1StoreFopsController
  ApiV1ManageBanksController:
    Value: !Ref ApiV1ManageBanksController
  ApiV1CitiesController:
    Value: !Ref ApiV1CitiesController
  ApiV1ManageStoreOrdersController:
    Value: !Ref ApiV1ManageStoreOrdersController
  ApiV1ManageStoreGsmOperatorsController:
    Value: !Ref ApiV1ManageStoreGsmOperatorsController
  ApiV1BanksController:
    Value: !Ref ApiV1BanksController
  ImportInventoryProductsJob:
    Value: !Ref ImportInventoryProductsJob
  ApiV1BillingPlansController:
    Value: !Ref ApiV1BillingPlansController
  ApiV1ManageBillingPlansController:
    Value: !Ref ApiV1ManageBillingPlansController
  ApiV1InventoryCoreProductsController:
    Value: !Ref ApiV1InventoryCoreProductsController
  ApiV1DepartmentsController:
    Value: !Ref ApiV1DepartmentsController
  ApiV1ManageAcquiringRulesController:
    Value: !Ref ApiV1ManageAcquiringRulesController
  ApiV1InventoryCategoriesController:
    Value: !Ref ApiV1InventoryCategoriesController
  ApiV1SignupUsersController:
    Value: !Ref ApiV1SignupUsersController
  ApiV1RsnShopsController:
    Value: !Ref ApiV1RsnShopsController
  ApiV1ManageCitiesController:
    Value: !Ref ApiV1ManageCitiesController
  ApiGateway:
    Value: !Ref ApiGateway
  ApiResources1:
    Value: !Ref ApiResources1
  ApiResources2:
    Value: !Ref ApiResources2
  ApiDeployment20191016200810:
    Value: !Ref ApiDeployment20191016200810

Solution Suggestion

The possible solution, I think, is to move controllers definition into a separate templates

Thanks!

tongueroo commented 5 years ago

Impressed that the Jets app is that large. Fixed by #395

It is handled by removing Controller and Job Outputs in the parent template, which are unused. This increases the limit of resources, IE: Controllers and Jobs, by almost 4x.

If apps hit the max CloudFormation Resources Limit of 200, it'll be more challenging, IE: moving Controllers to another template is pretty complex.

galetahub commented 5 years ago

Hi @tongueroo, Thanks for the fix!