Docs / awsemu vs AWS CLI

awsemu vs AWS CLI

awsemu is a drop-in replacement for the AWS CLI. Every command, subcommand, and option from aws works identically with awsemu. The only difference is that awsemu automatically targets your local LocalEmu instance.

How It Works

Comparison
# AWS CLI (real AWS)
$ aws s3 ls
$ aws sqs create-queue --queue-name my-queue

# awsemu (LocalEmu) - identical syntax
$ awsemu s3 ls
$ awsemu sqs create-queue --queue-name my-queue

Service-Specific Notes

While awsemu is a drop-in replacement, some services have LocalEmu-specific behaviors worth knowing about.

EC2

EC2 Example
$ awsemu ec2 run-instances \
    --image-id ami-ubuntu-22.04 \
    --instance-type t2.micro \
    --count 1

# PrivateIpAddress is the connectable address
$ awsemu ec2 describe-instances \
    --query 'Reservations[].Instances[].PrivateIpAddress'

RDS

RDS Example
$ awsemu rds create-db-instance \
    --db-instance-identifier mydb \
    --engine postgres \
    --master-username admin \
    --master-user-password secret123

# Connect with psql using the returned endpoint
$ awsemu rds describe-db-instances \
    --query 'DBInstances[0].Endpoint'
Address: localhost
Port: 49267  # Dynamically assigned; check DescribeDBInstances

OpenSearch

OpenSearch Example
$ awsemu opensearch create-domain --domain-name my-domain

# Get the domain endpoint
$ awsemu opensearch describe-domain \
    --domain-name my-domain \
    --query 'DomainStatus.Endpoint'
localhost:43215

Cognito

Cognito Example
$ POOL_ID=$(awsemu cognito-idp create-user-pool \
    --pool-name my-pool \
    --query 'UserPool.Id' --output text)

# Fetch the JWKS for token verification
$ curl http://localhost:4566/$POOL_ID/.well-known/jwks.json

SSM Session Manager

Use the real aws CLI for this one, not awsemu: with AWS_ENDPOINT_URL set, aws ssm start-session opens a genuine interactive shell against LocalEmu -- the wire codec matches the real session-manager-plugin byte-for-byte, no LocalEmu-specific interception.

SSM Session
$ export AWS_ENDPOINT_URL=http://localhost:4566
$ aws ssm start-session --target i-345e9b5f68e616e47
root@i-345e9b5f68e616e47:/#

localemu ssh is a lighter alternative: a direct docker exec into the instance's container, run from the host, no SSM protocol or key pair involved:

Alternative
$ localemu ssh i-345e9b5f68e616e47
root@i-345e9b5f68e616e47:/#

Quick Reference

aws command awsemu equivalent Notes
aws s3 ls awsemu s3 ls Identical
aws ec2 run-instances awsemu ec2 run-instances Use LocalEmu AMI IDs
aws rds describe-db-instances awsemu rds describe-db-instances Endpoint is localhost
aws ssm start-session aws ssm start-session Real SSM protocol -- use plain aws with AWS_ENDPOINT_URL set
aws <anything> awsemu <anything> Drop-in replacement