斯泰尔维奥:将 Python 部署到 AWS
Stelvio: Ship Python to AWS

原始链接: https://github.com/stelviodev/stelvio

## Stelvio:原生 Python 的 AWS 部署 Stelvio 是一个开源框架,使用**纯 Python** 简化 AWS 应用程序部署。它无需 YAML、复杂的配置或新的 DSL,让开发者专注于代码。 主要特性包括:IAM、网络和权限的**智能默认值**;资源的**自动权限管理**;以及用于即时代码同步的**实时开发模式**。Stelvio 提供**完全控制**,可以访问底层的 Pulumi 资源,同时保持高级、Pythonic 的接口。 在一个 Python 文件中定义基础设施和应用程序逻辑,利用组件来处理常见的 AWS 服务,如 API Gateway、DynamoDB 和 Cron 作业。 快速入门指南可以通过简单的命令(如 `uv init`、`uv add stelvio` 和 `uv run stlv deploy`)在**两分钟内**完成部署。 Stelvio 采用 Apache 2.0 许可,并欢迎社区贡献。

## Stelvio:Python 到 AWS 基础设施 - 摘要 Stelvio (github.com/stelviodev) 是一款旨在简化 Python 应用程序部署到 AWS 的新工具。它专注于减少样板代码,并通过“链接”系统简化常见的任务,例如 IAM 角色创建和环境变量配置。其核心思想是在 Pulumi 之上提供更高级别的抽象,允许开发者用更少的代码定义基础设施。 该项目在 Hacker News 上引发了讨论,用户质疑其相对于 AWS CDK、SST、Terraform 和 Encore.dev 等现有工具的价值。尽管创建者认为 Stelvio 解决了 CDK 部署缓慢和配置复杂等痛点,但许多评论者对依赖第三方工具以及潜在的 AWS 服务覆盖不完整表示担忧。 主要亮点包括用于本地调试的“开发模式”以及自定义底层 Pulumi 资源的能力。然而,鉴于 LLM 生成 CDK 代码的能力以及成熟的基础设施即代码解决方案,人们对其必要性仍然持怀疑态度。开发者正在积极寻求反馈,并强调他们专注于开发者体验。
相关文章

原文

PyPI Python Version License

Ship Python to AWS in minutes, not days.

Documentation - Stelvio Manifesto - Roadmap

Stelvio is an open-source framework that lets you build and deploy modern AWS applications using pure Python. Forget YAML, complex configuration, or learning new DSLs.

With the stlv CLI, you focus on your code, and Stelvio handles the infrastructure.

stlv intro video

  • 🐍 Pure Python: Define your infrastructure with standard Python code. Use your favorite IDE, linter, and type checker.
  • 🧠 Smart Defaults: We handle the complex IAM roles, networking, and configuration so you don't have to.
  • 🔗 Automatic Permissions: Simply pass resources to your functions. Stelvio automatically configures permissions and environment variables.
  • Live Dev Mode: Run stlv dev to sync your code changes instantly. No waiting for deployments.
  • 🔧 Full Control: Logic and infrastructure in one place, with escape hatches to the underlying Pulumi resources.
  • 📖 Open Source: Built by developers for developers. Apache 2.0 licensed.

Define your infrastructure and application logic in one file. Stelvio handles the wiring.

from stelvio.aws.api_gateway import Api
from stelvio.aws.cron import Cron
from stelvio.aws.dynamo_db import DynamoTable


@app.run
def run() -> None:

    todos = DynamoTable(
        "todos-table",
        fields={
            "user": "string",
            "date": "string"
        },
        sort_key="date",
        partition_key="user"
    )

    cleanup = Cron(
        "cleanup-cron",
        "rate(1 minute)",
        handler="api/handlers.cleanup",
        links=[todos]
    )

    api = Api("stlv-demo-api")
    api.route("GET", "/hello", handler="api/handlers.hello_world")
    api.route("POST", "/todos", handler="api/handlers.post_todo", links=[todos])
    api.route("GET", "/todos/{user}", handler="api/handlers.list_todos", links=[todos])

Stelvio provides high-level components for the most common AWS services:

Open in GitHub Codespaces

You can get up and running in less than 2 minutes.

# 1. Create a new project
uv init my-todo-api && cd my-todo-api

# 2. Add Stelvio
uv add stelvio

# 3. Initialize project structure
uv run stlv init

# 4. Deploy to AWS
uv run stlv deploy

See the Quick Start Guide for a full walkthrough.

Stelvio is open source and we welcome contributions!

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

联系我们 contact @ memedata.com