Add S3 remote storage for snapshot save, load, and list - #344
Conversation
|
Thanks @carole-lavillonniere for adding cf00471, I was just about to add you as reviewer. 😁 |
|
@anisaoshafi I pushed this small clean-up cf00471, hope that looks fine to you! What about reading env var If we compare the aws authentication mechanism with CLI v1, we are regressing because we don't support |
Good point, and quick win. Will address that, thanks 💯 |
We decided to simplify the S3 destination support on purpose, discussed in our past planning sessions with product. For now passing the profiles in either of the ways with |
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.
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.
Follow AWS CLI precedence in resolveS3Credentials: --profile flag wins, then static AWS_* env vars, then the profile named by AWS_PROFILE. Add regression tests covering each precedence rule and the no-credentials error. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cf00471 to
5df370e
Compare
Thanks for sharing the context @anisaoshafi, makes sense! |
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 or AWS_PROFILE, then use an s3:// path:
Or use a named AWS profile instead of env vars:
Under the hood