Skip to content

Commit 9caeb99

Browse files
WIP: rewrite Cloud Pods docs to use lstk snapshot commands
Work in progress towards rewriting cloud-pods.mdx around the lstk CLI's snapshot commands instead of the legacy localstack pod CLI, plus a new workflow diagram and a remotes miscellaneous note. Not yet complete (contains a TBD placeholder). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 445e493 commit 9caeb99

3 files changed

Lines changed: 57 additions & 136 deletions

File tree

5.26 MB
Loading

src/content/docs/aws/developer-tools/snapshots/cloud-pods.mdx

Lines changed: 48 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -10,89 +10,64 @@ sidebar:
1010
import { Tabs, TabItem, FileTree } from '@astrojs/starlight/components';
1111
import { Badge } from '@astrojs/starlight/components';
1212

13-
Cloud pods are persistent state snapshots of your LocalStack instance that can easily be stored, versioned, shared, and restored.
14-
Cloud Pods can be used for various purposes, such as:
13+
In [the previous section](/aws/developer-tools/snapshots/save-snapshots-locally/) you learned how to save a snapshot of the emulator's state to a local file,
14+
then to re-load the snapshot into a different emulator instance. However, when working in a team environment, it's important to have a standard mechanism for sharing
15+
snapshot files across your team, and for managing updates as new versions are published.
1516

16-
- Save and manage snapshots of active LocalStack instances.
17-
- Share state snapshots with your team to debug collectively.
18-
- Automate your testing pipelines by pre-seeding CI environments.
19-
- Create reproducible development and testing environments locally.
17+
<div style="padding: 1em 0;">
18+
<img src="/images/aws/pods-workflow.png" alt="Cloud Pods workflows" width="90%" style="margin: 0 auto;" />
19+
</div>
2020

21-
![Cloud Pods Web UI](/images/aws/pods-ui.png)
21+
LocalStack provides the web-based _Cloud Pods_ repository for exactly this purpose, accessible only to the users in your organization. Snapshots can be
22+
generated by an emulator instance, then automatically published to your Cloud Pods repository. From there, snapshots can be loaded
23+
back into an emulator instance, either on a desktop environment or a CI environment.
2224

23-
## Installation
25+
<div style="padding: 1em 0;">
26+
<img src="/images/aws/pods-ui.png" alt="Cloud Pods Web UI" width="90%" style="margin: 0 auto;" />
27+
</div>
2428

