Specifying the authorizer in the routes.rb with CORS enabled breaks jets.
Checklist
[X] Upgrade Jets: Are you using the latest version of Jets? This allows Jets to fix issues fast. There's a jets upgrade command that makes this a simple task. There's also an Upgrading Guide: http://rubyonjets.com/docs/upgrading/
[X] Reproducibility: Are you reporting a bug others will be able to reproduce and not asking a question. If you're unsure or want to ask a question, do so on https://community.rubyonjets.com
[X] Code sample: Have you put together a code sample to reproduce the issue and make it available? Code samples help speed up fixes dramatically. If it's an easily reproducible issue, then code samples are not needed. If you're unsure, please include a code sample.
When enabling CORS or when specifying the authorizer in routes.rb causes a deployment failure.
When trying to manually enable CORS in AWS you see "Invalid Response status code Specified"
Step-by-step reproduction instructions
Enable CORS
Specify the authorizer in the routes.rb
Perform a jets deploy
03:40:19PM UPDATE_IN_PROGRESS AWS::CloudFormation::Stack api-dev User Initiated
03:40:23PM UPDATE_IN_PROGRESS AWS::CloudFormation::Stack ApiGateway
03:40:23PM UPDATE_IN_PROGRESS AWS::CloudFormation::Stack JetsPreheatJob
03:40:23PM UPDATE_COMPLETE AWS::CloudFormation::Stack ApiGateway
03:40:25PM UPDATE_IN_PROGRESS AWS::CloudFormation::Stack ApiResources1
03:40:26PM UPDATE_IN_PROGRESS AWS::CloudFormation::Stack MainAuthorizer
03:40:26PM UPDATE_COMPLETE AWS::CloudFormation::Stack ApiResources1
03:40:28PM UPDATE_IN_PROGRESS AWS::CloudFormation::Stack JetsPublicController
03:40:37PM UPDATE_FAILED AWS::CloudFormation::Stack MainAuthorizer Embedded stack arn:aws:cloudformation:eu-west-1:123456789024:stack/api-dev-MainAuthorizer-ABCDEFGHIJKL/e4aa2950-87ec-11ea-9236-01234567890a was not successfully updated. Currently in UPDATE_ROLLBACK_IN_PROGRESS with reason: The following resource(s) failed to update: [MyCognitoAuthorizer].
03:40:37PM UPDATE_FAILED AWS::CloudFormation::Stack JetsPreheatJob Resource update cancelled
03:40:48PM UPDATE_FAILED AWS::CloudFormation::Stack JetsPublicController Resource update cancelled
03:40:48PM UPDATE_ROLLBACK_IN_PROGRESS AWS::CloudFormation::Stack api-dev The following resource(s) failed to update: [JetsPublicController, MainAuthorizer, JetsPreheatJob].
Dug into this. Tried to reproduce and wasn't able to. Guessing that some point between 2.3.16 and the current version it was fixed. Thanks for the report.
Specifying the authorizer in the routes.rb with CORS enabled breaks jets.
Checklist
jets upgrade
command that makes this a simple task. There's also an Upgrading Guide: http://rubyonjets.com/docs/upgrading/My Environment
Expected Behaviour
jets deploy should work. CORS should be enabled.
Current Behavior
When enabling CORS or when specifying the authorizer in routes.rb causes a deployment failure. When trying to manually enable CORS in AWS you see "Invalid Response status code Specified"
Step-by-step reproduction instructions
Enable CORS Specify the authorizer in the routes.rb Perform a jets deploy
Code Sample
https://github.com/iqre8/jets-example-api/commit/cc051aa427caee891930888febdf38f8d6dbd83a
Solution Suggestion
For now I just enable CORS, and specify the authorizer in the controller.