awssim guide

Overview

awssim packages Floci 2.3.0 plus a deterministic CLI and SigV4/IAM authentication overlay into a single native GraalVM executable listening on 127.0.0.1:4566. It provides an offline, container-free local AWS environment for S3, DynamoDB, and SQS that integrates directly with lmaws, the shared lmcloud conformance suite, and the AWS CLI.

Architecture and runtime isolation

Unlike container-based emulators that require a running Docker daemon or JVM installation, awssim compiles the pinned upstream source archive (verified by SHA-256 in upstream.lock.json) into a standalone binary:

Authentication and IAM enforcement (--auth enforce)

While open mode (--auth open) accepts any credentials for fast local prototyping, --auth enforce (or SIM_AUTH=enforce) activates two-stage security verification loaded from --auth-config (or SIM_AUTH_CONFIG):

Connecting lmaws and LMScript templates

lmaws targets awssim whenever its endpoint resolves to http://127.0.0.1:4566 via cloud.set_endpoint("all", "http://127.0.0.1:4566"), LMCLOUD_ENDPOINT, LMAWS_ENDPOINT, or AWS_ENDPOINT_URL. By default, lmaws signs loopback requests with LMAWS_SIM_ACCESS_KEY_ID=test, LMAWS_SIM_SECRET_ACCESS_KEY=test, and LMAWS_SIM_REGION=us-east-1.

In LMScript test harnesses (such as examples/templates.lms), use _json_ blocks to generate both the --auth-config JSON document and structured SQS/S3 payloads with automatic string escaping, and use expand() for queue URLs and policy ARNs.

Standard lmcode_std_v3 REST and CLI interfaces

awssim itself is a server and ships no lmcode catalog. When an LMScript program is executed by an lmaws host that ships the current 226-signature lmcode_std_v3 catalog (the lmaws v0.1.27 release pinned by awssim CI does not), the 10 standard REST and CLI interfaces (RestGet..RestOptions, RestHandler, CliCommand, CliOption) and rest_config, rest_route, rest_serve, rest_stop, rest_cli are available to wrap emulated AWS resources in HTTP services or CLI commands:

p = _lmcode_ cli="lmaws" install="github:lmctl-ai/lmaws@latest";
  @"/queues/:queue/messages"
  fn post_queue(x: RestExchange) -> void implements RestPost {
    let id = cloud.queue_send(x.param("queue"), x.body());
    x.status(201);
    x.json("{\"messageId\":\"" + id + "\"}");
  }

  @"--endpoint"
  fn opt_ep(x: RestExchange) -> void implements CliOption {
    cloud.set_endpoint("all", x.query("endpoint"));
  }

  @"init-sim"
  fn cmd_init(x: RestExchange) -> void implements CliCommand {
    cloud.queue_create("orders-q");
    x.send("ready");
  }

  rest_config("prefix", "/v1");
  let r1 = rest_cli(str_split("--endpoint http://127.0.0.1:4566 init-sim", " "));
  print(r1);
end _lmcode_