25-
You can save and load the persistent state of Cloud Pods, you can use the [`lstk snapshot` command](/aws/developer-tools/running-localstack/lstk/#snapshot).
26-
LocalStack provides a remote storage backend that can be used to store the state of your running application and share it with your team members.
27-
You can interact with the Cloud Pods over the storage backend via the LocalStack Web Application.
29+
Each organization has their own private Cloud Pods repository, securely managed in LocalStack's cloud. Each user or organization is allocated a dedicated and
30+
isolated Amazon S3 bucket. The LocalStack CLI utilizes secure S3 presigned URLs to directly interface with the S3 bucket, bypassing the need to
31+
transmit the snapshot files through LocalStack Platform APIs.
2832

29-
Cloud Pods CLI is included in the [LocalStack CLI installation](/aws/getting-started/installation/#install-localstack-cli), so there's no need for additional installations to begin using it.
30-
If you're a licensed user, we suggest setting the `LOCALSTACK_AUTH_TOKEN` as an environment variable.
31-
This enables you to access the complete range of LocalStack Cloud Pods features.
33+
## Using the `lstk` CLI
3234

33-
You can access the Cloud Pods CLI by running the `pod` command from your terminal.
35+
You can save and load the snapshots to/from your Cloud Pods repository using the [`lstk snapshot`](/aws/developer-tools/running-localstack/lstk/#snapshot) command.
3436

3537
```bash
36-
localstack pod --help
38+
lstk snapshot --help
3739
```
40+
3841
```bash
39-
Usage: localstack pod [OPTIONS] COMMAND [ARGS]...
40-
Manage the state of your instance via Cloud Pods.
42+
Manage emulator snapshots
4143

42-
Options:
43-
-h, --help Show this message and exit.
44+
Usage: lstk snapshot [flags]
4445

4546
Commands:
46-
delete Delete a Cloud Pod
47-
inspect
48-
list List all available Cloud Pods
49-
load
50-
remote Manage cloud pod remotes
51-
save Create a new Cloud Pod
52-
versions
47+
list List Cloud Pod snapshots available on the LocalStack platform
48+
load Load a snapshot into the running emulator
49+
remove Delete a cloud snapshot from the LocalStack platform
50+
save Save a snapshot of the emulator state
51+
show Show metadata for a cloud snapshot
5352
```
5453

55-
:::note
56-
These Cloud Pods are securely stored within an AWS storage backend, where each user or organization is allocated a dedicated and isolated S3 bucket.
57-
The LocalStack Cloud Pods CLI utilizes secure S3 presigned URLs to directly interface with the S3 bucket, bypassing the need to transmit the state files through LocalStack Platform APIs.
58-
:::
59-
60-
## Getting started
61-
62-
This guide is designed for users new to Cloud Pods and assumes basic knowledge of the LocalStack CLI and our [`awslocal`](https://github.com/localstack/awscli-local) wrapper script.
63-
64-
Start your LocalStack container using your preferred method.
65-
We will demonstrate how you can save a snapshot of your active LocalStack instance into your LocalStack account, and pull it to a running instance.
6654

67-
### Create AWS resources
55+
### Saving a snapshot to Cloud Pods
6856

69-
You can use the `awslocal` CLI to create new AWS resources within your active LocalStack instance.
70-
For example, you can create an S3 bucket and add data to it using the `awslocal` CLI:
57+
The command for saving a snapshot to Cloud Pods is similar to saving locally, but instead of a file name, provide the `pod:` prefix followed by a valid Pod name.
7158

7259
```bash
73-
awslocal s3 mb s3://test
74-
echo "hello world" > /tmp/hello-world
75-
awslocal s3 cp /tmp/hello-world s3://test/hello-world
76-
awslocal s3 ls s3://test/
60+
lstk snapshot save pod:sample-application
7761
```
7862

79-
### Save your Cloud Pod state
80-
81-
You can now save your Pod state using the `save` command, specifying the desired Cloud Pod name as the first argument.
82-
This action will save the pod and register it with the LocalStack Web Application:
83-
8463
```bash
85-
localstack pod save s3-test
64+
✔︎ Snapshot saved to pod:sample-application
65+
• Version: 1
66+
• Services: s3, sns, sqs, lambda
67+
• Size: 64.2 KB
8668
```
8769

88-
```bash
89-
Cloud Pod `s3-test` successfully created ✅
90-
Version: 1
91-
Remote: platform
92-
Services: s3
93-
```
94-
95-
Optionally, you can include a message with the saved Cloud Pod using the `--message` flag.
70+
Optionally, you can include a message with the saved snapshot using the `--message` flag.
9671

9772
You can access the list of available Cloud Pods for both you and your organization by utilizing the `list` command:
9873

@@ -124,20 +99,11 @@ Remote: platform
12499
Services: s3,sqs
125100
```
126101

127-
We can now use the command `versions` to list all the created version for a Cloud Pod.
128-
129-
```bash
130-
localstack pod versions s3-test
131-
```
132-
133-
```bash
134-
┏━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━┓
135-
┃ Version ┃ Creation Date ┃ LocalStack Version ┃ Services ┃ Description ┃
136-
┡━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━┩
137-
│ 1 │ 2024-01-04 11:03:00 │ 3.1.1. │ s3 │ │
138-
│ 2 │ 2024-02-28 14:01:45 │ 3.1.1. │ s3,sqs │ │
139-
└─────────┴─────────────────────┴─────────────────────────┴──────────┴─────────────┘
140-
```
102+
:::note
103+
Permission on Cloud Pods are assigned at organization level.
104+
This means that every individual in the organization can view, load, and delete Cloud Pods created by other team members.
105+
Similarly, everyone can save a new version of a Cloud Pod on top of a Pod originally created by someone else.
106+
:::
141107

142108
### Pull your Pod state
143109

@@ -174,39 +140,26 @@ Cloud Pod s3-test:1 successfully loaded
174140

175141
After loading the Cloud Pod's content, you can use the `state inspect` command to observe the state of the running LocalStack instance.
176142

143+
TBD: lstk snapshot show
144+
177145
```bash
178-
localstack state inspect --format json
146+
lstk status
179147
```
180148

181149
```bash
182-
{
183-
"000000000000": {
184-
"S3": {
185-
"global": {
186-
"listBuckets": {
187-
"Buckets": [
188-
{
189-
"Name": "test",
190-
"CreationDate": "2023-10-03T07:19:31.000Z"
191-
}
192-
],
193-
}
194-
}
195-
}
196-
}
197-
}
150+
xxx
198151
```
199152

153+
TBD: lstk snapshot remove
154+
200155
For comprehensive instructions, navigate to our [`lstk` CLI Guide](/aws/developer-tools/running-localstack/lstk/#snapshot).
201-
To access your Cloud Pods through the LocalStack Web Application, navigate to the [Cloud Pods browser](https://app.localstack.cloud/pods).
202156

203157
:::note
204-
Permission on Cloud Pods are assigned at organization level.
205-
This means that every individual in the organization can view, load, and delete Cloud Pods created by other team members.
206-
Similarly, everyone can save a new version of a Cloud Pod on top of a Pod originally created by someone else.
158+
The snapshots stored in a Cloud Pod may not remain compatible if used with a different version of LocalStack.
159+
LocalStack applies [snapshot compatibility rules](/aws/developer-tools/snapshots/service-coverage#snapshot-compatibility) to block loading snapshots known to be incompatible with the running LocalStack version.
207160
:::
208161

209-
## Web Application
162+
## Using the LocalStack Console
210163

211164
The LocalStack Web Application enables you to :
212165

@@ -414,47 +367,6 @@ The process is the following:
414367
- It is not possible to have both encrypted and non-encrypted versions for a Cloud Pod.
415368
Encryption is set at the moment of the creation and it cannot be changed.
416369

417-
### Miscellaneous
418-
419-
Unless explicitly specified, all Cloud Pods commands default to targeting the LocalStack Platform as the storage remote.
420-
It's important to note that the CLI must be authenticated correctly with our Platform.
421-
422-
Custom remote configurations are stored within the [LocalStack volume directory](/aws/customization/advanced/filesystem/#localstack-volume-directory) and are managed by the LocalStack container.
423-
Consequently, when sharing Cloud Pods among your team using a custom remote, each team member must define the identical remote configuration.
424-
Once added, a remote persists even after LocalStack restarts.
425-
426-
## Cloud Pods & Persistence
427-
428-
[Persistence](/aws/developer-tools/snapshots/persistence) ensures that the service state persists across container restarts.
429-
You can enable persistence via a LocalStack config flag `PERSISTENCE=1` to restore your local resources, in case you’re stopping and re-starting the LocalStack instance on the same machine.
430-
431-
In contrast, Cloud Pods provide more detailed control over your state.
432-
Rather than just restoring a state during LocalStack restarts, Cloud Pods enable you to capture snapshots of your local instance using the `save` command and inject these snapshots into a running instance using the `load` command, all without needing to perform a full restart.
433-
434-
### Current Limitations
435-
436-
Cloud Pods (and state management in general), come with a few limitation.
437-
In particular, Cloud Pods states might not be correctly restored if the LocalStack version used to create the pod and the target one differ.
438-
We detect version miss-matches when using the `pod load` and prompt a confirmation message to the user.
439-
440-
```bash
441-
localstack pod load old-pod
442-
```
443-
444-
```bash
445-
This Cloud Pod was created with LocalStack 2.1.0.
446-
but you are running LocalStack 3.2.1.
447-
Cloud Pods might be incompatible across different LocalStack versions.
448-
Loading a Cloud Pod with mismatching version might lead to a corrupted state of the emulator.
449-
Do you want to continue? [y/N]:
450-
```
451-
452-
In addition to this prompt, Cloud Pods are subject to the [snapshot compatibility rules](/aws/developer-tools/snapshots/service-coverage#state-compatibility) shared with snapshot-based persistence.
453-
Pods that were saved before `v2026.03` cannot be loaded into LocalStack `v2026.03` or later, because persistence was rewritten for several services in that release.
454-
Set `DISABLE_COMPATIBILITY_RULES=1` to bypass the checks at your own risk.
455-
456-
We are working to extend Cloud Pods support to all AWS services emulated in LocalStack.
457-
However, state management might not yet work reliably for every service.
458370

459371
## Troubleshooting
460372

src/content/docs/aws/developer-tools/snapshots/other-snapshot-storage-options.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,12 @@ The Auto Load from remote feature does not automatically configure the remote.
162162
This needs to be done with the `localstack pod remote add ...` command.
163163
This commands creates a configuration file for the remote in the [LocalStack volume directory](/aws/customization/advanced/filesystem/#localstack-volume-directory).
164164
:::
165+
166+
### Miscellaneous
167+
168+
Unless explicitly specified, all Cloud Pods commands default to targeting the LocalStack Platform as the storage remote.
169+
It's important to note that the CLI must be authenticated correctly with our Platform.
170+
171+
Custom remote configurations are stored within the [LocalStack volume directory](/aws/customization/advanced/filesystem/#localstack-volume-directory) and are managed by the LocalStack container.
172+
Consequently, when sharing Cloud Pods among your team using a custom remote, each team member must define the identical remote configuration.
173+
Once added, a remote persists even after LocalStack restarts.

0 commit comments

Comments
 (0)