DEV Community

Discussion on: Create a Serverless API with AWS Chalice

Collapse
 
gustavosvalentim profile image
Gustavo Valentim

I saw this tool some weeks ago in Github, I had not the chance to use yet. Is it possible to modularize more like we do in other frameworks like Flask for example? e.g. using API Gateway as event source with a few endpoints.

Collapse
 
siakon89 profile image
Siaterlis Konstantinos

Yes, you can! You can use chalicelib folder to add your project's code and use the app.py only for the API paths.

You can also see here some examples of triggers, events, scheduled tasks: github.com/aws/chalice/blob/master...

Although I would recommend for bigger projects to use AWS SAM (Serverless Application Model). I am currently writing a tutorial for SAM.

Collapse
 
gustavosvalentim profile image
Gustavo Valentim

Cool, I will definitely take a look at this, thanks.

I have been working with SAM on last year, is quite good for big applications, but writing stuff in YAML sometimes is a bit stressful, mostly when you have 800+ lines in one template.

Thread Thread
 
siakon89 profile image
Siaterlis Konstantinos

Same here! A YAML template with 900 lines is hard to maintain!