[HN Gopher] Stelvio: Serverless AWS for Python Devs
___________________________________________________________________
Stelvio: Serverless AWS for Python Devs
Author : milsebg
Score : 42 points
Date : 2025-03-20 08:37 UTC (14 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| globular-toast wrote:
| Surprised to not see a comparison Serverless Framework:
| https://www.serverless.com/
|
| The above recently did a rug pull and being developed in JS means
| it's not great for Python devs to maintain an open source
| version, so good to see alternatives in Python.
| BerislavLopac wrote:
| There is also Mangum [0], which can wrap up any ASGI app and
| deploy it as a lambda.
|
| [0] https://mangum.fastapiexpert.com/
| przemub wrote:
| Eugh. What rug pull do you mean?
| cebert wrote:
| Serverless Framework changed their license terms in v4 to a
| paid model. It's also not getting a lot of new development or
| community support anymore. It's slowly dying and time to move
| off of it.
| michal-stlv wrote:
| Hello,
|
| author of Stelvio here. Stelvio is in very early alpha far from
| any production use, but it's able to deploy simple API gateway,
| lambda and dynamo db tables with just few lines of code.
|
| Idea is that Python devs should be able to deal with infra with
| Python only and minimal boilerplate - simple thing should be
| simple.
|
| I'm currently working on v 0.2.0 which will have support for
| lambda dependencies & layers, Dynamo indexes and CORS and
| authorizers for API gateway.
|
| I hope to release that in April.
|
| For v0.3.0, stelvio will get it's own CLI too.
|
| Any feedback is welcomed here or michal at stelvio.dev
|
| Michal
| calgoo wrote:
| Hi! Honest question, why did decide on using pulomi instead of
| just using the boto3 Python library to interact with aws? Feels
| like it adds a lot of overhead where something like boto3 could
| just be abstracted away?
| michal-stlv wrote:
| Hi! Good question, few reasons:
|
| 1. state management & stages - pulumi already deals with
| state and has support for stages (stacks) which stelvio will
| need.
|
| 2. there are things outside of AWS that stelvio might support
| later (cloudflare, etc.)
|
| Initially I was gonna use AWS CDK which I use at work but
| Pulumi seems to have faster deployment and option to use
| other things than AWS. (Although AWS is main focus of Stelvio
| at leats for now)
| throwaway032023 wrote:
| Why not Zappa?
|
| https://github.com/zappa/Zappa
| michal-stlv wrote:
| Hi! AFAIK in Zappa you don't define infra in Python but
| rather in json. Also the vision of Stelvio is broader than
| just serverless. I wrote about my vision here
| https://blog.stelvio.dev/why-i-am-building-stelvio/ if you're
| interested.
| stuaxo wrote:
| The cloud is too complex.
|
| While it's good to enable proprietary solutions like AWS,
| we should always make sure what we make is not bound to it.
|
| This might mean that stelvio becomes a part of something
| more general.
| puppion wrote:
| How is this better than AWS CDK, and why are you not using
| CloudFormation? Seems like the sane thing to do in 2025
| michal-stlv wrote:
| I guess this question is not aimed at me as I'm not OP but I'll
| try to answer as the author of stelvio. I use CDK at my day job
| every day.
|
| I like CDK, it was huge step forward compared to Cloud
| Formation, Terraform etc.
|
| But I think infra tools can be still made better for
| developers. In stelvio you can do this: table =
| DynamoTable( name="todos", fields={
| "username": AttributeType.STRING, "created":
| AttributeType.STRING, },
| partition_key="username", sort_key='created' )
| api = Api("todo-api") api.route("POST", "/todos",
| handler="functions/todos.post", links=[table])
| api.route("GET", "/todos/{username}",
| handler="functions/todos.get")
|
| It creates:
|
| - DynamoDB table
|
| - Lambda function with IAM (policy - with permissions for
| dynamo table, role)
|
| - API Gateway (resources, methods, integrations, role, stage &
| deployment)
|
| - CloudWatch log groups
|
| It would be much more code in CDK.
|
| Stelvio aims to make common things much simpler while allowing
| you to change details if you need to.
| rectalogic wrote:
| CDK has high level constructs like
| aws_ecs_patterns.ApplicationLoadBalancedFargateService etc.
| It seems like the above could be implemented as high level
| CDK constructs. So you could make common things simpler, but
| have the full CDK to change details if needed.
| btreecat wrote:
| Neat tool!
|
| Not sure I agree with the choices on the AWS side, particularly
| lambda and dynamo. They seem great when you first start, but I've
| found the pain comes with maturing code.
|
| As professionals, we should always plan for our code to live
| longer than we thought originally, and supporting new use cases
| not in the initial design.
|
| A cheap always on server and a hosted RDBMS are going to go a lot
| further for next to the same mental overhead.
| ForTheKidz wrote:
| Both of these tools hit the sweet spot starting out--good
| performance for cheap (not _entirely_ true if you consider the
| free tier of sql services, but I 've had bad experiences with
| those). It's the lock-in and traffic that kills you.
| michal-stlv wrote:
| > Neat tool!
|
| thanks! (author here not OP)
|
| lambda/api/dynamo is just a start. I have very clear vision
| where i want to take this and it's not limited to
| lambda/api/dynamo. but these are easier to start with before
| you get to VPC, NAT, security groups etc. etc.
| robertlagrant wrote:
| Would love something that sets up EKS and ingress without me
| tearing my hair out and actually wishing I were using Azure
| (yikes).
| reedf1 wrote:
| How does this differ from Chalice? Or is it a replacement now
| that it is being deprecated?
| michal-stlv wrote:
| Hey, I was looking for similar tool before starting building
| stelvio and I found Chalice. It looked good, it's a nice tool
| but:
|
| - as you mentioned, seems to be abandoned
|
| - chalice mixes infra code with app code within the file
| (decorators), stelvio keeps them separate
|
| - in chalice you configure lambdas using json. I strongly
| believe that everything should be done in python
|
| - chalice is limited to lambda/api/queues, stelvio aims to go
| further/broader
|
| hope this explains, happy to answer any other questions
| nargella wrote:
| Not trying to detract from the OP, but to provide a combination I
| have running in production for 2 years.
|
| - aws cdk (with outputs) - https://github.com/zappa/Zappa - a
| python script which stitches outputs from cdk into the zappa
| config - extra python scripts to do a few small things post
| deployment. Zappa has some bugs that would be tedious to fix vs
| 100 lines of python.
|
| Our product has the luxury of only being used during stock market
| hours and really thrives in serverless everything. We use rds
| serverless (v2) along with lambdas.
|
| Some of our work is heavy and we'll dynamically spin up an ecs
| container which has the hallmarks of a normal django app: redis +
| celery queues. We try to saturate the ecs container resources
| with this type of setup. After the container is done, it'll
| shutdown.
|
| I was super skeptical of this 2 years ago. 4 envs costing
| ~$2k/month. I would do this setup again if the product warrants
| windowed usage.
| Locutus_ wrote:
| This also seems a bit like AWS Chalice reinvented, which might be
| a good thing as AWS has silently abandoned it.
| JohnScolaro wrote:
| I recently made a serverless lambda/dynamo webapp following
| similar patterns and wrote about the experience here:
| https://johnscolaro.xyz/blog/serverless-python-websites
|
| I think it's amazing the python community has like 5 half baked
| solutions to this problem, all of which are either abandoned,
| poorly monetized, or have a janky UI. I mean we have: Zappa,
| Chalice, Serverless, and if you attempt to do it yourself, do you
| use Cloudformation, CDK, or AWS SAM?
|
| Following with interest, I think there is room for better tool in
| this space.
| michal-stlv wrote:
| Nice writing and summary there. As an author of stelvio I felt
| the same. It's not that there're no tools. But none of them is
| covering enough AWS surface while being truly focused on Python
| devs. Some are general infra tools (CDK, Pulumi) focused on
| infra people, where python is not primary language, some are
| Python tools like Chalice (likely abandonded) and some are
| meant for Python devs but use json (Zappa).
|
| I wrote my own thinking here https://blog.stelvio.dev/why-i-am-
| building-stelvio/
|
| I 'm working hard on Stelvio hoping it can become the best tool
| to do infra in Python.
|
| Btw. If you'd be willing to share more details about what you
| want/miss in python cloud tooling could you drop me an email at
| michal at stelvio.dev ? I'm happy to talk. Applies to other
| interested people too!
___________________________________________________________________
(page generated 2025-03-20 23:01 UTC)