跳到正文
DEV Community· Sudarshan Reddy·· 12 天前AI 評分56

AWS Emulator 入門指南:如何在本機測試雲端服務

A Beginner’s Guide to the New AWS Emulator: Cloud Testing on Your Laptop

AI 導讀

AWS Emulator 可在本機模擬 AWS 服務,讓用戶無需連接實際雲端便可測試應用程式。文章示範把 AWS CLI 指向本機端點,再建立 Amazon S3 bucket、上載檔案及列出內容。工具免費且毋須 AWS 帳戶;模擬資料存於電腦記憶體,停止後便會消失。

正文

Skip to content

Image 1: DEV Community

Powered by Algolia

Log inCreate account

DEV Community

Image 20 Add reaction

Image 30 Like Image 40 Unicorn Image 50 Exploding Head Image 60 Raised Hands Image 70 Fire

0 Jump to Comments 0 Save Boost

Pick as gem

Copy link

Copied to Clipboard

Share to XShare to LinkedInShare to FacebookShare to Mastodon

Share Post via...Report Abuse

Image 8: Sudarshan Reddy

Sudarshan Reddy Posted on Nov 12•Originally published at narusudarshan.github.io

A Beginner’s Guide to the New AWS Emulator: Cloud Testing on Your Laptop

#docker#aws#beginners#tutorial

Have you ever tried building an app on AWS, only to get frustrated by how long it takes to deploy your code just to test a small change? Not to mention the worry of accidentally racking up an unexpected cloud bill!

AWS has just released something that changes the game: the AWS Emulator. It is a brand-new, completely free tool that lets you run and test your AWS applications directly on your own computer. The coolest part? Every single line of code for this emulator was written by autonomous AI agents.

Here is everything you need to know about what it is, why it’s awesome, and a hands-on guide on how you can start using it today.

What is AWS Emulator?

Think of AWS Emulator as a "mini-AWS" that lives entirely on your laptop. When you write code that needs to talk to AWS services (like saving a file to an S3 bucket or reading a database in DynamoDB), you usually have to send that request over the internet to the actual AWS cloud.

With the emulator, your code talks to your local machine instead. It mimics how real AWS behaves, returning the exact same successful results and error messages you would get in the cloud.

Why Should You Care?

  • It’s 100% Free: You don't even need an AWS account to use it. You only pay for AWS when you eventually deploy your finished app to the real cloud.
  • Lightning Fast: Because everything is happening locally on your machine, you don't have to wait for cloud deployments. You can test, fix, and iterate in milliseconds.
  • Perfect for AI Coding Agents: If you use AI assistants to help you write code, you can point them at the emulator. They can safely create resources and test their own code in a sandbox without ever touching your real AWS account.
  • Works Offline: Since it runs locally, you can keep building and testing your app even if you are without Wi-Fi.

How Does It Work?

It works by using a clever trick. When you run AWS tools (like the Command Line Interface or SDKs), they are programmed to send requests to AWS servers. The emulator starts up a local HTTPS endpoint on your computer. All you have to do is change a single setting (an environment variable) to point your tools to that local endpoint instead of the internet. Your code doesn't know the difference—it thinks it's talking to the real AWS!


Hands-On Guide: Building Locally

If you want to test AWS services without spending a dime or connecting to the internet, let's get our hands dirty. In this tutorial, we will install the emulator, configure our tools, and run a simple test: creating a local Amazon S3 bucket, uploading a file, and listing its contents.

Step 1: Installing the AWS Emulator

The emulator runs as a lightweight local server on your machine. How you install it depends on your operating system.

🐧 For Linux (Ubuntu/Debian)
Linux runs the emulator natively without needing any container software. You can download and install the package with two simple commands:

curl -fsSLo aws-emulator.deb https://downloads.aws.com/aws-emulator/packages/aws-emulator/LTS/latest/aws-emulator_amd64.deb
sudo apt-get install -y ./aws-emulator.deb

(Note: If you are using a Red Hat/CentOS based system, AWS provides an .rpm package you can install using dnf.)

To start it, just type:

aws-emulator

🍎 For macOS & 🪟 Windows
Because the emulator is natively built for Linux, macOS and Windows users will run it using Docker.

To get set up, you will build a simple Docker image. For the exact setup steps and configuration commands, check out the Official AWS Emulator Docker Guide.

Once you start the container following the link above, the emulator will quickly generate its own local credentials and configuration file securely on your machine.

Step 2: Point Your AWS CLI to the Emulator

By default, when you type a command like aws s3 ls, the AWS CLI tries to connect to the real cloud over the internet. We need to tell it to look at our local emulator instead.

Open a new terminal window (leave the emulator running in the first one) and set your environment variables to point to the local server:

