You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Drop legacy-CLI comparisons ("no per-tool wrapper", "mirroring v1's
AUTO_LOAD_POD") — how it works now, not the old xxx-local mapping.
- Defer the Extensions section (and its intro mention) until there is a
meaningful extension to document.
- Remove the duplicated intro note.
- Soften snapshot emulator-support framing: no top-level "AWS emulator
only" on the config field; note some snapshot features are fully
supported only on AWS for now and point to per-emulator docs.
- Reword "status resources" to "the resources listing in status".
- Volume mounts: fix the init-hook example to mount a script file (not a
directory), make it emulator-neutral, drop the untested read-only
mount, add an explanation, and link the per-emulator Initialization
Hooks guides.
- Azure interception: drop "second"/secondary framing and the line
steering users away from interception (it is the recommended mode).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QRmA1n8vtvoT3DnGQzRk87
Copy file name to clipboardExpand all lines: src/content/docs/aws/developer-tools/running-localstack/lstk.mdx
+14-38Lines changed: 14 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,13 +16,9 @@ It provides a built-in terminal UI (TUI) for interactive use and plain text outp
16
16
17
17
`lstk` handles the full emulator lifecycle: authentication, pulling the Docker image, starting, stopping, and restarting the container, streaming logs, and checking status.
18
18
It can also save and load emulator state — as local snapshots, Cloud Pods, or in your own S3 bucket — reset running state, and manage the on-disk volume.
19
-
It proxies your existing tooling — the AWS and Azure CLIs, Terraform, AWS CDK, and the AWS SAM CLI — so they run against LocalStack with no per-tool wrapper, and it runs Git-style `lstk-<name>` extensions.
19
+
It proxies your existing tooling — the AWS and Azure CLIs, Terraform, AWS CDK, and the AWS SAM CLI — so they run directly against LocalStack.
20
20
Running `lstk` with no arguments takes you through the entire startup flow automatically.
-[Docker](https://docs.docker.com/get-docker/) installed and running.
@@ -193,7 +189,7 @@ port = "4566" # Host port the emulator will be accessible on
193
189
|`image`| string | (unset) | Override the default Docker image, e.g. an internal-registry mirror or a locally loaded offline image. If it already carries a tag, `tag` is dropped; otherwise `tag` (or `latest`) is appended. When unset, the default `localstack/<product>` image is used. |
194
190
|`volume`| string | (OS cache) | Host directory for persistent emulator state (mounted at `/var/lib/localstack`). Defaults to `<os-cache>/lstk/volume/<container-name>`. Used verbatim (no path resolution). |
195
191
|`volumes`| string[]|`[]`| Docker-style `"host:container[:ro]"` bind mounts (e.g. Snowflake init hooks). May also carry the persistence mount (the entry targeting `/var/lib/localstack`); relative host sources are resolved against the config file's directory and a leading `~/` is expanded. See [Volume mounts](#volume-mounts). |
196
-
|`snapshot`| string | (unset) | Snapshot `REF` (a `pod:<name>`, local path, or `s3://` location) auto-loaded after the emulator starts. **AWS emulator only.** See [Auto-loading a snapshot on start](#auto-loading-a-snapshot-on-start). |
192
+
|`snapshot`| string | (unset) | Snapshot `REF` (a `pod:<name>`, local path, or `s3://` location) auto-loaded after the AWS emulator starts. See [Auto-loading a snapshot on start](#auto-loading-a-snapshot-on-start). |
197
193
|`env`| string[]|`[]`| List of named environment profiles to inject into the container (see below). |
198
194
199
195
:::note
@@ -219,8 +215,8 @@ In non-interactive mode the default `aws` emulator is used.
219
215
220
216
Lifecycle commands operate on the emulators defined in your `config.toml`.
221
217
Run a single `[[containers]]` block at a time.
222
-
The AWS-specific commands — `status` resources, `reset`, the `aws` CLI proxy, the IaC proxies (`terraform`, `cdk`, `sam`), and `setup aws` — require an `aws` emulator; `az` and `setup azure` require an `azure` emulator.
223
-
`snapshot` (`save`/`load`/`list`/`remove`/`show`) works with any emulator, but prints an experimental-support warning for the Snowflake and Azure emulators.
218
+
The AWS-specific commands — the resources listing in `status`, `reset`, the `aws` CLI proxy, the IaC proxies (`terraform`, `cdk`, `sam`), and `setup aws` — require an `aws` emulator; `az` and `setup azure` require an `azure` emulator.
219
+
`snapshot` (`save`/`load`/`list`/`remove`/`show`) works with any emulator, though some snapshot features are fully supported only on the AWS emulator for now — see the snapshot docs for your emulator for details.
224
220
225
221
:::note
226
222
The AWS emulator's license is validated by `lstk` before the container starts.
@@ -262,19 +258,22 @@ See [Container-injected variables](#container-injected-variables) for the full l
262
258
### Volume mounts
263
259
264
260
Each `[[containers]]` block accepts a `volumes` list of Docker-style `"host:container[:ro]"` bind specs, in addition to the singular `volume` field.
265
-
This is useful for mounting init hooks (for example, Snowflake boot/start/ready/shutdown scripts under `/etc/localstack/init`) or any other host directory into the emulator.
261
+
This is useful for mounting initialization hooks (scripts run at the container lifecycle stages under `/etc/localstack/init/{boot,start,ready,shutdown}.d`) or any other host path into the emulator.
262
+
263
+
The example below uses `volumes` to map multiple mounts — a `ready`-stage init-hook script and the persistence directory:
Init-hook script naming and behavior differ per emulator; see the Initialization Hooks guide for your emulator ([AWS](/aws/configuration/config/initialization-hooks/), [Snowflake](/snowflake/capabilities/init-hooks/)) for the full details.
276
+
278
277
Resolution rules:
279
278
280
279
- Relative host sources (`./data`) are resolved against the **directory of the config file** that declared them, and a leading `~/` is expanded. This is required because the Docker SDK treats a non-absolute source as a *named volume* rather than a bind mount.
@@ -364,7 +363,7 @@ port = "4566"
364
363
snapshot = "pod:my-baseline"
365
364
```
366
365
367
-
The snapshot is loaded only when the emulator is **freshly started** this run (it is skipped when the emulator is already running), mirroring v1's `AUTO_LOAD_POD`.
366
+
The snapshot is loaded only when the emulator is **freshly started** this run (it is skipped when the emulator is already running).
368
367
Override the configured `REF` for a single run with `lstk start --snapshot <ref>`, or skip auto-loading entirely with `lstk start --no-snapshot`.
369
368
An invalid `REF` fails before the emulator starts.
370
369
`snapshot save` never writes this field back — it is set manually.
@@ -540,7 +539,7 @@ Everything after `lstk az` is forwarded verbatim to the host `az` binary; its ex
An opt-in second mode mutates your **global**`~/.azure` configuration so plain `az` (in any terminal or script) targets LocalStack, then switches it back.
542
+
An opt-in interception mode mutates your **global**`~/.azure` configuration so plain `az` (in any terminal or script) targets LocalStack, then switches it back.
544
543
545
544
```bash
546
545
lstk az start-interception # global 'az' now targets LocalStack
@@ -550,8 +549,6 @@ lstk az stop-interception # switch back to real Azure
550
549
-`start-interception` registers and activates the `LocalStack` cloud in `~/.azure` and disables instance discovery, so existing `az` scripts run unmodified against LocalStack. It is independent of `lstk setup azure`.
551
550
-`stop-interception` switches the active cloud back to `AzureCloud` (override with `--cloud <name>`) and re-enables instance discovery — but only if `LocalStack` is still the active cloud, to avoid clobbering an unrelated selection.
552
551
553
-
Because interception changes global state affecting every `az` invocation, prefer the isolated `lstk az <args>` mode unless a script must invoke plain `az`.
554
-
555
552
### `terraform`
556
553
557
554
Proxy Terraform commands to LocalStack, injecting LocalStack endpoints as AWS provider overrides so your existing configuration runs unchanged. Aliased as `lstk tf`.
@@ -1285,27 +1282,6 @@ lstk completion fish > ~/.config/fish/completions/lstk.fish
1285
1282
1286
1283
Restart your shell after persisting completions.
1287
1284
1288
-
## Extensions
1289
-
1290
-
`lstk` supports Git-style extensions.
1291
-
When `lstk <name>` is not a built-in command or alias, `lstk` resolves and runs an external `lstk-<name>` executable, forwarding all arguments after `<name>` verbatim, passing `stdin`/`stdout`/`stderr` through, and propagating the child's exit code.
1292
-
1293
-
```bash
1294
-
# Runs the lstk-hello executable, forwarding "world"
1295
-
lstk hello world
1296
-
```
1297
-
1298
-
Built-in commands always take precedence — extension dispatch happens only for an otherwise-unknown command.
1299
-
Resolution order is built-ins → the directory containing the `lstk` executable (so extensions bundled alongside `lstk` are found through npm/Homebrew shims) → your `PATH`.
1300
-
There is no manifest: any resolvable `lstk-<name>` is the `<name>` extension.
1301
-
1302
-
`lstk` conveys runtime context to the extension through two environment variables:
|`LSTK_EXT_API_VERSION`| A flat integer the extension can check before parsing the context. |
1307
-
|`LSTK_EXT_CONTEXT`| A JSON object with `configDir`, an optional `authToken`, `nonInteractive`, and an `emulators` array of `{type, endpoint, port}` (empty when none are running). |
0 commit comments