From 5acddbc8db931adb45378e0c8a7dda5e2c13394a Mon Sep 17 00:00:00 2001 From: Quetzalli Writes Date: Fri, 26 Sep 2025 18:53:37 +0200 Subject: [PATCH 1/5] draft 1: getting started snow v2 + quickstart updates --- .../docs/snowflake/getting-started/faq.md | 26 ++- .../docs/snowflake/getting-started/index.md | 121 ------------ .../docs/snowflake/getting-started/index.mdx | 174 ++++++++++++++++++ .../snowflake/getting-started/quickstart.md | 23 +-- 4 files changed, 210 insertions(+), 134 deletions(-) delete mode 100644 src/content/docs/snowflake/getting-started/index.md create mode 100644 src/content/docs/snowflake/getting-started/index.mdx diff --git a/src/content/docs/snowflake/getting-started/faq.md b/src/content/docs/snowflake/getting-started/faq.md index b8300f9d..99e28c54 100644 --- a/src/content/docs/snowflake/getting-started/faq.md +++ b/src/content/docs/snowflake/getting-started/faq.md @@ -30,9 +30,31 @@ If you are using the LocalStack for Snowflake in your CI pipelines consistently, A CI key allows you to use LocalStack in your CI environment. Every activation of a CI key consumes one CI credit. This means that with every build triggered through the LocalStack container you will consume one credit. To use more credits, you can [contact us](https://localstack.cloud/contact) to discuss your requirements. +### How do I enable detailed debug logs? + +You can set the `SF_LOG=trace` environment variable in the Snowflake container to enable detailed trace logs that show all the request/response message. + +When using `docker-compose` then simply add this variable to the `environment` section of the YAML configuration file. +If you're starting up via the `localstack start` CLI, then make sure to start up via the following configuration: + +```bash +DOCKER_FLAGS='-e SF_LOG=trace' DEBUG=1 localstack start --stack snowflake +``` + +### The `snowflake.localhost.localstack.cloud` hostname doesn't resolve on my machine, what can I do? + +On some systems, including some newer versions of MacOS, the domain name `snowflake.localhost.localstack.cloud` may not resolve properly. +If you are encountering network issues and your Snowflake client drivers are unable to connect to the emulator, you may need to manually add the following entry to your `/etc/hosts` file: + +```bash +127.0.0.1 snowflake.localhost.localstack.cloud +``` + ## Support FAQs -### How can I get help with the LocalStack for Snowflake? +### How can I get help with LocalStack for Snowflake? + +LocalStack for Snowflake is now GA. To get help, you can join the [Slack community](https://localstack.cloud/slack) and share your feedback, questions, and suggestions with the LocalStack team on the `#help` channel. -LocalStack for Snowflake is now GA. To get help, you can join the [Slack community](https://localstack.cloud/slack) and share your feedback, questions, and suggestions with the LocalStack team on the `#help` channel. If your team is using LocalStack for Snowflake, you can also request support by [contacting us](https://localstack.cloud/contact) or +If your team is using LocalStack for Snowflake, you can also request support by [contacting us](https://localstack.cloud/contact) or [opening a GitHub issue with the Snowflake tag](https://github.com/localstack/localstack/issues/new?assignees=&labels=type%3A+bug%2Cstatus%3A+triage+needed%2CSnowflake%3A+general&template=bug-report.yml&title=bug%3A+%3Ctitle%3E). diff --git a/src/content/docs/snowflake/getting-started/index.md b/src/content/docs/snowflake/getting-started/index.md deleted file mode 100644 index 2e11ebd0..00000000 --- a/src/content/docs/snowflake/getting-started/index.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Installation -description: Basic installation guide to get started with LocalStack for Snowflake. -template: doc -sidebar: - order: 0 ---- - -## Introduction - -You can use the Snowflake Docker image to run the Snowflake emulator. -The Snowflake Docker image is available on the [LocalStack Docker Hub](https://hub.docker.com/r/localstack/snowflake). -To pull the Snowflake Docker image, execute the following command: - -```bash -docker pull localstack/snowflake -``` - -You can start the Snowflake Docker container using the following methods: - -1. [`localstack` CLI](/snowflake/getting-started/#localstack-cli) -2. [`docker` CLI](https://docs.docker.com/get-docker/) -2. [Docker Compose](https://docs.docker.com/compose/install/) - -:::note -Before starting, ensure you have a valid `LOCALSTACK_AUTH_TOKEN` to access the Snowflake emulator. Refer to the [Auth Token guide](https://docs.localstack.cloud/getting-started/auth-token/) to obtain your Auth Token and specify it in the `LOCALSTACK_AUTH_TOKEN` environment variable. -::: - -### `localstack` CLI - -To start the Snowflake Docker container using the `localstack` CLI, execute the following command: - -```bash -export LOCALSTACK_AUTH_TOKEN= -localstack start --stack snowflake -``` - -### `docker` CLI - -To start the Snowflake Docker container using the `docker` CLI, execute the following command: - -```bash showLineNumbers -docker run \ - --rm -it \ - -p 127.0.0.1:4566:4566 \ - -p 127.0.0.1:4510-4559:4510-4559 \ - -p 127.0.0.1:443:443 \ - -e LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN:?} \ - localstack/snowflake -``` - -### Docker Compose - -Create a `docker-compose.yml` file with the specified content: - -```yaml showLineNumbers -version: "3.8" - -services: - localstack: - container_name: "localstack-snowflake" - image: localstack/snowflake - ports: - - "127.0.0.1:4566:4566" - - "127.0.0.1:4510-4559:4510-4559" - - "127.0.0.1:443:443" - environment: - - LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN:?} - volumes: - - "./volume:/var/lib/localstack" -``` - -Start the Snowflake Docker container with the following command: - -```bash -docker-compose up -``` - -## Updating - -To update the Snowflake Docker container, pull the latest image and restart the container. The `latest` tag is the nightly build of the Snowflake Docker image. - -## Troubleshooting - -### How to check if the Snowflake emulator is running? - -You can check if the Snowflake emulator is running by executing the following command: - -```bash -curl -d '{}' snowflake.localhost.localstack.cloud:4566/session -``` - -The response should be: - -```bash -{"success": true} -``` - -### How to enable detailed debug logs? - -You can set the `SF_LOG=trace` environment variable in the Snowflake container to enable detailed trace logs that show all the request/response message. - -When using `docker-compose` then simply add this variable to the `environment` section of the YAML configuration file. -If you're starting up via the `localstack start` CLI, then make sure to start up via the following configuration: - -```bash -DOCKER_FLAGS='-e SF_LOG=trace' DEBUG=1 localstack start --stack snowflake -``` - -### The `snowflake.localhost.localstack.cloud` hostname doesn't resolve on my machine, what can I do? - -On some systems, including some newer versions of MacOS, the domain name `snowflake.localhost.localstack.cloud` may not resolve properly. -If you are encountering network issues and your Snowflake client drivers are unable to connect to the emulator, you may need to manually add the following entry to your `/etc/hosts` file: - -```bash -127.0.0.1 snowflake.localhost.localstack.cloud -``` - -## Next steps - -Now that the Snowflake emulator is installed, you can use it for developing and testing your Snowflake data pipelines. Refer to our [Quickstart](/snowflake/getting-started/quickstart/) guide to get started. diff --git a/src/content/docs/snowflake/getting-started/index.mdx b/src/content/docs/snowflake/getting-started/index.mdx new file mode 100644 index 00000000..55ab6d7e --- /dev/null +++ b/src/content/docs/snowflake/getting-started/index.mdx @@ -0,0 +1,174 @@ +--- +title: Installation +description: Installation guide to get started with LocalStack for Snowflake. +template: doc +sidebar: + order: 0 +--- + +## LocalStack CLI for Snowflake + +The easiest way to get started with LocalStack for Snowflake is by using the LocalStack CLI. It automatically pulls the correct Docker image, manages the container, and supports additional features like image updates and debugging. + +## Installing the LocalStack CLI + +The LocalStack CLI can be installed using Python, Brew (macOS), or Windows executables. + + + + + + +If you prefer to install LocalStack via Python (recommended for most Snowflake users), follow the steps below. + +Please ensure the following are installed: + +- [Python](https://docs.python.org/3/using/index.html) (versions 3.7 to 3.11) +- [pip](https://pip.pypa.io/en/stable/installation/) + +Then install the LocalStack CLI: + +```bash +python3 -m pip install --upgrade localstack +```` + +:::note +To download a specific version of LocalStack, replace `` with the required version from [release page](https://github.com/localstack/localstack/releases). + +```bash +python3 -m pip install localstack== +``` +::: + + +:::tip[MacOS Sierra?] +If you have problems with permissions in MacOS X Sierra, install with: + +```bash +python3 -m pip install --user localstack +``` +::: + +:::danger +Do not use `sudo` or the `root` user when starting LocalStack. +It should be installed and started entirely under a local non-root user. +::: + + + + + +You can install the LocalStack CLI using Homebrew: + +```bash +brew install localstack/tap/localstack-cli +``` + +
+Alternative: Binary Download + +Download the binary for your architecture: + +Intel (AMD64) + +Then extract it: + + + +
+ +
+ + + +You can download the pre-built binary below: + +Intel (AMD64) + +Then extract the archive and run the binary in PowerShell. + +:::note +You can download and install the Windows executable from our [GitHub Releases](https://github.com/localstack/localstack-cli/releases). +::: + + + +
+ + +Need more options? See our [alternative installation instructions](https://docs.localstack.cloud/aws/getting-started/installation/#alternatives). + +## Starting the Snowflake Emulator + +Once the CLI is installed and your auth token is set, start the Snowflake Emulator with: + +```bash +localstack start --stack snowflake +``` + +This will pull and run the correct Docker image automatically. + +:::note +You may also start the LocalStack container using [Docker Compose](https://docs.localstack.cloud/snowflake/getting-started/#alternatives). +::: + +### Check if the emulator is running + +Run the following command: + +```bash +curl -d '{}' snowflake.localhost.localstack.cloud:4566/session +``` + +Expected response: + +```json +{"success": true} +``` + + +## Updating LocalStack + +To keep both the CLI and emulator images up to date, run: + +```bash +localstack update all +``` + +If you only want to update the Snowflake image manually (e.g. to pick up a recent fix), you can run: + +```bash +docker pull localstack/snowflake:latest +``` + + +## Alternatives + +If you prefer Docker Compose, you can start the emulator using the configuration below: + +```yaml showLineNumbers +version: "3.8" + +services: + localstack: + container_name: "localstack-snowflake" + image: localstack/snowflake + ports: + - "127.0.0.1:4566:4566" + - "127.0.0.1:4510-4559:4510-4559" + - "127.0.0.1:443:443" + environment: + - LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN:?} + volumes: + - "./volume:/var/lib/localstack" +``` + +Start the container with: + +```bash +docker-compose up +``` + +## Next steps + +Now that the Snowflake emulator is installed, you can use it for developing and testing your Snowflake data pipelines. Refer to our [Quickstart](/snowflake/getting-started/quickstart/) guide to get started. diff --git a/src/content/docs/snowflake/getting-started/quickstart.md b/src/content/docs/snowflake/getting-started/quickstart.md index 0d174c77..89f4f7f3 100644 --- a/src/content/docs/snowflake/getting-started/quickstart.md +++ b/src/content/docs/snowflake/getting-started/quickstart.md @@ -18,25 +18,19 @@ This guide explains how to set up the Snowflake emulator and use Snowflake CLI t LocalStack for Snowflake works with popular Snowflake integrations to run your SQL queries. This guide uses the [Snowflake CLI](/snowflake/integrations/snow-cli/), but you can also use [SnowSQL](/snowflake/integrations/snow-sql/), [DBeaver](/snowflake/integrations/dbeaver/) or the [LocalStack Web Application](/snowflake/tooling/user-interface/) for this purpose. +:::note +Each integration link includes the connection instructions needed to work with the emulator. Please be sure to follow those setup steps before running queries. +::: + ## Instructions -Before you begin, pull the Snowflake emulator image (`localstack/snowflake`) and start the container: +Before you begin, first start the LocalStack for Snowflake emulator: ```bash export LOCALSTACK_AUTH_TOKEN= localstack start --stack snowflake ``` -Check the emulator's availability by running: - -```bash -curl -d '{}' snowflake.localhost.localstack.cloud:4566/session -``` - -```bash title="Output" -{"success": true} -``` - In this quickstart, we'll create a student records database that demonstrates how to: - Create databases, schemas, and tables @@ -248,3 +242,10 @@ You can now explore the following resources to learn more about the Snowflake em - [Features](/snowflake/features/): Learn about the Snowflake emulator's features and how to use them. - [Capabilities](/snowflake/capabilities/): Find information about the Snowflake emulator's capabilities and how to use them. + +:::note +### How can I get help with the LocalStack for Snowflake? + +LocalStack for Snowflake is now GA. To get help, you can join the [Slack community](https://localstack.cloud/slack) and share your feedback, questions, and suggestions with the LocalStack team on the `#help` channel. If your team is using LocalStack for Snowflake, you can also request support by [contacting us](https://localstack.cloud/contact) or +[opening a GitHub issue with the Snowflake tag](https://github.com/localstack/localstack/issues/new?assignees=&labels=type%3A+bug%2Cstatus%3A+triage+needed%2CSnowflake%3A+general&template=bug-report.yml&title=bug%3A+%3Ctitle%3E). +::: \ No newline at end of file From e9deb276e83856dd50612f88d875f9c1b8700ddb Mon Sep 17 00:00:00 2001 From: Quetzalli Writes Date: Fri, 26 Sep 2025 19:01:27 +0200 Subject: [PATCH 2/5] added astro code components imports --- src/content/docs/snowflake/getting-started/index.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/content/docs/snowflake/getting-started/index.mdx b/src/content/docs/snowflake/getting-started/index.mdx index 55ab6d7e..5f5a2452 100644 --- a/src/content/docs/snowflake/getting-started/index.mdx +++ b/src/content/docs/snowflake/getting-started/index.mdx @@ -6,6 +6,9 @@ sidebar: order: 0 --- +import { Code, LinkButton, Tabs, TabItem } from '@astrojs/starlight/components'; +import { LOCALSTACK_VERSION } from "astro:env/server"; + ## LocalStack CLI for Snowflake The easiest way to get started with LocalStack for Snowflake is by using the LocalStack CLI. It automatically pulls the correct Docker image, manages the container, and supports additional features like image updates and debugging. From 35811d5b82cc4822c33043c92cacaa598bfd4a91 Mon Sep 17 00:00:00 2001 From: Quetzalli Writes Date: Fri, 26 Sep 2025 19:06:45 +0200 Subject: [PATCH 3/5] updated broken links --- .../docs/snowflake/tutorials/aws-lambda-localstack-snowpark.md | 2 +- .../tutorials/credit-scoring-with-localstack-snowpark.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/snowflake/tutorials/aws-lambda-localstack-snowpark.md b/src/content/docs/snowflake/tutorials/aws-lambda-localstack-snowpark.md index d1277e4d..8c83970a 100644 --- a/src/content/docs/snowflake/tutorials/aws-lambda-localstack-snowpark.md +++ b/src/content/docs/snowflake/tutorials/aws-lambda-localstack-snowpark.md @@ -19,7 +19,7 @@ The code in this tutorial is available on [GitHub](https://github.com/localstack ## Prerequisites -- [`localstack` CLI](/snowflake/getting-started/#localstack-cli) with a [`LOCALSTACK_AUTH_TOKEN`](/aws/getting-started/auth-token/) +- [`localstack` CLI](/snowflake/getting-started/) with a [`LOCALSTACK_AUTH_TOKEN`](/aws/getting-started/auth-token/) - [LocalStack for Snowflake](/snowflake/getting-started/) - [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) & [`awslocal` wrapper](/aws/integrations/aws-native-tools/aws-cli/#localstack-aws-cli-awslocal) - Python 3.10 installed locally diff --git a/src/content/docs/snowflake/tutorials/credit-scoring-with-localstack-snowpark.md b/src/content/docs/snowflake/tutorials/credit-scoring-with-localstack-snowpark.md index 797c8e94..a53a4843 100644 --- a/src/content/docs/snowflake/tutorials/credit-scoring-with-localstack-snowpark.md +++ b/src/content/docs/snowflake/tutorials/credit-scoring-with-localstack-snowpark.md @@ -14,7 +14,7 @@ The Jupyter Notebook and the dataset used in this tutorial are available on [Git ## Prerequisites -- [`localstack` CLI](/snowflake/getting-started/#localstack-cli) with a [`LOCALSTACK_AUTH_TOKEN`](/aws/getting-started/auth-token/) +- [`localstack` CLI](/snowflake/getting-started/) with a [`LOCALSTACK_AUTH_TOKEN`](/aws/getting-started/auth-token/) - [LocalStack for Snowflake](/snowflake/getting-started/) - [Snowpark](/snowflake/integrations/snowpark) with other Python libraries - [Jupyter Notebook](https://jupyter.org/install#jupyter-notebook) From de2dfab5fd28d87e1c029b317e62a4042044657c Mon Sep 17 00:00:00 2001 From: Quetzalli Date: Mon, 29 Sep 2025 01:46:16 -0700 Subject: [PATCH 4/5] Apply suggestions from code review Co-authored-by: Przemek Denkiewicz <67517453+hovaesco@users.noreply.github.com> --- src/content/docs/snowflake/getting-started/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/snowflake/getting-started/index.mdx b/src/content/docs/snowflake/getting-started/index.mdx index 5f5a2452..9f92ad4b 100644 --- a/src/content/docs/snowflake/getting-started/index.mdx +++ b/src/content/docs/snowflake/getting-started/index.mdx @@ -109,7 +109,7 @@ Once the CLI is installed and your auth token is set, start the Snowflake Emulat localstack start --stack snowflake ``` -This will pull and run the correct Docker image automatically. +This will pull the LocalStack for Snowfalke image and run the Docker image automatically. :::note You may also start the LocalStack container using [Docker Compose](https://docs.localstack.cloud/snowflake/getting-started/#alternatives). From 50392ea062c56af1f4d6e56da9bba39944e1e2b2 Mon Sep 17 00:00:00 2001 From: Quetzalli Date: Mon, 29 Sep 2025 04:01:05 -0700 Subject: [PATCH 5/5] fix alternative install options link --- src/content/docs/snowflake/getting-started/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/snowflake/getting-started/index.mdx b/src/content/docs/snowflake/getting-started/index.mdx index 9f92ad4b..6ef9e3af 100644 --- a/src/content/docs/snowflake/getting-started/index.mdx +++ b/src/content/docs/snowflake/getting-started/index.mdx @@ -99,7 +99,7 @@ You can download and install the Windows executable from our [GitHub Releases](h -Need more options? See our [alternative installation instructions](https://docs.localstack.cloud/aws/getting-started/installation/#alternatives). +Need more options? See our [alternative installation instructions](https://docs.localstack.cloud/snowflake/getting-started/#alternatives). ## Starting the Snowflake Emulator