Skip to content

Commit eb6d2db

Browse files
committed
Fix snapshot support details
- **AWS page**: `snapshot` content inlined natively (it's no longer shared with anything, so the component was folded back in and deleted) — kept full Cloud Pods/S3/local support, dropped the inaccurate "also works experimentally on Snowflake/Azure" note. - **Azure page**: removed `snapshot`/`reset` entirely, added a short note pointing to `--persist` as the only state-retention option, and fixed the Introduction paragraph, which previously claimed Cloud Pod support. - **Snowflake page**: replaced the shared component with a native `snapshot` section scoped to local files only — no `pod:` refs, no S3 remotes, no `list`/`remove`/`show` (all Cloud-Pod-only) — kept the "experimental" warning since that's specifically about local save/load, and fixed its Introduction paragraph too. - Annotated the global `--snapshot`/`--no-snapshot` flags as AWS-only in `GlobalOptionsAndOutput.mdx` for consistency.
1 parent 87f01e0 commit eb6d2db

5 files changed

Lines changed: 191 additions & 168 deletions

File tree

src/components/lstk/GlobalOptionsAndOutput.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ These options are available for all commands:
88
| `--non-interactive` | Disable the interactive TUI, use plain output |
99
| `--json` | Emit a single machine-readable JSON envelope on stdout instead of human-oriented output. Supported by `stop`, `reset`, and `update`; any other command rejects it. See [Structured output](#structured-output). |
1010
| `--persist` | Persist emulator state across restarts (on `start`/bare `lstk` and `restart`) |
11-
| `--snapshot <REF>` | Snapshot REF to auto-load after start (on `start`/bare `lstk`; overrides config for one run) |
12-
| `--no-snapshot` | Skip auto-loading the configured snapshot (on `start`/bare `lstk`) |
11+
| `--snapshot <REF>` | Snapshot REF to auto-load after start (on `start`/bare `lstk`; overrides config for one run). AWS emulator only. |
12+
| `--no-snapshot` | Skip auto-loading the configured snapshot (on `start`/bare `lstk`). AWS emulator only. |
1313
| `-v`, `--version` | Print the version and exit |
1414
| `-h`, `--help` | Print help and exit |
1515

src/components/lstk/SnapshotCommands.mdx

Lines changed: 0 additions & 158 deletions
This file was deleted.

src/content/docs/aws/developer-tools/running-localstack/lstk.mdx

Lines changed: 157 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import QuickStart from '@/components/lstk/QuickStart.mdx';
1212
import Authentication from '@/components/lstk/Authentication.mdx';
1313
import Configuration from '@/components/lstk/Configuration.mdx';
1414
import LifecycleCommands from '@/components/lstk/LifecycleCommands.mdx';
15-
import SnapshotCommands from '@/components/lstk/SnapshotCommands.mdx';
1615
import CommonCommands from '@/components/lstk/CommonCommands.mdx';
1716
import GlobalOptionsAndOutput from '@/components/lstk/GlobalOptionsAndOutput.mdx';
1817
import EnvironmentAndLogging from '@/components/lstk/EnvironmentAndLogging.mdx';
@@ -151,7 +150,163 @@ Like `lstk aws`, the `terraform`, `cdk`, and `sam` proxies do not start the emul
151150
Each requires the corresponding third-party CLI to be installed and on your `PATH`.
152151
:::
153152

154-
<SnapshotCommands />
153+
### `snapshot`
154+
155+
Manage emulator snapshots.
156+
A snapshot captures the running AWS emulator's state, either as a local file on disk, as a Cloud Pod on the LocalStack platform, or in your own S3 bucket.
157+
The `snapshot` command groups five subcommands — `save`, `load`, `list`, `remove`, and `show`. The first two are also exposed as the top-level aliases `lstk save` and `lstk load`.
158+
159+
:::note
160+
Cloud Pods and S3 remotes are **AWS-only**. Snapshots are not currently supported for the Snowflake or Azure emulators through `lstk`.
161+
`reset` is also **AWS-only** and errors out with `reset is only supported for the AWS emulator` otherwise.
162+
:::
163+
164+
#### `snapshot save`
165+
166+
Save a snapshot of the running emulator's state.
167+
The emulator must already be running; this command does **not** auto-start it.
168+
169+
```bash
170+
# Auto-named snapshot file in the current directory
171+
lstk snapshot save
172+
173+
# Save to a specific local path
174+
lstk snapshot save ./my-snapshot
175+
176+
# Save to a Cloud Pod on the LocalStack platform (requires auth)
177+
lstk snapshot save pod:my-baseline
178+
179+
# Save to your own S3 bucket (pod name is auto-generated if omitted)
180+
lstk snapshot save my-pod s3://my-bucket/prefix
181+
```
182+
183+
The optional `[destination]` argument takes one of these forms:
184+
185+
| Destination | Description |
186+
|:--------------------------------|:------------------------------------------------------------------------------------------------|
187+
| (omitted) | Auto-generates a timestamped snapshot file in the current directory (`./snapshot-<timestamp>-<hex>.snapshot`). |
188+
| local path | Writes a snapshot archive to that path. The `.snapshot` extension is forced. |
189+
| `pod:<name>` | Saves a Cloud Pod to the LocalStack platform. Requires authentication. |
190+
| `<pod-name> s3://bucket/prefix` | Saves to your own S3 bucket. The pod name is a separate positional (auto-generated when omitted). See [S3 remotes](#s3-remotes). |
191+
192+
Pod operations require an auth token (`LOCALSTACK_AUTH_TOKEN` or a prior `lstk login`); local-file snapshots do not.
193+
194+
| Option | Description |
195+
|:--------------------|:----------------------------------------------------------------------------------------------|
196+
| `--profile <name>` | AWS profile to read S3 credentials from (used only for `s3://` destinations). Defaults to `AWS_*` env vars, then `AWS_PROFILE`. |
197+
198+
#### `snapshot load`
199+
200+
Load a snapshot into the emulator, **auto-starting it first** if it is not already running.
201+
202+
```bash
203+
# Load a local snapshot by path or name
204+
lstk snapshot load my-baseline
205+
lstk snapshot load ./checkpoint
206+
207+
# Load from a Cloud Pod (requires auth)
208+
lstk snapshot load pod:my-baseline
209+
210+
# Load from your own S3 bucket (pod name is required)
211+
lstk snapshot load my-pod s3://my-bucket/prefix
212+
213+
# Control how the snapshot merges with running state
214+
lstk snapshot load pod:my-baseline --merge=overwrite
215+
```
216+
217+
The `REF` argument is required and identifies a local path/name or a `pod:<name>` Cloud Pod.
218+
To load from S3, pass the pod name followed by an `s3://bucket/prefix` location (see [S3 remotes](#s3-remotes)).
219+
220+
| Option | Description |
221+
|:---------------------|:--------------------------------------------------------------------------------------------------------|
222+
| `--merge <strategy>` | How the loaded state combines with running state. One of `account-region-merge` (default), `overwrite`, `service-merge`. |
223+
| `--profile <name>` | AWS profile to read S3 credentials from (used only for `s3://` sources). Defaults to `AWS_*` env vars, then `AWS_PROFILE`. |
224+
225+
- `account-region-merge` (default): the snapshot wins on any `(service, account, region)` overlap.
226+
- `overwrite`: running state is reset first, then the snapshot is imported onto a clean state.
227+
- `service-merge`: the snapshot wins per resource; non-overlapping resources are combined.
228+
229+
The aliases behave identically:
230+
231+
```bash
232+
lstk save pod:my-baseline
233+
lstk load ./checkpoint
234+
```
235+
236+
#### `snapshot list`
237+
238+
List the Cloud Pod snapshots available on the LocalStack platform.
239+
By default, only snapshots you created are listed; pass `--all` to include every snapshot in your organization.
240+
This subcommand operates on Cloud Pods, so it requires authentication.
241+
242+
```bash
243+
# Snapshots you created
244+
lstk snapshot list
245+
246+
# Every snapshot in your organization
247+
lstk snapshot list --all
248+
249+
# List snapshots in your own S3 bucket (requires a running emulator)
250+
lstk snapshot list s3://my-bucket/prefix
251+
```
252+
253+
Passing an `s3://bucket/prefix` location lists snapshots stored in your own S3 bucket instead of the platform (see [S3 remotes](#s3-remotes)). Unlike the platform listing, this queries the emulator, so it requires a running emulator.
254+
255+
| Option | Description |
256+
|:-------------------|:-------------------------------------------------------------|
257+
| `--all` | List all snapshots in your organization, not just your own. |
258+
| `--profile <name>` | AWS profile to read S3 credentials from (used only with an `s3://` location). Defaults to `AWS_*` env vars, then `AWS_PROFILE`. |
259+
260+
#### `snapshot remove`
261+
262+
Delete a Cloud Pod snapshot from the LocalStack platform.
263+
Only cloud snapshots (the `pod:` prefix) can be removed; local snapshots are plain files you delete yourself.
264+
This operation cannot be undone.
265+
266+
```bash
267+
lstk snapshot remove pod:my-baseline
268+
269+
# Skip the confirmation prompt (required in non-interactive mode)
270+
lstk snapshot remove pod:my-baseline --force
271+
```
272+
273+
The required `REF` argument must be a `pod:<name>` Cloud Pod reference.
274+
275+
| Option | Description |
276+
|:----------|:------------------------------------------------------------------------|
277+
| `--force` | Skip the confirmation prompt. Required when running non-interactively. |
278+
279+
#### `snapshot show`
280+
281+
Show metadata for a single Cloud Pod snapshot on the LocalStack platform: its name, created date, size, LocalStack version, message, the services it contains, and per-service resource counts (resource counts render only when the platform has them for that snapshot).
282+
This subcommand is cloud-only and requires authentication.
283+
284+
```bash
285+
lstk snapshot show pod:my-baseline
286+
```
287+
288+
The required `REF` argument must be a `pod:<name>` Cloud Pod reference.
289+
290+
#### S3 remotes
291+
292+
`snapshot save`, `load`, and `list` can target a snapshot stored in your **own S3 bucket** by passing an `s3://bucket/prefix` location.
293+
The pod name (the snapshot's identity within the bucket) is a positional separate from the `s3://` location — required for `load`, auto-generated for `save` when omitted, and unused for `list`.
294+
295+
```bash
296+
lstk snapshot save my-pod s3://my-bucket/prefix
297+
lstk snapshot load my-pod s3://my-bucket/prefix
298+
lstk snapshot list s3://my-bucket/prefix
299+
```
300+
301+
Credentials follow AWS CLI precedence: `--profile <name>` wins, otherwise the static `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY` (plus optional `AWS_SESSION_TOKEN`) environment variables, otherwise the profile named by `AWS_PROFILE`.
302+
Only static credentials are supported (no SSO, assume-role, or `credential_process`), and credentials must never be embedded in the URL.
303+
304+
`lstk` runs a pre-flight check that the target bucket exists and errors out rather than letting the emulator auto-create a bucket on a typo.
305+
Because the transfer is performed by the emulator (not the CLI), S3 remotes require a **running emulator**, and `list s3://…` in particular queries the emulator rather than the platform API.
306+
307+
:::note
308+
`remove` and `show` do not support S3; they operate on Cloud Pods only.
309+
:::
155310

156311
### `reset`
157312

src/content/docs/azure/developer-tools/lstk.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import QuickStart from '@/components/lstk/QuickStart.mdx';
1111
import Authentication from '@/components/lstk/Authentication.mdx';
1212
import Configuration from '@/components/lstk/Configuration.mdx';
1313
import LifecycleCommands from '@/components/lstk/LifecycleCommands.mdx';
14-
import SnapshotCommands from '@/components/lstk/SnapshotCommands.mdx';
1514
import CommonCommands from '@/components/lstk/CommonCommands.mdx';
1615
import GlobalOptionsAndOutput from '@/components/lstk/GlobalOptionsAndOutput.mdx';
1716
import EnvironmentAndLogging from '@/components/lstk/EnvironmentAndLogging.mdx';
@@ -25,7 +24,7 @@ import TroubleshootingCommon from '@/components/lstk/TroubleshootingCommon.mdx';
2524
It provides a built-in terminal UI (TUI) for interactive use and plain text output for CI/CD pipelines and scripting.
2625

2726
`lstk` handles the full emulator lifecycle: authentication, pulling the Docker image, starting, stopping, and restarting the container, streaming logs, and checking status.
28-
It can also save and load emulator state (as local snapshots or Cloud Pods) and manage the on-disk volume.
27+
It can also persist emulator state across restarts and manage the on-disk volume.
2928
Running `lstk` with no arguments takes you through the entire startup flow automatically.
3029

3130
`lstk` also proxies the Azure CLI (`lstk az`) so it runs directly against the Azure emulator.
@@ -87,7 +86,9 @@ Like the other CLI proxies, `lstk az` does not start the emulator — start it f
8786
It requires the `az` CLI to be installed and on your `PATH`.
8887
:::
8988

90-
<SnapshotCommands />
89+
:::note
90+
`lstk` does not currently support `snapshot` or `reset` for the Azure emulator — those commands are AWS-only. `lstk start --persist` is the only state-retention option available.
91+
:::
9192

9293
<CommonCommands />
9394

0 commit comments

Comments
 (0)