Skip to content

Commit e764ce4

Browse files
docs(aws): migrate /aws/customization and remaining /aws/services pages to use lstk (#862)
1 parent cf5495e commit e764ce4

24 files changed

Lines changed: 237 additions & 157 deletions

src/content/docs/aws/customization/advanced/arm64-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This manifest contains links to a Linux AMD64 as well as a Linux ARM64 image.
1212

1313
## Pulling the LocalStack image
1414

15-
With the multi-arch Docker manifest, your Docker client (and therefore the [LocalStack CLI](/aws/getting-started/installation/#localstack-cli)) now automatically selects the image according to your platform:
15+
With the multi-arch Docker manifest, your Docker client (and therefore [`lstk`](/aws/developer-tools/running-localstack/lstk)) now automatically selects the image according to your platform:
1616

1717
```bash
1818
docker pull localstack/localstack

src/content/docs/aws/customization/advanced/cross-account-access.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ This document provides information to help design such setups.
1313

1414
:::note
1515
Cross-account support in LocalStack is being actively developed.
16-
Please report any issues on our [GitHub Discussions board](https://github.com/orgs/localstack/discussions/categories/bugs).
16+
Please report any issues to [LocalStack Support](/aws/help-support/get-help).
1717
:::
1818

1919
Cross-account/cross-region access happens when a client attempts to access a resource in another account or region than what it is configured with:
2020

21+
The examples below select the account with the `--account` flag of `lstk aws`.
22+
You can also set the account ID through the `AWS_ACCESS_KEY_ID` environment variable, for example `AWS_ACCESS_KEY_ID=111111111111 lstk aws ...`.
23+
2124
```bash
2225
# Create a queue in one account and region
23-
AWS_ACCESS_KEY_ID=111111111111 awslocal sqs create-queue \
26+
lstk aws --account 111111111111 sqs create-queue \
2427
--queue-name my-queue \
2528
--region ap-south-1
2629
```
@@ -33,14 +36,14 @@ AWS_ACCESS_KEY_ID=111111111111 awslocal sqs create-queue \
3336

3437
```bash
3538
# Set some attributes
36-
AWS_ACCESS_KEY_ID=111111111111 awslocal sqs set-queue-attributes \
39+
lstk aws --account 111111111111 sqs set-queue-attributes \
3740
--attributes VisibilityTimeout=60 \
3841
--queue-url http://sqs.ap-south-1.localhost.localstack.cloud:443/111111111111/my-queue \
3942
--region ap-south-1
4043

4144
# Retrieve the queue attribute from another account and region
4245
# The required information for LocalStack to locate the queue is available in the queue URL
43-
AWS_ACCESS_KEY_ID=222222222222 awslocal sqs get-queue-attributes \
46+
lstk aws --account 222222222222 sqs get-queue-attributes \
4447
--attribute-names VisibilityTimeout \
4548
--region eu-central-1 \
4649
--queue-url http://sqs.ap-south-1.localhost.localstack.cloud:443/111111111111/my-queue

src/content/docs/aws/customization/advanced/filesystem.mdx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,17 @@ In this case, the effective layout would be something like:
100100
- zipfile.4986fb95
101101
</FileTree>
102102

103-
### Using the CLI
103+
### Using lstk
104104

105-
When using the CLI to start LocalStack, the volume directory can be configured via the `LOCALSTACK_VOLUME_DIR`.
106-
It should point to a directory on the host which is then automatically mounted into `/var/lib/localstack`.
107-
The defaults are:
105+
When using [`lstk`](/aws/developer-tools/running-localstack/lstk) to start LocalStack, the volume directory is configured with the `volume` field on a container block.
106+
It should point to a directory on the host which is then automatically mounted into `/var/lib/localstack`:
108107

109-
- Mac: `~/Library/Caches/localstack/volume`
110-
- Linux: `~/.cache/localstack/volume`
111-
- Windows: `%LOCALAPPDATA%\cache\localstack\volume`
108+
```toml
109+
# .lstk/config.toml
110+
[[containers]]
111+
type = "aws"
112+
volume = "./volume"
113+
```
114+
115+
If `volume` is not set, `lstk` defaults to `<os-cache>/lstk/volume/<container-name>`.
116+
Run [`lstk volume path`](/aws/developer-tools/running-localstack/lstk#volume) to print the resolved directory.

src/content/docs/aws/customization/advanced/initialization-hooks.mdx

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,16 @@ If you have more complex states, [Cloud Pods](/aws/developer-tools/snapshots/clo
123123
To execute aws cli commands when LocalStack becomes ready,
124124
simply create a script `init-aws.sh` and mount it into `/etc/localstack/init/ready.d/`.
125125
Make sure the script is executable: run `chmod +x init-aws.sh` on the file first.
126-
You can use anything available inside the container, including `awslocal`:
126+
You can use anything available inside the container, and can install new software:
127127

128128
```bash
129129
#!/bin/bash
130130

131-
export AWS_ACCESS_KEY_ID=000000000000 AWS_SECRET_ACCESS_KEY=000000000000
131+
npm install -g @localstack/lstk
132+
lstk setup aws
132133

133-
awslocal s3 mb s3://my-bucket
134-
awslocal sqs create-queue --queue-name my-queue
134+
lstk aws s3 mb s3://my-bucket
135+
lstk aws sqs create-queue --queue-name my-queue
135136
```
136137

137138
Start Localstack:
@@ -153,11 +154,22 @@ services:
153154
- "/var/run/docker.sock:/var/run/docker.sock"
154155
```
155156
</TabItem>
156-
<TabItem value="CLI" label="CLI">
157-
```bash
158-
# DOCKER_FLAGS are additional parameters to the `docker run` command of localstack start
157+
<TabItem value="lstk" label="lstk">
158+
Declare the bind mount and the `DEBUG` profile in your config file, then start LocalStack:
159+
160+
```toml
161+
# .lstk/config.toml
162+
[[containers]]
163+
type = "aws"
164+
env = ["debug"]
165+
volumes = ["/path/to/init-aws.sh:/etc/localstack/init/ready.d/init-aws.sh"]
166+
167+
[env.debug]
168+
DEBUG = "1"
169+
```
159170

160-
DOCKER_FLAGS='-v /path/to/init-aws.sh:/etc/localstack/init/ready.d/init-aws.sh' localstack start
171+
```bash
172+
lstk start
161173
```
162174
</TabItem>
163175
</Tabs>
@@ -172,8 +184,8 @@ and for more details on running init hooks in development mode, you can check ou
172184

173185
Start LocalStack with **`EXTENSION_AUTO_INSTALL="localstack-extension-terraform-init"`**.
174186
Mount a **`main.tf`** file into **`/etc/localstack/init/ready.d`**
175-
When LocalStack starts up, it will install the extension, which in turn installs Terraform and [`tflocal`](https://github.com/localstack/terraform-local) into the container.
176-
If one of the init stage directories contain a `main.tf` file, the extension will run `tflocal init` and `tflocal apply` on that directory.
187+
When LocalStack starts up, it will install the extension, which in turn installs Terraform into the container.
188+
If one of the init stage directories contain a `main.tf` file, the extension will run `terraform init` and `terraform apply` on that directory.
177189

178190
```terraform
179191
# main.tf
@@ -210,19 +222,28 @@ services:
210222
- "/var/run/docker.sock:/var/run/docker.sock"
211223
```
212224
</TabItem>
213-
<TabItem value="LocalStack CLI" label="LocalStack CLI">
225+
<TabItem value="lstk" label="lstk">
226+
```toml
227+
# .lstk/config.toml
228+
[[containers]]
229+
type = "aws"
230+
env = ["terraform-init"]
231+
volumes = ["./main.tf:/etc/localstack/init/ready.d/main.tf"]
232+
233+
[env.terraform-init]
234+
EXTENSION_AUTO_INSTALL = "localstack-extension-terraform-init"
235+
```
236+
214237
```bash
215-
localstack start \
216-
-e EXTENSION_AUTO_INSTALL="localstack-extension-terraform-init" \
217-
-v ./main.tf:/etc/localstack/init/ready.d/main.tf
238+
lstk start
218239
```
219240
</TabItem>
220241
</Tabs>
221242

222243
You can wait for LocalStack to complete the startup process, and then print the created S3 bucket:
223244

224245
```bash
225-
localstack wait && awslocal s3 ls
246+
lstk aws s3 ls
226247
```
227248

228249
The logs should show something like:

src/content/docs/aws/customization/advanced/multi-account-setups.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sidebar:
88

99
:::note
1010
Please note that multi-accounts may not work for use-cases that have cross-account and cross-service access.
11-
Please open a [GitHub Discussion](https://github.com/orgs/localstack/discussions/new/choose) to request and upvote for support for specific use-cases.
11+
Please contact [LocalStack Support](/aws/help-support/get-help) to request support for specific use-cases.
1212
:::
1313

1414
LocalStack ships with multi-account support which allows namespacing based on AWS account ID.
@@ -20,14 +20,13 @@ The Access Key ID field can be configured in the AWS CLI in multiple ways: pleas
2020

2121
## Examples
2222

23-
In following examples, we configure the AWS CLI account ID via environment variable.
23+
In the following examples, we select the account ID with the `--account` flag of `lstk aws`.
2424

2525
```bash
26-
AWS_ACCESS_KEY_ID=000000000001 awslocal ec2 create-key-pair --key-name green-hospital
26+
lstk aws --account 000000000001 ec2 create-key-pair --key-name green-hospital
27+
lstk aws --account 000000000002 ec2 create-key-pair --key-name red-medicine
2728

28-
AWS_ACCESS_KEY_ID=000000000002 awslocal ec2 create-key-pair --key-name red-medicine
29-
30-
AWS_ACCESS_KEY_ID=000000000001 awslocal ec2 describe-key-pairs
29+
lstk aws --account 000000000001 ec2 describe-key-pairs
3130
{
3231
"KeyPairs": [
3332
{
@@ -37,7 +36,7 @@ AWS_ACCESS_KEY_ID=000000000001 awslocal ec2 describe-key-pairs
3736
]
3837
}
3938

40-
AWS_ACCESS_KEY_ID=000000000002 awslocal ec2 describe-key-pairs
39+
lstk aws --account 000000000002 ec2 describe-key-pairs
4140
{
4241
"KeyPairs": [
4342
{
@@ -48,11 +47,17 @@ AWS_ACCESS_KEY_ID=000000000002 awslocal ec2 describe-key-pairs
4847
}
4948
```
5049

50+
Alternatively, you can set the account ID through the `AWS_ACCESS_KEY_ID` environment variable:
51+
52+
```bash
53+
AWS_ACCESS_KEY_ID=000000000001 lstk aws ec2 describe-key-pairs
54+
```
55+
5156
If no explicit Account ID is set, LocalStack falls back to default.
5257
In this example, no resources are returned.
5358

5459
```bash
55-
awslocal ec2 describe-key-pairs
60+
lstk aws ec2 describe-key-pairs
5661
{
5762
"KeyPairs": []
5863
}

src/content/docs/aws/customization/advanced/usage-tracking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Here is an example of a CLI invocation event:
9696
"client_time": "2022-08-30 14:46:54.116457"
9797
},
9898
"payload": {
99-
"cmd": "localstack config validate",
99+
"cmd": "lstk start",
100100
"params": [
101101
"file"
102102
]

src/content/docs/aws/customization/configuration-options.md

Lines changed: 23 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,33 @@ template: doc
66

77
LocalStack exposes various configuration options to control its behaviour.
88

9-
These options can be passed to LocalStack as environment variables like so:
9+
With `lstk`, these options can be passed as `LOCALSTACK_`-prefixed environment variables when starting the container:
1010

1111
```bash
12-
DEBUG=1 localstack start
12+
LOCALSTACK_DEBUG=1 lstk start
1313
```
1414

15+
Alternatively, set them as named environment profiles in your config file and reference them from the container block:
16+
17+
```toml
18+
# .lstk/config.toml
19+
[[containers]]
20+
type = "aws"
21+
env = ["debug"]
22+
23+
[env.debug]
24+
DEBUG = "1"
25+
```
26+
27+
```bash
28+
lstk start
29+
```
30+
31+
See [Passing environment variables to the container](/aws/developer-tools/running-localstack/lstk#passing-environment-variables-to-the-container) for details.
32+
1533
To facilitate interoperability, configuration variables can be prefixed with `LOCALSTACK_` in docker.
1634
For instance, setting `LOCALSTACK_PERSISTENCE=1` is equivalent to `PERSISTENCE=1`.
1735

18-
You can also use [Profiles](#profiles).
19-
2036
Configurations marked as **Deprecated** will be removed in the next major version.
2137
You can find previously removed configuration variables under [Legacy](#legacy).
2238

@@ -44,20 +60,16 @@ Options that affect the core LocalStack system.
4460

4561
## CLI
4662

47-
These options are applicable when using the CLI to start LocalStack.
48-
49-
| Variable | Example Values | Description |
50-
| - | - | - |
51-
| `LOCALSTACK_VOLUME_DIR` | `~/.cache/localstack/volume` (on Linux) | The location on the host of the LocalStack volume directory mount. See [Filesystem Layout](/aws/customization/advanced/filesystem#using-the-cli) |
52-
| `CONFIG_PROFILE` | | The configuration profile to load. See [Profiles](#profiles) |
53-
| `CONFIG_DIR` | `~/.localstack` | The path where LocalStack can find configuration profiles and other CLI-specific configuration |
63+
`lstk` is configured through its config file rather than through environment variables.
64+
See [Configuration](/aws/developer-tools/running-localstack/lstk#configuration) on the `lstk` page for the config file search order, the field reference, and how to define named environment profiles.
5465

5566
## Docker
5667

5768
Options to configure how LocalStack interacts with Docker.
5869

5970
| Variable | Example Values | Description |
6071
| - | - | - |
72+
| `LOCALSTACK_VOLUME_DIR` | `~/.cache/localstack/volume` (on Linux) | The location on the host of the LocalStack volume directory mount. See [Filesystem Layout](/aws/customization/advanced/filesystem) |
6173
| `DOCKER_FLAGS` | | Allows to pass custom flags (e.g., volume mounts) to "docker run" when running LocalStack in Docker. |
6274
| `DOCKER_SOCK` | `/var/run/docker.sock` | Path to local Docker UNIX domain socket |
6375
| `DOCKER_BRIDGE_IP` | `172.17.0.1` | IP of the docker bridge used to enable access between containers |
@@ -540,51 +552,3 @@ These configurations have already been removed and **won't have any effect** on
540552
| `TMPDIR`| 2.0.0 | `/tmp` (default) | Temporary folder on the host running the CLI and inside the LocalStack container .|
541553
| `USE_LIGHT_IMAGE` | 2.0.0 | `1` (default) | Whether to use the light-weight Docker image. Overwritten by `IMAGE_NAME`.|
542554
| `PORT_WEB_UI` | 0.12.8 | `8080` (default) | Port for the legacy Web UI. Replaced by our [Web Application](https://app.localstack.cloud) |
543-
544-
## Profiles
545-
546-
LocalStack supports configuration profiles which are stored in the `~/.localstack` config directory.
547-
If the directory does not exist, create it manually.
548-
A configuration profile is a set of environment variables stored in an `.env` file in the LocalStack config directory.
549-
550-
Here is an example of what configuration profiles might look like:
551-
552-
```bash
553-
tree ~/.localstack
554-
/home/username/.localstack
555-
├── default.env
556-
├── dev.env
557-
└── pro.env
558-
```
559-
560-
Here is an example of what a specific environment profile looks like
561-
562-
```bash
563-
cat ~/.localstack/pro-debug.env
564-
LOCALSTACK_AUTH_TOKEN=XXXXX
565-
DEBUG=1
566-
DEVELOP=1
567-
```
568-
569-
You can load a profile by either setting the `env` variable `CONFIG_PROFILE=<profile>` or the `--profile=<profile>` CLI flag when using the CLI.
570-
Let's take an example to load the `dev.env` profile file if it exists:
571-
572-
```bash
573-
python -m localstack.cli.main --profile=dev start
574-
```
575-
576-
If no profile is specified, the `default.env` profile will be loaded.
577-
While explicitly specified, the environment variables will always overwrite the profile.
578-
579-
To display the config environment variables, you can use the following command:
580-
581-
```bash
582-
python -m localstack.cli.main --profile=dev config show
583-
```
584-
585-
:::note
586-
The `CONFIG_PROFILE` is a CLI feature and cannot be used with a Docker/Docker Compose setup.
587-
You can look at [alternative means of setting environment variables](https://docs.docker.com/compose/environment-variables/set-environment-variables/) for your Docker Compose setups.
588-
589-
For Docker setups, we recommend passing the environment variables directly to the `docker run` command.
590-
:::

src/content/docs/aws/customization/integrations/app-frameworks/aspire.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ sidebar:
1212

1313
With Aspire, developers can orchestrate cloud-native applications locally using the same AWS resources they deploy in production. By combining Aspire with LocalStack, teams can emulate their full cloud environment—including Lambda, SQS, S3, and DynamoDB—with minimal configuration and no AWS costs.
1414

15-
LocalStack integrates with Aspire through the [`LocalStack.Aspire.Hosting`](https://github.com/localstack-dotnet/dotnet-aspire-for-localstack) package, enabling seamless local development and testing of AWS-powered applications within the Aspire orchestration framework. This package extends the official [AWS integrations for .NET Aspire](https://github.com/aws/customization/integrations-on-dotnet-aspire-for-aws) to provide LocalStack-specific functionality.
15+
LocalStack integrates with Aspire through the [`LocalStack.Aspire.Hosting`](https://github.com/localstack-dotnet/dotnet-aspire-for-localstack) package, enabling seamless local development and testing of AWS-powered applications within the Aspire orchestration framework. This package extends the official [AWS integrations for .NET Aspire](https://github.com/aws/integrations-on-dotnet-aspire-for-aws) to provide LocalStack-specific functionality.
1616

1717
## Getting started
1818

@@ -168,7 +168,7 @@ An event registration system showcasing distributed tracing and observability pa
168168
- [Aspire Documentation](https://aspire.dev/)
169169
- [LocalStack.Aspire.Hosting on GitHub](https://github.com/localstack-dotnet/dotnet-aspire-for-localstack)
170170
- [LocalStack.Client on GitHub](https://github.com/localstack-dotnet/localstack-dotnet-client)
171-
- [AWS Aspire Integration](https://github.com/aws/customization/integrations-on-dotnet-aspire-for-aws)
171+
- [AWS Aspire Integration](https://github.com/aws/integrations-on-dotnet-aspire-for-aws)
172172
- [AWS SDK for .NET Documentation](https://docs.aws.amazon.com/sdk-for-net/)
173173
- [LocalStack Serverless .NET Demo](https://github.com/localstack-dotnet/localstack-serverless-dotnet-demo)
174174
- [OpenTelemetry with Aspire and LocalStack Demo](https://github.com/Blind-Striker/dotnet-otel-aspire-localstack-demo)

src/content/docs/aws/customization/integrations/app-frameworks/selfmanaged-kafka-cluster.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ docker-compose up -d
2222
2. Create the Lambda function:
2323

2424
```bash showshowLineNumbers
25-
awslocal lambda create-function \
25+
lstk aws lambda create-function \
2626
--function-name fun1 \
2727
--handler lambda.handler \
2828
--runtime python3.8 \
@@ -54,7 +54,7 @@ awslocal lambda create-function \
5454
3. Create an example secret:
5555

5656
```bash showshowLineNumbers
57-
awslocal secretsmanager create-secret --name localstack
57+
lstk aws secretsmanager create-secret --name localstack
5858
{
5959
"ARN": "arn:aws:secretsmanager:us-east-1:000000000000:secret:localstack-TDIuI",
6060
"Name": "localstack",
@@ -72,7 +72,7 @@ Created topic t1.
7272
5. Create the event source mapping to your local kafka cluster:
7373

7474
```bash showshowLineNumbers
75-
awslocal lambda create-event-source-mapping \
75+
lstk aws lambda create-event-source-mapping \
7676
--topics t1 \
7777
--source-access-configuration Type=SASL_SCRAM_512_AUTH,URI=arn:aws:secretsmanager:us-east-1:000000000000:secret:localstack-TDIuI \
7878
--function-name arn:aws:lambda:us-east-1:000000000000:function:fun1 \

src/content/docs/aws/customization/integrations/extensions/developing-extensions.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ reference points to the plugin class.
150150

151151
## Using the extensions developer CLI
152152

153+
:::note
154+
The new CLI experience, `lstk`, does not support LocalStack Extensions. There is no `lstk extensions` command suite.
155+
Continue using the legacy [LocalStack CLI](/aws/developer-tools/running-localstack/localstack-cli/) for the commands in this section.
156+
:::
157+
153158
The extensions CLI has a set of developer commands that allow you to create new extensions, and toggle local dev mode for extensions.
154159
Extensions that are toggled for developer mode will be mounted into the localstack container so you don't need to re-install them every time you change something.
155160

0 commit comments

Comments
 (0)