Skip to content

Add S3 remote storage for snapshot save, load, and list#344

Open
anisaoshafi wants to merge 5 commits into
mainfrom
devx-926-add-s3-only-support-for-snapshot-remotes
Open

Add S3 remote storage for snapshot save, load, and list#344
anisaoshafi wants to merge 5 commits into
mainfrom
devx-926-add-s3-only-support-for-snapshot-remotes

Conversation

@anisaoshafi

@anisaoshafi anisaoshafi commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

What

Adds support for saving, loading, and listing snapshots in your own AWS S3 bucket. Before this, a snapshot could only go to a local file or a LocalStack platform pod (pod:).

How

Set your AWS credentials, then use an s3:// path:

export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...

lstk snapshot save my-pod s3://my-bucket/prefix    # save to S3
lstk snapshot load my-pod s3://my-bucket/prefix    # load it back
lstk snapshot list s3://my-bucket/prefix           # list what's in the bucket

Or use a named AWS profile instead of env vars:

lstk snapshot save my-pod s3://my-bucket/prefix --profile myprofile
lstk snapshot load my-pod s3://my-bucket/prefix --profile myprofile
lstk snapshot list s3://my-bucket/prefix --profile myprofile
  • The pod name (my-pod) is the snapshot's name in the bucket. Required for load; auto-generated for save if you leave it out.
  • Credentials come from AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY (and optional AWS_SESSION_TOKEN), or from --profile.
  • Credentials can't be put in the URL.

Under the hood

  • lstk doesn't talk to S3 itself. It passes your credentials to the emulator, and the emulator does the upload and download. No AWS SDK was added to lstk.
  • Credentials aren't stored. lstk registers the bucket with a placeholder URL and sends the real values with each command.
  • snapshot list s3://... needs a running emulator, since the emulator is what reads the bucket.
image

Lets users save, load, and list emulator snapshots in their own S3
bucket via an s3:// path, alongside the existing local-file and
platform pod: targets. Credentials come from AWS_* env vars or
--profile; they are never placed in the URL. The emulator performs the
S3 transfer (no AWS SDK in the CLI) and lstk transparently registers a
placeholder-templated remote so secrets stay ephemeral.
@anisaoshafi anisaoshafi changed the title feat: add S3 remote storage for snapshot save, load, and list Add S3 remote storage for snapshot save, load, and list Jun 26, 2026
@anisaoshafi anisaoshafi added semver: patch docs: needed Pull request requires documentation updates labels Jun 26, 2026
s3:// is now a supported load target, so it no longer hits the
"not yet supported" path. Reject S3 in parseCloudOnly so remove/show
(cloud-only, S3 deferred) still error clearly, and add a test that
loading from S3 requires a pod name.
Before save/load/list against an S3 remote, lstk now checks the bucket
exists (unsigned S3 HEAD: 404 => missing) and errors out rather than
letting the emulator silently create it on a typo. Local-testing
endpoints (IP / host.docker.internal) are skipped, and a check that
cannot run degrades to a warning.
@anisaoshafi anisaoshafi marked this pull request as ready for review June 26, 2026 17:29
@anisaoshafi anisaoshafi requested a review from a team as a code owner June 26, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: needed Pull request requires documentation updates semver: patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant