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
Add config support for snapshot auto-load on start
Add a `snapshot` field to `[[containers]]` (AWS only) that auto-loads the
referenced snapshot once the emulator has started. Loading runs only when
the emulator is freshly started this run (skipped when already running),
mirroring v1's AUTO_LOAD_POD.
`lstk start --snapshot REF` overrides the configured REF for one run and
`lstk start --no-snapshot` skips it. `snapshot save` does not write back
into the config — the field is manual.
The auto-loader is resolved at the command boundary and threaded into the
non-interactive start (cmd/root.go) and the TUI via ui.RunOptions.PostStart.
Generated with [Linear](https://linear.app/localstack/issue/DEVX-853/add-config-support-for-snapshot-auto-load#agent-session-555ec215)
Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,6 +103,8 @@ A REF is parsed by helpers in `internal/snapshot/destination.go`:
103
103
104
104
`ParseDestination` (save), `ParseSource` (load), `ParseRemovable` (remove), and `ParseShowable` (show) share pod-name validation; `ParseRemovable` and `ParseShowable` reject local paths (via the shared `parseCloudOnly` helper) so those cloud-only commands never touch local files.
105
105
106
+
**Auto-load on start.** A `[[containers]]` block (AWS only) can set `snapshot = "pod:my-baseline"` (any load REF) to auto-load that snapshot after the emulator starts. The loader runs only when the emulator is freshly started this run (skipped when already running), mirroring v1's `AUTO_LOAD_POD`. `lstk start --snapshot REF` overrides the configured REF for one run; `lstk start --no-snapshot` skips it. Resolution lives in `resolveStartSnapshotRef`/`newSnapshotAutoLoader` in `cmd/snapshot.go`; the loader is threaded into the non-interactive start in `cmd/root.go` and into the TUI via `ui.RunOptions.PostStart`. `snapshot save` never writes back into config — the `snapshot` field is manual.
107
+
106
108
# Code Style
107
109
108
110
- Don't add comments for self-explanatory code. Only comment when the "why" isn't obvious from the code itself.
Host environment variables prefixed with LOCALSTACK_ are forwarded to the emulator.`,
18
+
Host environment variables prefixed with LOCALSTACK_ are forwarded to the emulator.
19
+
20
+
If a snapshot is configured for the AWS emulator (the snapshot field in [[containers]]), it is auto-loaded once the emulator starts. Use --snapshot REF to override it for one run, or --no-snapshot to skip it.`,
0 commit comments