lmaws guide

Overview

lmaws connects LMScript programs to Amazon Web Services through two complementary layers: the shared provider-neutral lmcloud schema implemented in Go on hostkit and AWS SDK for Go v2, and a rich library of self-contained AWS inventory, spend-reporting, IAM policy-building, and sandbox recipes. By default, every program runs offline against deterministic synthetic fixtures without requiring an AWS account or credentials.

Architecture and execution modes

lmaws selects its execution backend deterministically based on endpoint configuration and environment gates:

Live safety gates, ownership, and cost caps

Live mode separates read-only discovery from state-changing sandbox operations:

Spend analysis, IAM policy builder, and service coverage

Beyond the shared lmcloud slices (S3 object storage, SQS queues, DynamoDB tables, IAM permissions, Lambda functions, and user pools), the lmaws recipe catalog covers:

Standard lmcode_std_v3 REST and CLI interfaces

lmaws embeds lmcode-go with the 226-signature lmcode_std_v3 standard library, providing all 10 standard REST and CLI SAM interfaces (RestGet, RestPost, RestPut, RestDelete, RestPatch, RestHead, RestOptions, RestHandler, CliCommand, CliOption) and the 5 lifecycle functions (rest_config, rest_route, rest_serve, rest_stop, rest_cli).

p = _lmcode_ cli="lmaws" install="github:lmctl-ai/lmaws@latest";
  @"/buckets/:bucket/keys"
  fn list_keys(x: RestExchange) -> void implements RestGet {
    let keys = cloud.object_list_all(x.param("bucket"), x.query("prefix"));
    x.send(keys.join(","));
  }

  @"--bucket"
  fn opt_bucket(x: RestExchange) -> void implements CliOption {
    x.set("bucket", x.query("bucket"));
  }

  @"upload"
  fn cmd_upload(x: RestExchange) -> void implements CliCommand {
    let b = x.get("bucket");
    cloud.bucket_create(b);
    cloud.object_put(b, "index.html", x.body());
    x.send("uploaded:" + b);
  }

  rest_config("prefix", "/api");
  let out1 = rest_cli(str_split("--bucket site-bkt upload -- hello", " "));
  let out2 = rest_cli(str_split("/api/buckets/site-bkt/keys", " "));
  print(out1 + " " + out2);
end _lmcode_