Skip to content

Commit 321254c

Browse files
authored
revamp snowflake docs (#7)
* finish intro page * remove hugo semantics * get capabilities done * finish integrations * get ui docs done * finish tutorials * fix everything in getting started docs * fix last remaining pieces * few more things done * add snowflake sql functions * more changes
1 parent 30dc7df commit 321254c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1235
-482
lines changed

astro.config.mjs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ export default defineConfig({
287287
collapsed: true,
288288
items: [
289289
{
290-
label: 'Welcome',
290+
label: 'Introduction',
291291
slug: 'snowflake',
292292
},
293293
{
@@ -324,10 +324,6 @@ export default defineConfig({
324324
label: 'SQL Functions',
325325
slug: 'snowflake/sql-functions',
326326
},
327-
{
328-
label: 'Feature Coverage',
329-
slug: 'snowflake/coverage-features',
330-
},
331327
{
332328
label: 'Changelog',
333329
slug: 'snowflake/changelog',
121 KB
Loading
92.9 KB
Loading
696 KB
Loading
446 KB
Loading
1.03 MB
Loading
378 KB
Loading

src/content/docs/snowflake/capabilities/configuration.md

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@ nav:
66
label:
77
---
88

9-
10-
11-
129
LocalStack exposes various configuration options to control its behaviour.
1310

1411
These options can be passed to LocalStack as environment variables like so:
1512

16-
{{< command >}}
17-
$ DEBUG=1 localstack start
18-
{{< / command >}}
13+
```bash
14+
DEBUG=1 localstack start
15+
```
1916

2017
## Core
2118

@@ -39,7 +36,7 @@ These options are applicable when using the CLI to start LocalStack.
3936
| Variable | Example Values | Description |
4037
| - | - | - |
4138
| `LOCALSTACK_VOLUME_DIR` | `~/.cache/localstack/volume` (on Linux) | The location on the host of the LocalStack volume directory mount. |
42-
| `CONFIG_PROFILE` | | The configuration profile to load. See [Profiles]({{< ref "#profiles" >}}) |
39+
| `CONFIG_PROFILE` | | The configuration profile to load. See [Profiles](#profiles) |
4340
| `CONFIG_DIR` | `~/.localstack` | The path where LocalStack can find configuration profiles and other CLI-specific configuration |
4441

4542
## Docker
@@ -72,42 +69,41 @@ A configuration profile is a set of environment variables stored in a `*.env` fi
7269

7370
Here is an example of what configuration profiles might look like:
7471

75-
{{< command >}}
72+
```bash
7673
$ tree ~/.localstack
7774
/home/username/.localstack
7875
├── default.env
7976
├── dev.env
8077
└── pro.env
81-
{{< / command >}}
78+
```
8279

8380
Here is an example of what a specific environment profile looks like
8481

85-
{{< command >}}
82+
```bash
8683
$ cat ~/.localstack/pro-debug.env
8784
LOCALSTACK_AUTH_TOKEN=XXXXX
8885
SF_LOG=trace
8986
SF_S3_ENDPOINT=s3.localhost.localstack.cloud:4566
90-
{{< / command >}}
87+
```
9188

9289
You can load a profile by either setting the environment variable `CONFIG_PROFILE=<profile>` or the `--profile=<profile>` CLI flag when using the CLI.
9390
Let's take an example to load the `dev.env` profile file if it exists:
9491

95-
{{< command >}}
96-
$ IMAGE_NAME=localstack/snowflake localstack --profile=dev start
97-
{{< / command >}}
92+
```bash
93+
IMAGE_NAME=localstack/snowflake localstack --profile=dev start
94+
```
9895

9996
If no profile is specified, the `default.env` profile will be loaded.
10097
If explicitly specified, any environment variables will overwrite the configurations defined in the profile.
10198

10299
To display the config environment variables, you can use the following command:
103100

104-
{{< command >}}
105-
$ localstack --profile=dev config show
106-
{{< / command >}}
101+
```bash
102+
localstack --profile=dev config show
103+
```
107104

108-
{{< alert title="Note" >}}
105+
:::note
109106
The `CONFIG_PROFILE` is a CLI feature and cannot be used directly with a docker-compose setup.
110107
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.
111108
For Docker setups, we recommend passing the environment variables directly to the `docker run` command.
112-
{{< /alert >}}
113-
109+
:::

src/content/docs/snowflake/capabilities/init-hooks.md renamed to src/content/docs/snowflake/capabilities/init-hooks.mdx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Initialization Hooks
33
description: Writing SQL scripts to initialize your Snowflake emulator
44
---
55

6+
import { Tabs, TabItem } from '@astrojs/starlight/components';
67

7-
88
## Introduction
99

1010
LocalStack for Snowflake supports automatically executing `*.sf.sql` files via [Init Hooks](https://docs.localstack.cloud/references/init-hooks/) when mounted into the Docker container. A script can be added to one of these stages in the lifecycle:
@@ -28,8 +28,9 @@ SHOW DATABASES;
2828

2929
Mount the script into `/etc/localstack/init/ready.d/` using Docker Compose or the `localstack` CLI:
3030

31-
{{< tabpane >}}
32-
{{< tab header="docker-compose.yml" lang="yml" >}}
31+
<Tabs>
32+
<TabItem label="docker-compose.yml">
33+
```yaml
3334
version: "3.8"
3435

3536
services:
@@ -47,13 +48,17 @@ services:
4748
- "/path/to/test.sf.sql:/etc/localstack/init/ready.d/test.sf.sql" # ready hook
4849
- "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
4950
- "/var/run/docker.sock:/var/run/docker.sock"
50-
{{< /tab >}}
51-
{{< tab header="CLI" lang="bash" >}}
51+
```
52+
</TabItem>
53+
<TabItem label="CLI">
54+
```bash
5255
# DOCKER_FLAGS are additional parameters to the `docker run` command of localstack start
53-
54-
DOCKER_FLAGS='-v /path/to/test.sf.sql:/etc/localstack/init/ready.d/test.sf.sql' DEBUG=1 localstack start
55-
{{< /tab >}}
56-
{{< /tabpane >}}
56+
DOCKER_FLAGS='-v /path/to/test.sf.sql:/etc/localstack/init/ready.d/test.sf.sql' \
57+
DEBUG=1 \
58+
localstack start
59+
```
60+
</TabItem>
61+
</Tabs>
5762

5863
Start the Snowflake emulator, and the following logs will appear:
5964

src/content/docs/snowflake/capabilities/state-management.md renamed to src/content/docs/snowflake/capabilities/state-management.mdx

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: State Management
33
description: Get started with State Management in LocalStack for Snowflake
44
---
55

6-
6+
import { Tabs, TabItem } from '@astrojs/starlight/components';
77

88
## Introduction
99

@@ -22,34 +22,43 @@ LocalStack’s Persistence mechanism enables the saving and restoration of the e
2222

2323
To start snapshot-based persistence, launch LocalStack with the configuration option `PERSISTENCE=1`. This setting instructs LocalStack to save all local Snowflake resources and their respective application states into the LocalStack Volume Directory. Upon restarting LocalStack, you'll be able to resume your activities exactly where you left off.
2424

25-
{{< tabpane >}}
26-
{{< tab header="LocalStack CLI" lang="bash" >}}
27-
LOCALSTACK_AUTH_TOKEN=... PERSISTENCE=1 IMAGE_NAME=localstack/snowflake localstack start
28-
{{< /tab >}}
29-
{{< tab header="Docker Compose" lang="yaml" >}}
25+
<Tabs>
26+
<TabItem label="LocalStack CLI">
27+
```bash
28+
LOCALSTACK_AUTH_TOKEN=... \
29+
PERSISTENCE=1 \
30+
IMAGE_NAME=localstack/snowflake \
31+
localstack start
32+
```
33+
</TabItem>
34+
<TabItem label="Docker Compose">
35+
```yaml
3036
...
3137
image: localstack/snowflake
3238
environment:
3339
- LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN:?}
3440
- PERSISTENCE=1
3541
volumes:
3642
- "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
37-
{{< /tab >}}
38-
{{< tab header="Docker" lang="bash" >}}
43+
```
44+
</TabItem>
45+
<TabItem label="Docker">
46+
```bash
3947
docker run \
4048
-e LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN:?} \
4149
-e PERSISTENCE=1 \
4250
-v ./volume:/var/lib/localstack \
4351
-p 4566:4566 \
4452
localstack/snowflake
45-
{{< /tab >}}
46-
{{< /tabpane >}}
53+
```
54+
</TabItem>
55+
</Tabs>
4756

48-
{{< alert title="Note">}}
57+
:::note
4958
Snapshots may not be compatible across different versions of LocalStack.
5059
It is possible that snapshots from older versions can be restored, but there are no guarantees as to whether LocalStack will start into a consistent state.
5160
We are actively working on a solution for this problem.
52-
{{< /alert >}}
61+
:::
5362

5463
## Export/Import State
5564

@@ -59,18 +68,18 @@ The Export/Import State feature enables you to export the state of your LocalSta
5968

6069
To export the state, you can run the following command:
6170

62-
{{< command >}}
63-
$ localstack state export '<file-name>'
64-
{{< /command >}}
71+
```bash
72+
localstack state export '<file-name>'
73+
```
6574

6675
You can use the `<file-name>` argument to specify a file path to export the state to. If you do not specify a file path, the state will be exported to the current working directory into a file named `ls-state-export`.
6776

6877
### Import the State
6978

7079
To import the state, you can run the following command:
7180

72-
{{< command >}}
73-
$ localstack state import '<file-name>'
74-
{{< /command >}}
81+
```bash
82+
localstack state import '<file-name>'
83+
```
7584

7685
The `<file-name>` argument is required and specifies the file path to import the state from. The file should be generated from a previous export.

0 commit comments

Comments
 (0)