Stop Paying AWS Just to Test Your Code Locally

Stop Paying AWS Just to Test Your Code Locally

别再为了本地测试代码而向 AWS 付费了

Every developer building on AWS eventually runs into the same frustrations: waiting for deployments just to verify a small change, needing an internet connection for local development, watching cloud costs grow during testing, and discovering issues in CI that could have been caught earlier. 每一位在 AWS 上进行开发的工程师最终都会遇到同样的困扰:为了验证一个小改动而苦苦等待部署、本地开发必须依赖网络连接、眼睁睁看着测试期间云成本不断攀升,以及在 CI 阶段才发现本可以在早期就解决的问题。

That’s exactly why we built LocalEmu. LocalEmu is an open-source AWS emulator that lets you build and test against AWS APIs entirely on your own machine. It supports 132 AWS services and works with the tools you already use every day—AWS CLI, boto3, Terraform, AWS CDK, and Pulumi. Instead of changing your workflow, you simply point your tools to localhost:4566 and continue developing. 这正是我们开发 LocalEmu 的原因。LocalEmu 是一款开源的 AWS 模拟器,让你能够完全在本地机器上针对 AWS API 进行构建和测试。它支持 132 种 AWS 服务,并兼容你每天都在使用的工具,如 AWS CLI、boto3、Terraform、AWS CDK 和 Pulumi。你无需改变现有的工作流,只需将工具指向 localhost:4566 即可继续开发。

Unlike many local emulators that only mock API responses, LocalEmu focuses on realistic behavior where it matters most. Lambda functions execute using the official AWS runtime images. EC2 instances run as real containers connected through a virtual network with enforced security groups. RDS uses real PostgreSQL and MySQL engines, and optional IAM policy enforcement allows you to validate authorization rules before deploying to AWS. 与许多仅模拟 API 响应的本地模拟器不同,LocalEmu 专注于在关键环节实现真实的运行行为。Lambda 函数使用官方 AWS 运行时镜像执行;EC2 实例作为真实的容器运行,并通过带有强制安全组的虚拟网络进行连接;RDS 使用真实的 PostgreSQL 和 MySQL 引擎;此外,可选的 IAM 策略强制执行功能,让你在部署到 AWS 之前就能验证授权规则。

Getting started takes only a couple of commands: 入门只需几条命令:

pip install localemu [runtime]
localemu start

Once running, you can use the included awsemu CLI or simply point your existing AWS CLI, boto3, Terraform, CDK, or Pulumi configuration to localemu. No new SDKs or complex setup are required. 一旦启动,你就可以使用内置的 awsemu CLI,或者直接将现有的 AWS CLI、boto3、Terraform、CDK 或 Pulumi 配置指向 localemu。无需安装新的 SDK,也无需复杂的设置。

LocalEmu also includes a built-in dashboard that launches automatically. It provides a live overview of running services, resource exploration, an S3 object browser, a DynamoDB viewer, CloudTrail event history, and a real-time activity feed so you can inspect what’s happening inside your local cloud environment. LocalEmu 还包含一个自动启动的内置仪表板。它提供了运行中服务的实时概览、资源探索、S3 对象浏览器、DynamoDB 查看器、CloudTrail 事件历史记录以及实时活动馈送,让你能够随时检查本地云环境内部的运行情况。

The biggest advantage is speed. You can iterate in seconds instead of minutes, experiment freely, reset your environment whenever you want, and develop without an AWS account, credentials, or cloud costs for local testing. 它最大的优势在于速度。你可以将迭代时间从分钟级缩短至秒级,自由地进行实验,随时重置环境,并且在进行本地测试时无需 AWS 账户、凭证,也不会产生任何云成本。

We’re actively improving LocalEmu and would love feedback from the developer community. If you’re building on AWS, give it a try, open an issue, suggest improvements, or contribute. And if you find the project useful, we’d really appreciate a ⭐ on GitHub—it helps more developers discover the project and supports ongoing development. 我们正在积极改进 LocalEmu,并期待收到开发者社区的反馈。如果你正在 AWS 上进行开发,欢迎试用、提交 Issue、提出改进建议或直接参与贡献。如果你觉得这个项目有用,我们非常感谢你在 GitHub 上点亮一颗 ⭐——这能帮助更多开发者发现该项目,并支持我们的持续开发。

GitHub Repository: https://github.com/localemu/localemu