On Linux/macOS:

export AWS_CONFIG_FILE=~/.aws/emulator/9297/config
export AWS_SHARED_CREDENTIALS_FILE=~/.aws/emulator/9297/emulator_credentials

On Windows (PowerShell):

$env:AWS_CONFIG_FILE="$env:USERPROFILE\.aws\emulator\9297\config"
$env:AWS_SHARED_CREDENTIALS_FILE="$env:USERPROFILE\.aws\emulator\9297\emulator_credentials"

Your system is now officially sandboxed! Your CLI doesn't know the difference, but it is now talking directly to your laptop.

Step 3: The S3 Bucket Example

Let's test it out by acting like we are using Amazon S3.

1. Create a Bucket
We will create a bucket called my-local-test-bucket. Type this into your terminal:

aws s3api create-bucket --bucket my-local-test-bucket

The emulator will instantly return a success message, exactly like the real AWS would.

2. Create and Upload a File
Let's create a quick text file on your computer and upload it to our new local bucket.

echo "Hello from the emulator!" > hello.txt
aws s3 cp hello.txt s3://my-local-test-bucket/

You should see a message saying upload: ./hello.txt to s3://my-local-test-bucket/hello.txt.

3. List the Objects in Your Bucket
Finally, let's ask our local S3 bucket what it has inside it:

aws s3 ls s3://my-local-test-bucket/

It will print out the details of hello.txt.

4. Cleaning Up
When you are done, simply go back to the terminal where the emulator is running and press Ctrl+C. Because the emulator stores everything in your computer's memory, the moment you shut it down, your my-local-test-bucket and its contents vanish cleanly. No lingering files, and definitely no surprise billing charges!

Ready to Deep Dive?

This simple S3 test just scratches the surface. You can use the AWS Emulator to test complex architectures, wire up DynamoDB tables, use SQS queues, and safely run AI coding agents.

If you want to master local cloud testing, here are the best resources to explore next:

  • Official AWS Emulator User Guide: The ultimate source of truth for full setup instructions, supported features, and advanced Docker configurations.
  • AWS Emulator on GitHub: Explore the open-source code, report bugs, or read up on how to run the emulator in "Embedded Mode" for Rust testing.
  • AWS Release Blog: Read the fascinating story behind how autonomous AI agents actually wrote the code for this emulator.

💜 DEV is hiring


Image 9: We're hiring a DEV Community Manager

Want to make DEV your full-time job?

We're hiring a full-time Community Manager to look after DEV every day: reading, posting, moderating, and helping members get fast, thoughtful answers.

See the role

Read More

Top comments (0)

Subscribe

Image 10: pic

Submit PreviewDismiss

Code of Conduct•Report abuse

Image 11: Google Cloud Google CloudPromoted

Image 12: Build Agents and Models on One Platform

Build Agents and Models on One Platform

Rapidly deploy, scale, govern and optimize production-ready agents grounded in your organization’s data. Choose to build with Google’s latest multimodal models like Gemini 4 Argon, third-party models like Anthropic's Claude Model Family, and open models like Gemma in Model Garden.

Learn More →

Image 13 Sudarshan Reddy

Follow

  • Joined Jul 22, 2025

Trending on DEV Community

Image 14: xulingfeng profile image We Keep Hearing About AI Productivity. The QA Group Chat Told a Different Story. #ai#discuss#career#programmingImage 15: woochan profile image Not a promo: we tried many ways of marketing our memory API, but almost no one came #discuss#ai#startup#helpImage 16: Heinrich Neb profile image I ranked my AI's memories by age. Every benchmark floor broke. #ai#llm#agents#discuss

Image 17: Google Cloud Google CloudPromoted

Image 18: Go from Code to Production URL in Seconds

Go from Code to Production URL in Seconds

Run your code directly on top of Google’s scalable infrastructure. Cloud Run is simple, automated, and designed to make hosting and deploying easier. Run frontend and backend services, batch jobs, host LLMs, and queue processing workloads without the need to manage infrastructure.

Learn More →

DEV Community Live Events


Stream starts in…

--:--:--

Video 1

AWS GameDay

Help our hosts solve challenges in this interactive, gamified live show.

Tune in to the full event

DEV Community is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️

DEV Community Live Events


AWS GameDay

Live

Starts in…

--:--:--

Help our hosts solve challenges in this interactive, gamified live show.

Tune in to Stream

DEV Community — A space to discuss and keep up software development and manage your software career

Built on Forem — the open source software that powers DEV and other inclusive communities.

Made with love and Ruby on Rails. DEV Community © 2016 - 2026.

Image 19: DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log inCreate account

Image 20Image 21Image 22Image 23Image 24

來源:DEV Community · dev.to