HUB
Sign inSign up
aws-emulator logo

gekal/aws-emulator

By gekal

•Updated about 4 hours ago

Unofficial multi-arch image of AWS Emulator for testing AWS APIs locally. amd64 & arm64.

Image
Integration & delivery
Developer tools
0

2.0K

gekal/aws-emulator repository overview

⁠AWS Emulator (unofficial image)

This is an unofficial image. It is not published, endorsed, or supported by Amazon Web Services. AWS does not distribute a prebuilt container image, so this image is built from the official Dockerfile⁠ and the official Linux package, and published automatically by GitHub Actions.

AWS Emulator⁠ is a local emulator of the AWS APIs. The AWS CLI, AWS SDKs, and coding agents talk to it over a local HTTPS endpoint, using the same AWS APIs they use in the cloud.

  • Multi-arch: linux/amd64 and linux/arm64 (Apple silicon works out of the box)
  • Tagged by emulator version: the tag matches the output of aws-emulator -v
  • Tested before publishing: every build runs a smoke test against STS, S3, and DynamoDB
  • Updated daily: a new tag is published when AWS releases a new emulator version

⁠Quick start

Create the directory that the container shares with your machine, then start the emulator:

mkdir -p ~/.aws/emulator

docker run --rm --memory=2g --memory-swap=2g \
  -p 127.0.0.1:9297:9297 \
  -e HOME="$HOME" -e EMULATOR_TELEMETRY=off \
  -v "$HOME/.aws/emulator:$HOME/.aws/emulator" \
  gekal/aws-emulator:latest -p 9297

On startup, the emulator writes its credentials, config file, and certificate to ~/.aws/emulator/9297/. On Linux, also add --user "$(id -u):$(id -g)" so that the files belong to you.

⁠Point the AWS CLI / SDK at the emulator

In another terminal:

unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_PROFILE
export AWS_ENDPOINT_URL=https://127.0.0.1:9297
export AWS_SHARED_CREDENTIALS_FILE=~/.aws/emulator/9297/emulator_credentials
export AWS_CONFIG_FILE=~/.aws/emulator/9297/config
export AWS_CA_BUNDLE=~/.aws/emulator/9297/ca.pem
export AWS_EC2_METADATA_DISABLED=true
export AWS_DISABLE_HOST_PREFIX_INJECTION=true
export AWS_REGION=us-east-1
export AWS_DEFAULT_REGION=us-east-1

aws sts get-caller-identity          # Account: 000000000000
aws s3 mb s3://local-getting-started

Health check:

curl --cacert ~/.aws/emulator/9297/ca.pem https://127.0.0.1:9297/__admin/health

⁠Docker Compose

services:
  aws-emulator:
    image: gekal/aws-emulator:latest
    environment:
      HOME: ${HOME}
      EMULATOR_TELEMETRY: "off"
    command: ["-p", "9297"]
    ports:
      - "127.0.0.1:9297:9297"
    volumes:
      - ${HOME}/.aws/emulator:${HOME}/.aws/emulator
    mem_limit: 2g
    memswap_limit: 2g

⁠Tags

TagDescription
latestThe latest build
1.0.385, ...A specific AWS Emulator version
1.0, ...The latest build in that minor version

Pin a full version tag (for example 1.0.385) for reproducible builds and CI.

⁠Configuration

ItemDefaultDescription
EMULATOR_PORT9297Port used by the image's health check. Keep it the same as the -p option.
EMULATOR_TELEMETRY(on)Set to off to stop sending anonymous usage data to AWS.
EMULATOR_CONFIG~/.aws/emulator/config.tomlPath to the emulator settings file.
-p <port>9297Port the emulator listens on. Use the same port on both sides of Docker's -p option.

For all emulator options, see the command reference⁠.

⁠Notes

  • Bind to 127.0.0.1 only. -p 9297:9297 opens the emulator to your whole network.
  • Resources are kept in memory. They are lost when the container stops. If the container exceeds the 2 GiB memory limit, it exits with code 137.
  • One port per emulator. To run several emulators, give each a different port in all three places (host, container, and -p). Do not use -p 0 in a container.
  • Not a security test environment. IAM and resource-based policies are not evaluated as in AWS, so a request that AWS denies may succeed in the emulator. There is a single account (000000000000) and no cross-account or cross-Region behavior.
  • Unimplemented operations return HTTP 501. Check the fidelity scores in the AWS Emulator releases⁠.
  • Some SDKs need extra setup to trust the emulator's certificate (ca.pem), for example the Java truststore.

⁠License

This repository's build files are provided as-is. AWS Emulator itself is licensed by AWS (CC0-1.0, with the vendor/ directory under Apache License 2.0); see the AWS Emulator repository⁠ for details.

Tag summary

Content type

Image

Digest

sha256:7e26fcf28…

Size

607.3 MB

Last updated

about 4 hours ago

docker pull gekal/aws-emulator