# aws/aws-emulator architecture

> Architecture diagram of the GitHub repository aws/aws-emulator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aws/aws-emulator
- Repository: https://github.com/aws/aws-emulator

## Overview

AWS Emulator is a local AWS API emulator. A user points an SDK or CLI at the server endpoint, or uses the embedded Rust facade; requests are routed to service-specific emulations, which implement AWS operations and maintain service state before returning emulated responses. The README documents the router’s service-mounting role and the per-service operation/state structure. Specialized service engines and workflows are represented where the source index or excerpts identify them; unsampled service internals and their detailed call paths are not inferred.

Main entry points: [`services/service-com-amazonaws-cloudwatchlogs-logs-20140328/src/ops`](https://github.com/aws/aws-emulator/tree/main/services/service-com-amazonaws-cloudwatchlogs-logs-20140328/src/ops) (CloudWatch Logs operations), [`core/router/src/main.rs`](https://github.com/aws/aws-emulator/blob/main/core/router/src/main.rs) (Server router), [`core/embedded/src/lib.rs`](https://github.com/aws/aws-emulator/blob/main/core/embedded/src/lib.rs) (Embedded facade), [`services/service-com-amazonaws-athena-amazonathena/src/ops`](https://github.com/aws/aws-emulator/tree/main/services/service-com-amazonaws-athena-amazonathena/src/ops) (Athena operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime entry points"]
  node_router["Server router<br/>[main.rs]"]
  node_embedded["Embedded facade<br/>[lib.rs]"]
  node_http_client["Embedded HTTP client<br/>[lib.rs]"]
end

subgraph group_service_api["Service APIs"]
  node_common["Shared service helpers<br/>[lib.rs]"]
  node_access_analyzer["Access Analyzer<br/>[service.rs]"]
  node_account["Account APIs<br/>[service.rs]"]
  node_athena_ops["Athena operations"]
  node_logs_ops["CloudWatch Logs operations"]
  node_service_crates["Other service emulations"]
end

subgraph group_service_state["Service state and engines"]
  node_athena_engine[("Athena SQL engine<br/>[query_engine.rs]")]
  node_logs_state[("Logs state<br/>[state.rs]")]
  node_insights_pipeline["Insights query pipeline<br/>[pipeline.rs]"]
  node_codepipeline_state[("Pipeline execution state")]
end

subgraph group_workflows["Workflow services"]
  node_cloudformation["CloudFormation provisioner"]
  node_datapipeline["Data Pipeline definitions"]
  node_datasync["DataSync locations"]
  node_codepipeline_start["Start pipeline execution"]
end

node_sdk_user(("SDK or CLI user"))

node_sdk_user -->|"sends API requests"| node_router
node_router -->|"routes requests"| node_service_crates
node_sdk_user -->|"creates instance"| node_embedded
node_embedded -->|"provides client"| node_http_client
node_http_client -->|"returns for SDK use"| node_sdk_user
node_athena_ops -->|"runs SQL"| node_athena_engine
node_logs_ops -->|"uses log state"| node_logs_state
node_logs_ops -->|"runs Insights queries"| node_insights_pipeline
node_codepipeline_start -->|"creates execution"| node_codepipeline_state

click node_router "https://github.com/aws/aws-emulator/blob/main/core/router/src/main.rs"
click node_embedded "https://github.com/aws/aws-emulator/blob/main/core/embedded/src/lib.rs"
click node_http_client "https://github.com/aws/aws-emulator/blob/main/core/embedded/src/lib.rs"
click node_common "https://github.com/aws/aws-emulator/blob/main/services/common/src/lib.rs"
click node_access_analyzer "https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-accessanalyzer-accessanalyzer/src/service.rs"
click node_account "https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-account-account/src/service.rs"
click node_athena_ops "https://github.com/aws/aws-emulator/tree/main/services/service-com-amazonaws-athena-amazonathena/src/ops"
click node_athena_engine "https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-athena-amazonathena/src/state/query_engine.rs"
click node_logs_ops "https://github.com/aws/aws-emulator/tree/main/services/service-com-amazonaws-cloudwatchlogs-logs-20140328/src/ops"
click node_logs_state "https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-cloudwatchlogs-logs-20140328/src/state.rs"
click node_insights_pipeline "https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-cloudwatchlogs-logs-20140328/src/state/insights/pipeline.rs"
click node_cloudformation "https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-cloudformation-cloudformation/src/state/provisioner/data_and_storage.rs"
click node_datapipeline "https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-datapipeline-datapipeline/src/ops/put_pipeline_definition.rs"
click node_datasync "https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-datasync-fmrsservice/src/ops/create_location_object_storage.rs"
click node_codepipeline_start "https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-codepipeline-codepipeline-20150709/src/ops/start_pipeline_execution.rs"
click node_codepipeline_state "https://github.com/aws/aws-emulator/tree/main/services/service-com-amazonaws-codepipeline-codepipeline-20150709/src/state"
click node_service_crates "https://github.com/aws/aws-emulator/tree/main/services"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_router,node_embedded,node_http_client,node_sdk_user toneBlue
class node_common,node_access_analyzer,node_account,node_athena_ops,node_logs_ops,node_service_crates toneAmber
class node_athena_engine,node_logs_state,node_insights_pipeline,node_codepipeline_state toneMint
class node_cloudformation,node_datapipeline,node_datasync,node_codepipeline_start toneRose
```

## Components

### Runtime entry points

- [Server router](https://github.com/aws/aws-emulator/blob/main/core/router/src/main.rs): `core/router/src/main.rs`
- [Embedded facade](https://github.com/aws/aws-emulator/blob/main/core/embedded/src/lib.rs): `core/embedded/src/lib.rs`
- [Embedded HTTP client](https://github.com/aws/aws-emulator/blob/main/core/embedded/src/lib.rs): `core/embedded/src/lib.rs`

### Service APIs

- [Shared service helpers](https://github.com/aws/aws-emulator/blob/main/services/common/src/lib.rs): `services/common/src/lib.rs`
- [Access Analyzer](https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-accessanalyzer-accessanalyzer/src/service.rs): `services/service-com-amazonaws-accessanalyzer-accessanalyzer/src/service.rs`
- [Account APIs](https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-account-account/src/service.rs): `services/service-com-amazonaws-account-account/src/service.rs`
- [Athena operations](https://github.com/aws/aws-emulator/tree/main/services/service-com-amazonaws-athena-amazonathena/src/ops): `services/service-com-amazonaws-athena-amazonathena/src/ops`
- [CloudWatch Logs operations](https://github.com/aws/aws-emulator/tree/main/services/service-com-amazonaws-cloudwatchlogs-logs-20140328/src/ops): `services/service-com-amazonaws-cloudwatchlogs-logs-20140328/src/ops`
- [Other service emulations](https://github.com/aws/aws-emulator/tree/main/services): `services`

### Service state and engines

- [Athena SQL engine](https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-athena-amazonathena/src/state/query_engine.rs): `services/service-com-amazonaws-athena-amazonathena/src/state/query_engine.rs`
- [Logs state](https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-cloudwatchlogs-logs-20140328/src/state.rs): `services/service-com-amazonaws-cloudwatchlogs-logs-20140328/src/state.rs`
- [Insights query pipeline](https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-cloudwatchlogs-logs-20140328/src/state/insights/pipeline.rs): `services/service-com-amazonaws-cloudwatchlogs-logs-20140328/src/state/insights/pipeline.rs`
- [Pipeline execution state](https://github.com/aws/aws-emulator/tree/main/services/service-com-amazonaws-codepipeline-codepipeline-20150709/src/state): `services/service-com-amazonaws-codepipeline-codepipeline-20150709/src/state`

### Workflow services

- [CloudFormation provisioner](https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-cloudformation-cloudformation/src/state/provisioner/data_and_storage.rs): `services/service-com-amazonaws-cloudformation-cloudformation/src/state/provisioner/data_and_storage.rs`
- [Data Pipeline definitions](https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-datapipeline-datapipeline/src/ops/put_pipeline_definition.rs): `services/service-com-amazonaws-datapipeline-datapipeline/src/ops/put_pipeline_definition.rs`
- [DataSync locations](https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-datasync-fmrsservice/src/ops/create_location_object_storage.rs): `services/service-com-amazonaws-datasync-fmrsservice/src/ops/create_location_object_storage.rs`
- [Start pipeline execution](https://github.com/aws/aws-emulator/blob/main/services/service-com-amazonaws-codepipeline-codepipeline-20150709/src/ops/start_pipeline_execution.rs): `services/service-com-amazonaws-codepipeline-codepipeline-20150709/src/ops/start_pipeline_execution.rs`

### Other components

- **SDK or CLI user**

## Connections

- SDK or CLI user → Server router: sends API requests
- Server router → Other service emulations: routes requests
- SDK or CLI user → Embedded facade: creates instance
- Embedded facade → Embedded HTTP client: provides client
- Embedded HTTP client → SDK or CLI user: returns for SDK use
- Athena operations → Athena SQL engine: runs SQL (evidence: `services/service-com-amazonaws-athena-amazonathena/src/state/query_engine.rs`)
- CloudWatch Logs operations → Logs state: uses log state (evidence: `services/service-com-amazonaws-cloudwatchlogs-logs-20140328/src/state.rs`)
- CloudWatch Logs operations → Insights query pipeline: runs Insights queries (evidence: `services/service-com-amazonaws-cloudwatchlogs-logs-20140328/src/state/insights/pipeline.rs`)
- Start pipeline execution → Pipeline execution state: creates execution (evidence: `services/service-com-amazonaws-codepipeline-codepipeline-20150709/src/ops/start_pipeline_execution.rs`)
