Skip to content
Get Started for Free

Saving snapshots to S3

By default, Cloud Pod artifacts are stored on the LocalStack platform. However, if your organization’s data regulations or sovereignty requirements prohibit storing snapshots in LocalStack’s managed storage, saving directly to your own Amazon S3 bucket is the recommended solution for keeping full control over where that data lives.

When saving, loading, or listing snapshots in your own S3 bucket, lstk uses pre-signed S3 URLs to transfer the data directly between the emulator and your bucket, without proxying it through LocalStack’s platform.

The lstk snapshot command lets you save, load, and list snapshots stored in your own S3 bucket by passing an s3://bucket/prefix location alongside a snapshot name.

The initial step is to export the necessary AWS credentials in your terminal session.

Terminal window
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...

To obtain credentials automatically, use AWS SSO CLI. Alternatively, set AWS_PROFILE or pass --profile <name> to have lstk read credentials from a named AWS profile instead of the environment.

To save a snapshot to your S3 bucket, provide a snapshot name followed by the s3:// location:

Terminal window
lstk snapshot save my-snapshot s3://ls-s3-bucket-example
Output
✔︎ Snapshot saved to s3://ls-s3-bucket-example as "my-snapshot"
Version: 1
Size: 74.6 KB

Once the snapshot has been saved, you can confirm the presence of the snapshot artifacts in the S3 bucket by running:

Terminal window
aws s3 ls s3://ls-s3-bucket-example
Output
2026-08-05 10:08:55 76390 localstack-pod-my-snapshot-state-1.zip

You can then use lstk snapshot load to load the previously saved snapshot:

Terminal window
lstk snapshot load my-snapshot s3://ls-s3-bucket-example
Output
✔︎ Snapshot loaded from s3://ls-s3-bucket-example (my-snapshot)

Similarly, you can list the snapshots stored in this bucket with lstk snapshot list:

Terminal window
lstk snapshot list s3://ls-s3-bucket-example
Output
~ 1 snapshot
NAME VERSION
my-snapshot 1

Comprehensive instructions on using the lstk snapshot CLI command, including credential resolution order, are found in the lstk CLI Guide.

Was this page helpful?