OpsCanary
awslambdaPractitioner

Testing AWS Applications Locally: Mastering the AWS Emulator

5 min read AWS BlogNov 11, 2026Reviewed for accuracy
Share
Practitioner — Hands-on experience recommended

In the world of cloud development, testing against live services can be slow, costly, and sometimes risky. The AWS Emulator exists to solve these problems by allowing you to run a local version of AWS services right on your machine. This means you can develop and test your applications without incurring cloud costs or worrying about affecting production environments.

To get started, you install the AWS Emulator, which generates its own credentials, config file, and certificate. You point your AWS SDK tools to the local endpoint, typically https://127.0.0.1:9297, and set environment variables to redirect calls from AWS to your local emulator. Key configuration parameters include AWS_SHARED_CREDENTIALS_FILE for the emulator credentials and AWS_CONFIG_FILE for the emulator config. You can even run the emulator in embedded mode, allowing it to be instantiated directly within your test process, which can simplify integration testing.

In production, be aware that the emulator may not implement every AWS operation. If you attempt to use an unimplemented feature, you’ll receive an HTTP 501 (Not Implemented) response, causing your tests to fail. This can be a significant gotcha if you’re relying on specific AWS functionality that the emulator doesn’t support yet. Always check the fidelity of your tests to ensure they align with actual AWS behavior, and remember that while the emulator is a powerful tool, it’s not a complete replacement for testing in the cloud.

Key takeaways

  • →Install the AWS Emulator using the provided RPM or Debian package.
  • →Set environment variables like AWS_ENDPOINT_URL and AWS_SHARED_CREDENTIALS_FILE to redirect SDK calls.
  • →Use fidelity tests to ensure the emulator’s behavior closely matches AWS.
  • →Be cautious of unimplemented features that can lead to test failures.
  • →Consider using embedded mode for simpler integration testing.

Why it matters

Using the AWS Emulator can significantly speed up your development cycle by allowing you to test locally. This reduces costs and minimizes risks associated with testing in a live environment.

Code examples

Bash
PKG=https://downloads.aws.com/aws-emulator/packages/aws-emulator/LTS/latest
sudo dnf install -y $PKG/aws-emulator-x86_64.rpm

aws-emulator -v
Bash
1export AWS_ENDPOINT_URL=https://127.0.0.1:9297
2export AWS_SHARED_CREDENTIALS_FILE=~/.aws/emulator/9297/emulator_credentials
3export AWS_CONFIG_FILE=~/.aws/emulator/9297/config
4export AWS_EC2_METADATA_DISABLED=true
5export AWS_DISABLE_HOST_PREFIX_INJECTION=true
6export AWS_REGION=us-east-1
7export AWS_DEFAULT_REGION=us-east-1
8unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_PROFILE
Bash
1$ aws s3 mb s3://local-getting-started
2make_bucket: local-getting-started
3
4$ echo "hello from the emulator" > hello.txt
5
6$ aws s3 cp hello.txt s3://local-getting-started/
7upload: ./hello.txt to s3://local-getting-started/hello.txt
8
9$ aws s3 ls s3://local-getting-started/

When NOT to use this

If the emulator doesn’t implement an operation yet, it returns HTTP 501 (Not Implemented), so your tests fail right away. Be mindful of this limitation when planning your testing strategy.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →
DigitalOceanSponsor

Simple, affordable cloud — VMs, Kubernetes, and managed databases in minutes. Trusted by 600,000+ developers. Spin up a Droplet in 60 seconds.

Try DigitalOcean →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.