Skip to content

Direct emulator state manipulation #22

@zyang37

Description

@zyang37

Direct emulator state manipulation

Currently, the emulator maintains cloud state internally and the only way to modify that state is through API calls. While this mirrors real-world cloud behavior, it is inefficient for testing scenarios.

For example, a user may want to test a single command that depends on existing infrastructure (e.g., a VPC, subnet, or instance). To reproduce that environment, the user must replay all prior API calls to recreate the necessary state inside the emulator. As discussed in #17, this can be slow because it requires running through the full emulation workflow each time.

Proposed improvement

Introduce a backdoor mechanism that allows direct manipulation of the emulator state.

This would enable users to quickly set up specific infrastructure states without replaying the entire sequence of API calls.

Example use cases

  • Quickly constructing a predefined cloud state for testing a specific API behavior
  • Speeding up test cases that require complex preconditions
  • Creating reproducible test fixtures for CI pipelines

Possible approaches

  • Provide a CLI or SDK command to inject resources directly into emulator state
  • Support loading emulator state from a JSON snapshot
  • Allow exporting and restoring emulator state for fast test setup

This feature would significantly improve testing efficiency while keeping the normal API-driven behavior as the default mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions