@localstack/lstk_darwin_amd64 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +440 -0
- package/lstk +0 -0
- package/package.json +5 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
# lstk
|
|
2
|
+
|
|
3
|
+
**A command-line interface for LocalStack**. Built in Go with a modern terminal UI and native CLI experience for managing and interacting with LocalStack deployments. 👾
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npm install -g @localstack/lstk
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
See [installation](#installation) below.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
- [Docker](https://docs.docker.com/get-docker/) — required as a container engine.
|
|
15
|
+
- [LocalStack account](https://app.localstack.cloud) — required for credentials, the CLI will guide you through authentication.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
### 1. Homebrew (macOS / Linux)
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
brew install localstack/tap/lstk
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 2. NPM
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install -g @localstack/lstk
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 3. Binaries
|
|
32
|
+
Pre-built binaries are also available from [GitHub Releases](https://github.com/localstack/lstk/releases). 📦
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
lstk
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Running `lstk` will automatically handle configuration setup and start LocalStack.
|
|
41
|
+
|
|
42
|
+
## Features
|
|
43
|
+
|
|
44
|
+
- **Start / stop / status** — manage LocalStack emulators with a single command
|
|
45
|
+
- **Interactive TUI** — a Bubble Tea-powered terminal UI shown in an interactive terminal for commands like `start`, `login`, `status`, etc.
|
|
46
|
+
- **Plain output** for CI/CD and scripting (auto-detected in non-interactive environments or forced with `--non-interactive`)
|
|
47
|
+
- **Log streaming** — tail emulator logs in real-time with `--follow`; use `--verbose` to show all logs without filtering
|
|
48
|
+
- **Snapshots** — save, load, and remove emulator state as local files, named cloud snapshots (`pod:` prefix), or in your own S3 bucket (`s3://`), and auto-load one on start
|
|
49
|
+
- **Browser-based login** — authenticate via browser and store credentials securely in the system keyring
|
|
50
|
+
- **AWS CLI profile** — optionally configure a `localstack` profile in `~/.aws/` after start
|
|
51
|
+
- **Terraform integration** — proxy Terraform commands to LocalStack with automatic AWS provider endpoint configuration
|
|
52
|
+
- **CDK integration** — proxy AWS CDK commands to LocalStack with automatic endpoint configuration (requires AWS CDK >= 2.177.0)
|
|
53
|
+
- **Self-update** — check for and install the latest `lstk` release with `lstk update`
|
|
54
|
+
- **Shell completions** — bash, zsh, and fish completions included
|
|
55
|
+
|
|
56
|
+
## Authentication
|
|
57
|
+
|
|
58
|
+
The CLI supports multiple auth workflows. `lstk` resolves your auth token in this order:
|
|
59
|
+
|
|
60
|
+
1. **System keyring** — a token stored by a previous `lstk login`
|
|
61
|
+
2. **`LOCALSTACK_AUTH_TOKEN` environment variable**
|
|
62
|
+
3. **Browser login** — triggered automatically in interactive mode when neither of the above is present
|
|
63
|
+
|
|
64
|
+
> [!NOTE]
|
|
65
|
+
> If a keyring token exists, it takes precedence over `LOCALSTACK_AUTH_TOKEN`. Setting or changing the environment variable will have no effect until the keyring token is removed. Run `lstk logout` to clear the stored keyring token, after which the env var will be used.
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## Configuration
|
|
69
|
+
|
|
70
|
+
`lstk` uses a TOML config file, created automatically on first run.
|
|
71
|
+
|
|
72
|
+
`lstk` uses the first `config.toml` found in this order:
|
|
73
|
+
1. `./.lstk/config.toml` (project-local)
|
|
74
|
+
2. `$HOME/.config/lstk/config.toml`
|
|
75
|
+
3. **macOS**: `$HOME/Library/Application Support/lstk/config.toml` / **Windows**: `%AppData%\lstk\config.toml`
|
|
76
|
+
|
|
77
|
+
On first run, the config is created at `$HOME/.config/lstk/config.toml` if `$HOME/.config/` already exists, otherwise at the OS default (#3). This means #3 is only reached on macOS when `$HOME/.config/` didn't exist at first run.
|
|
78
|
+
|
|
79
|
+
To see which config file is currently in use:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
lstk config path
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Choosing an emulator
|
|
86
|
+
|
|
87
|
+
`lstk` starts the AWS emulator by default. To run the Snowflake or Azure emulator instead, either select it interactively when prompted at start, or set the `type` in your config:
|
|
88
|
+
|
|
89
|
+
```toml
|
|
90
|
+
[[containers]]
|
|
91
|
+
type = "azure" # or "snowflake"
|
|
92
|
+
port = "4566"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The chosen emulator must be running before you set up or use its CLI integration below.
|
|
96
|
+
|
|
97
|
+
You can also configure cloud CLI integration:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
lstk setup aws # localstack profile in ~/.aws/
|
|
101
|
+
lstk setup azure # isolated Azure CLI config for `lstk az` (requires the Azure CLI)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
After starting the Azure emulator and running `lstk setup azure`, run Azure CLI commands against LocalStack with `lstk az`:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
lstk az group list
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`lstk setup azure` registers a custom Azure cloud — pointing at LocalStack's endpoints — inside an isolated `AZURE_CONFIG_DIR`, so your global `~/.azure` keeps pointing at real Azure.
|
|
111
|
+
|
|
112
|
+
To run existing `az` scripts unmodified against LocalStack, you can instead redirect your **global** Azure CLI:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
lstk az start-interception # plain `az` now targets LocalStack
|
|
116
|
+
az group list # hits LocalStack, no `lstk` prefix needed
|
|
117
|
+
lstk az stop-interception # back to real Azure (use --cloud to pick another cloud)
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
This is optional and changes global state affecting every `az` invocation until you stop it; prefer `lstk az <command>` unless a script must call plain `az`.
|
|
121
|
+
|
|
122
|
+
You can also point `lstk` at a specific config file for any command:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
lstk --config /path/to/config.toml start
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Default config
|
|
129
|
+
|
|
130
|
+
```toml
|
|
131
|
+
[[containers]]
|
|
132
|
+
type = "aws" # Emulator type. Currently supported: "aws", "snowflake", "azure"
|
|
133
|
+
tag = "latest" # Docker image tag, e.g. "latest", "2026.03"
|
|
134
|
+
port = "4566" # Host port the emulator will be accessible on
|
|
135
|
+
# volumes = [] # Bind mounts, "host:container[:ro]" (see below)
|
|
136
|
+
# env = [] # Named environment profiles to apply (see [env.*] sections below)
|
|
137
|
+
# snapshot = "pod:my-baseline" # Snapshot REF auto-loaded on start (AWS only); see Snapshots below
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Fields:**
|
|
141
|
+
- `type`: emulator type; one of `"aws"`, `"snowflake"`, or `"azure"`
|
|
142
|
+
- `tag`: Docker image tag for LocalStack (e.g. `"latest"`, `"4.14.0"`); useful for pinning a version
|
|
143
|
+
- `port`: port LocalStack listens on (default `4566`)
|
|
144
|
+
- `volumes`: (optional) list of `"host:container[:ro]"` bind mounts, e.g. for init hooks or the persistent-state directory (see below)
|
|
145
|
+
- `env`: (optional) list of named environment variable groups to inject into the container (see below)
|
|
146
|
+
- `snapshot`: (optional) snapshot REF auto-loaded after the emulator starts on a fresh run — a local file path or a `pod:` cloud snapshot (see [Snapshots](#snapshots))
|
|
147
|
+
|
|
148
|
+
### Passing environment variables to the container
|
|
149
|
+
|
|
150
|
+
Define reusable named env sets and reference them per container:
|
|
151
|
+
|
|
152
|
+
```toml
|
|
153
|
+
[[containers]]
|
|
154
|
+
type = "aws"
|
|
155
|
+
tag = "latest"
|
|
156
|
+
port = "4566"
|
|
157
|
+
env = ["debug", "ci"]
|
|
158
|
+
|
|
159
|
+
[env.debug]
|
|
160
|
+
DEBUG = "1"
|
|
161
|
+
ENFORCE_IAM = "1"
|
|
162
|
+
PERSISTENCE = "1"
|
|
163
|
+
|
|
164
|
+
[env.ci]
|
|
165
|
+
SERVICES = "s3,sqs"
|
|
166
|
+
EAGER_SERVICE_LOADING = "1"
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Host environment variables prefixed with `LOCALSTACK_` are also forwarded to the emulator.
|
|
170
|
+
|
|
171
|
+
### Mounting volumes and init hooks
|
|
172
|
+
|
|
173
|
+
Use `volumes` to bind-mount host files or directories into the emulator, given as Docker-style `"host:container[:ro]"` strings. The most common use is [init hooks](https://docs.localstack.cloud/snowflake/capabilities/init-hooks/) — scripts LocalStack runs automatically on startup when mounted into `/etc/localstack/init/{boot,start,ready,shutdown}.d`:
|
|
174
|
+
|
|
175
|
+
```toml
|
|
176
|
+
[[containers]]
|
|
177
|
+
type = "snowflake"
|
|
178
|
+
port = "4566"
|
|
179
|
+
volumes = ["./init.sf.sql:/etc/localstack/init/ready.d/init.sf.sql"]
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
- Relative host paths resolve against the config file's directory, and a leading `~/` is expanded.
|
|
183
|
+
- Append `:ro` to mount read-only.
|
|
184
|
+
- Host sources must already exist (init-hook entries are files, so `lstk` does not create them).
|
|
185
|
+
|
|
186
|
+
#### Persistent state
|
|
187
|
+
|
|
188
|
+
The persistent-state directory (mounted at `/var/lib/localstack`, managed by `lstk volume path` / `lstk volume clear`) defaults to the OS cache dir. Point it elsewhere with a `volumes` entry targeting that path:
|
|
189
|
+
|
|
190
|
+
```toml
|
|
191
|
+
volumes = ["/data:/var/lib/localstack"]
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
> The singular `volume = "..."` field is a legacy way to set only this directory. It still works, but `volumes` is preferred and is the only option for init hooks or other mounts.
|
|
195
|
+
|
|
196
|
+
### Offline / enterprise environments
|
|
197
|
+
|
|
198
|
+
`lstk start` degrades gracefully when the common enterprise blockers (Docker Hub unreachable, a forward proxy, TLS interception, or an unreachable license server) make a network request fail:
|
|
199
|
+
|
|
200
|
+
- If the image cannot be pulled but is already present locally, `lstk` warns and starts the local image instead of failing.
|
|
201
|
+
- If the license server cannot be reached, `lstk` skips its pre-flight check and lets the emulator validate its own bundled license at startup. A definitive rejection from the server (e.g. an invalid token) stays fatal.
|
|
202
|
+
|
|
203
|
+
Pair this with a custom `image` in the config to point at a locally loaded image or an internal-registry mirror.
|
|
204
|
+
|
|
205
|
+
## Interactive And Non-Interactive Mode
|
|
206
|
+
|
|
207
|
+
`lstk` uses the TUI in an interactive terminal and plain output elsewhere. Use `--non-interactive` to force plain output even in a TTY:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
lstk --non-interactive
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Logging
|
|
214
|
+
|
|
215
|
+
`lstk` writes diagnostic logs to `lstk.log` in the same directory as the config file. The log file appends across runs and is automatically cleared when it exceeds 1 MB. Use `lstk config path` to print the full config file path; the log file lives alongside it in the same directory.
|
|
216
|
+
|
|
217
|
+
## Environment Variables
|
|
218
|
+
|
|
219
|
+
| Variable | Description |
|
|
220
|
+
|---|---|
|
|
221
|
+
| `LOCALSTACK_AUTH_TOKEN` | Auth token used for non-interactive runs or to skip browser login |
|
|
222
|
+
| `LOCALSTACK_DISABLE_EVENTS=1` | Disables telemetry event reporting |
|
|
223
|
+
| `LSTK_OTEL=1` | Enables OpenTelemetry trace export (disabled by default). When enabled, standard `OTEL_EXPORTER_OTLP_*` env vars are respected by the SDK (e.g. `OTEL_EXPORTER_OTLP_ENDPOINT` defaults to `http://localhost:4318`). Requires an OTLP-compatible backend to receive and visualize telemetry — for local development, `make otel` starts one (UI at http://localhost:16686). |
|
|
224
|
+
| `DOCKER_HOST` | Override the Docker daemon socket (e.g. `unix:///home/user/.colima/default/docker.sock`). When unset, lstk tries the default socket and then probes common alternatives (Colima, OrbStack). |
|
|
225
|
+
|
|
226
|
+
### Terraform Integration
|
|
227
|
+
|
|
228
|
+
`lstk terraform` (alias `tf`) is a proxy that runs Terraform commands against LocalStack, automatically configuring the AWS provider to use LocalStack's endpoints. This allows you to test infrastructure-as-code locally before deploying to AWS.
|
|
229
|
+
|
|
230
|
+
**lstk-specific flags** (appear after the `terraform`/`tf` subcommand):
|
|
231
|
+
- `--region <region>` — Deployment region (default: `us-east-1`)
|
|
232
|
+
- `--account <id>` — Target AWS account ID, 12 digits (default: `test`)
|
|
233
|
+
|
|
234
|
+
**Environment variables:**
|
|
235
|
+
- `LSTK_TF_CMD` — Terraform binary to invoke; default is `terraform` (e.g., use `tofu` for OpenTofu)
|
|
236
|
+
- `LSTK_TF_OVERRIDE_FILE_NAME` — Override file name (default: `localstack_providers_override.tf`)
|
|
237
|
+
- `LSTK_TF_DRY_RUN` — Generate the override file but do not run terraform
|
|
238
|
+
- `AWS_ENDPOINT_URL` — Override the auto-resolved LocalStack endpoint
|
|
239
|
+
- `AWS_REGION` — Fallback for `--region` flag
|
|
240
|
+
- `AWS_ACCESS_KEY_ID` — Fallback for `--account` flag
|
|
241
|
+
|
|
242
|
+
### CDK Integration
|
|
243
|
+
|
|
244
|
+
`lstk cdk` is a proxy that runs AWS CDK commands against LocalStack, pointing the CDK CLI at LocalStack's endpoints via environment variables (so deploys target the running emulator instead of real AWS).
|
|
245
|
+
|
|
246
|
+
**Requires AWS CDK CLI version 2.177.0 or newer** on your `PATH` (lstk targets LocalStack purely through environment variables, which older CDK versions ignore).
|
|
247
|
+
|
|
248
|
+
**lstk-specific flags** (appear after the `cdk` subcommand):
|
|
249
|
+
- `--region <region>` — Deployment region (default: `us-east-1`)
|
|
250
|
+
|
|
251
|
+
CDK always targets the default LocalStack account 000000000000; there is no --account flag.
|
|
252
|
+
|
|
253
|
+
**Environment variables:**
|
|
254
|
+
- `LSTK_CDK_CMD` — CDK binary to invoke (default: `cdk`)
|
|
255
|
+
- `AWS_ENDPOINT_URL` — Override the auto-resolved LocalStack endpoint
|
|
256
|
+
- `AWS_ENDPOINT_URL_S3` — Override the auto-derived S3 endpoint
|
|
257
|
+
- `AWS_REGION` — Fallback for `--region` flag
|
|
258
|
+
|
|
259
|
+
## Usage
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
# Start the LocalStack emulator
|
|
263
|
+
lstk
|
|
264
|
+
|
|
265
|
+
# Start non-interactively (e.g. in CI)
|
|
266
|
+
LOCALSTACK_AUTH_TOKEN=<token> lstk --non-interactive
|
|
267
|
+
|
|
268
|
+
# Stop the running emulator
|
|
269
|
+
lstk stop
|
|
270
|
+
|
|
271
|
+
# Show emulator status and deployed resources
|
|
272
|
+
lstk status
|
|
273
|
+
|
|
274
|
+
# Stream emulator logs
|
|
275
|
+
lstk logs --follow
|
|
276
|
+
|
|
277
|
+
# Stream all emulator logs without filtering
|
|
278
|
+
lstk logs --follow --verbose
|
|
279
|
+
|
|
280
|
+
# Log in (opens browser for authentication)
|
|
281
|
+
lstk login
|
|
282
|
+
|
|
283
|
+
# Log out (removes stored credentials)
|
|
284
|
+
lstk logout
|
|
285
|
+
|
|
286
|
+
# Check whether a newer lstk version is available
|
|
287
|
+
lstk update --check
|
|
288
|
+
|
|
289
|
+
# Update lstk to the latest version
|
|
290
|
+
lstk update
|
|
291
|
+
|
|
292
|
+
# Show resolved config file path
|
|
293
|
+
lstk config path
|
|
294
|
+
|
|
295
|
+
# Set up AWS CLI profile integration
|
|
296
|
+
lstk setup aws
|
|
297
|
+
|
|
298
|
+
# Set up Azure CLI integration (isolated config for `lstk az`)
|
|
299
|
+
lstk setup azure
|
|
300
|
+
|
|
301
|
+
# Run Azure CLI commands against LocalStack
|
|
302
|
+
lstk az group list
|
|
303
|
+
|
|
304
|
+
# Or redirect your global `az` so existing scripts hit LocalStack unmodified
|
|
305
|
+
lstk az start-interception
|
|
306
|
+
lstk az stop-interception
|
|
307
|
+
|
|
308
|
+
# Save emulator state to a local file
|
|
309
|
+
lstk snapshot save ./my-snapshot.snapshot
|
|
310
|
+
|
|
311
|
+
# Save emulator state as a named cloud snapshot on the LocalStack platform
|
|
312
|
+
lstk snapshot save pod:my-baseline
|
|
313
|
+
|
|
314
|
+
# Save to your own S3 bucket (credentials from AWS_* env vars or --profile)
|
|
315
|
+
lstk snapshot save my-pod s3://my-bucket/prefix
|
|
316
|
+
|
|
317
|
+
# Load a snapshot back into the running emulator
|
|
318
|
+
lstk snapshot load pod:my-baseline
|
|
319
|
+
lstk snapshot load my-pod s3://my-bucket/prefix
|
|
320
|
+
|
|
321
|
+
# List cloud snapshots on the LocalStack platform (--all for the whole organization)
|
|
322
|
+
lstk snapshot list
|
|
323
|
+
|
|
324
|
+
# List snapshots in your own S3 bucket (requires a running emulator)
|
|
325
|
+
lstk snapshot list s3://my-bucket/prefix
|
|
326
|
+
|
|
327
|
+
# Show metadata for a single cloud snapshot
|
|
328
|
+
lstk snapshot show pod:my-baseline
|
|
329
|
+
|
|
330
|
+
# Delete a cloud snapshot (prompts for confirmation; --force to skip)
|
|
331
|
+
lstk snapshot remove pod:my-baseline
|
|
332
|
+
|
|
333
|
+
# Initialize Terraform with LocalStack
|
|
334
|
+
lstk terraform init
|
|
335
|
+
|
|
336
|
+
# Plan Terraform deployment in a specific region
|
|
337
|
+
lstk terraform --region us-west-2 plan
|
|
338
|
+
|
|
339
|
+
# Apply Terraform configuration (short form)
|
|
340
|
+
lstk tf apply
|
|
341
|
+
|
|
342
|
+
# Bootstrap and deploy an AWS CDK app against LocalStack
|
|
343
|
+
lstk cdk bootstrap
|
|
344
|
+
lstk cdk deploy --require-approval never
|
|
345
|
+
|
|
346
|
+
# Synthesize a CDK app (offline, no running emulator needed)
|
|
347
|
+
lstk cdk synth
|
|
348
|
+
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
## Snapshots
|
|
352
|
+
|
|
353
|
+
Snapshots capture the running emulator's state so you can restore it later.
|
|
354
|
+
|
|
355
|
+
A snapshot reference is a **local file**, a **cloud snapshot**, or an **S3 remote**:
|
|
356
|
+
|
|
357
|
+
- **Local file** — an absolute or relative path. A `.snapshot` extension is added if omitted (snapshots saved as `.zip` by older lstk versions still load).
|
|
358
|
+
- **Cloud snapshot** — a name with the `pod:` prefix (e.g. `pod:my-baseline`), stored on the LocalStack platform. Requires authentication (`LOCALSTACK_AUTH_TOKEN` or `lstk login`).
|
|
359
|
+
- **S3 remote** — an `s3://bucket/prefix` location backed by your own S3 bucket. Supported by `save`, `load`, and `list`.
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
# Save (local, cloud, or S3)
|
|
363
|
+
lstk snapshot save ./my-snapshot.snapshot
|
|
364
|
+
lstk snapshot save pod:my-baseline
|
|
365
|
+
lstk snapshot save my-pod s3://my-bucket/prefix
|
|
366
|
+
|
|
367
|
+
# Load (starts the emulator first if needed)
|
|
368
|
+
lstk snapshot load pod:my-baseline
|
|
369
|
+
lstk snapshot load my-pod s3://my-bucket/prefix
|
|
370
|
+
|
|
371
|
+
# List cloud snapshots — only your own by default, --all for the whole organization
|
|
372
|
+
lstk snapshot list
|
|
373
|
+
lstk snapshot list --all
|
|
374
|
+
|
|
375
|
+
# List snapshots in an S3 bucket
|
|
376
|
+
lstk snapshot list s3://my-bucket/prefix
|
|
377
|
+
|
|
378
|
+
# Show metadata for a single cloud snapshot
|
|
379
|
+
lstk snapshot show pod:my-baseline
|
|
380
|
+
|
|
381
|
+
# Remove — cloud snapshots only; local files are never deleted by the CLI
|
|
382
|
+
lstk snapshot remove pod:my-baseline # prompts for confirmation
|
|
383
|
+
lstk snapshot remove pod:my-baseline --force # skip the prompt (required in non-interactive mode)
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
`lstk snapshot load` supports merge strategies via `--merge` (`account-region-merge` (default), `overwrite`, `service-merge`) to control how snapshot state combines with running state.
|
|
387
|
+
|
|
388
|
+
### S3 remotes
|
|
389
|
+
|
|
390
|
+
`save`, `load`, and `list` can target your own S3 bucket with an `s3://bucket/prefix` location. The pod name (the snapshot's identity within the bucket) is a positional argument separate from the `s3://` location — required for `load`, auto-generated for `save` when omitted, and unused for `list`.
|
|
391
|
+
|
|
392
|
+
Credentials come from `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` (and optional `AWS_SESSION_TOKEN`), or from a named profile via `--profile <name>`. **Never put credentials in the URL** — lstk rejects an `s3://` ref that embeds them. lstk itself never touches S3: the running emulator performs the transfer, so these commands require a running emulator, and `list s3://…` queries the emulator rather than the LocalStack platform.
|
|
393
|
+
|
|
394
|
+
```bash
|
|
395
|
+
export AWS_ACCESS_KEY_ID=...
|
|
396
|
+
export AWS_SECRET_ACCESS_KEY=...
|
|
397
|
+
|
|
398
|
+
lstk snapshot save my-pod s3://my-bucket/prefix
|
|
399
|
+
lstk snapshot load my-pod s3://my-bucket/prefix
|
|
400
|
+
lstk snapshot list s3://my-bucket/prefix
|
|
401
|
+
|
|
402
|
+
# Or read credentials from a named AWS profile instead of env vars
|
|
403
|
+
lstk snapshot save my-pod s3://my-bucket/prefix --profile my-aws-profile
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
The S3 bucket must already exist — lstk checks up front and errors out rather than creating it on a typo. `remove` and `show` are not yet supported for S3 remotes.
|
|
407
|
+
|
|
408
|
+
### Auto-load on start
|
|
409
|
+
|
|
410
|
+
The AWS emulator can automatically load a snapshot whenever it starts. Set the `snapshot` field on its `[[containers]]` block to any snapshot reference — a local file or a `pod:` cloud snapshot:
|
|
411
|
+
|
|
412
|
+
```toml
|
|
413
|
+
[[containers]]
|
|
414
|
+
type = "aws"
|
|
415
|
+
port = "4566"
|
|
416
|
+
snapshot = "pod:my-baseline"
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
Override or disable it for a single run without editing the config:
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
lstk start --snapshot pod:other-baseline # load a different snapshot this run
|
|
423
|
+
lstk start --no-snapshot # skip auto-loading this run
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
## Extensions
|
|
427
|
+
|
|
428
|
+
lstk supports Git-style extensions: running `lstk <name>`, for a name that isn't a built-in command, delegates to an external `lstk-<name>` executable found on your `PATH`, forwarding all arguments and passing stdin/stdout/stderr through.
|
|
429
|
+
|
|
430
|
+
```bash
|
|
431
|
+
lstk my-tool --flag # resolves and runs lstk-my-tool, if it exists
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
Extensions receive context about the current lstk setup (config dir, auth token, running emulators) via environment variables, so they can integrate without reimplementing discovery.
|
|
435
|
+
|
|
436
|
+
See [docs/extensions-authoring.md](docs/extensions-authoring.md) for the extension contract and how to author your own.
|
|
437
|
+
|
|
438
|
+
## Reporting bugs
|
|
439
|
+
|
|
440
|
+
Feedback is welcome! Use the repository issue tracker for bug reports or feature requests.
|
package/lstk
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@localstack/lstk_darwin_amd64",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"bin": {
|
|
5
5
|
"lstk_darwin_amd64": "lstk"
|
|
6
6
|
},
|
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
"cpu": [
|
|
11
11
|
"x64"
|
|
12
12
|
],
|
|
13
|
-
"files": [
|
|
13
|
+
"files": [
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
14
17
|
"keywords": [
|
|
15
18
|
"localstack",
|
|
16
19
|
"cli",
|