Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions src/content/docs/snowflake/getting-started/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
121 changes: 0 additions & 121 deletions src/content/docs/snowflake/getting-started/index.md

This file was deleted.

177 changes: 177 additions & 0 deletions src/content/docs/snowflake/getting-started/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
---
title: Installation
description: Installation guide to get started with LocalStack for Snowflake.
template: doc
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.

## Installing the LocalStack CLI

The LocalStack CLI can be installed using Python, Brew (macOS), or Windows executables.


<Tabs>

<TabItem label="Python" value="python">

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 `<version>` with the required version from [release page](https://github.com/localstack/localstack/releases).

```bash
python3 -m pip install localstack==<version>
```
:::


:::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.
:::

</TabItem>

<TabItem label="macOS" value="macos">

You can install the LocalStack CLI using Homebrew:

```bash
brew install localstack/tap/localstack-cli
```

<details>
<summary>Alternative: Binary Download</summary>

Download the binary for your architecture:

<LinkButton href={`https://github.com/localstack/localstack-cli/releases/download/v${LOCALSTACK_VERSION}/localstack-cli-${LOCALSTACK_VERSION}-darwin-amd64-onefile.tar.gz`} icon="download" variant="minimal">Intel (AMD64)</LinkButton>

Then extract it:

<Code code={`sudo tar xvzf localstack-cli-${LOCALSTACK_VERSION}-darwin-*-onefile.tar.gz -C /usr/local/bin`} lang="bash" />

</details>

</TabItem>

<TabItem label="Windows" value="windows">

You can download the pre-built binary below:

<LinkButton href={`https://github.com/localstack/localstack-cli/releases/download/v${LOCALSTACK_VERSION}/localstack-cli-${LOCALSTACK_VERSION}-windows-amd64-onefile.zip`} icon="download" variant="minimal">Intel (AMD64)</LinkButton>

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).
:::

</TabItem>

</Tabs>


Need more options? See our [alternative installation instructions](https://docs.localstack.cloud/snowflake/getting-started/#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 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).
:::

### 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.
23 changes: 12 additions & 11 deletions src/content/docs/snowflake/getting-started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<your_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
Expand Down Expand Up @@ -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).
:::
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down