Skip to main content

LocalStack Extension: Snowflake

Project description

LocalStack - A fully functional local cloud stack

PyPI Version Docker Pulls PyPi downloads Code style: black Twitter

LocalStack is a cloud software development framework to develop and test your Snowflake data pipelines locally.

OverviewInstallQuickstartBase Image TagsReleasesSupportLicense
📖 Docs☑️ Function coverage


Overview

LocalStack is a cloud service emulator that runs in a single container on your laptop or in your CI environment. LocalStack Snowflake emulator replicates the functionality of the real Snowflake platform, allowing you to perform operations without an internet connection or a Snowflake account. This is valuable for developing and testing Snowflake data pipelines entirely on the local machine (and in CI pipelines), enabling quick feedback cycles, and not incurring costs of using the real system.

LocalStack Snowflake emulator supports the following features:

Install

You can use the Snowflake Docker image to run the LocalStack Snowflake emulator. The Snowflake Docker image is available on the LocalStack Docker Hub. To pull the Snowflake Docker image, execute the following command:

docker pull localstack/snowflake

You can start the Snowflake Docker container using the following methods:

  1. localstack CLI
  2. docker CLI
  3. Docker Compose

Note: Before starting, ensure you have a valid LOCALSTACK_AUTH_TOKEN to access the LocalStack Snowflake emulator. Refer to the Auth Token guide 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:

export LOCALSTACK_AUTH_TOKEN=<your-auth-token>
IMAGE_NAME=localstack/snowflake localstack start

docker CLI

To start the Snowflake Docker container using the docker CLI, execute the following command:

docker run \
    --rm -it \
    -p 4566:4566 \
    -e LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN:?} \
    localstack/snowflake

Docker Compose

Create a docker-compose.yml file with the specified content:

version: "3.8"

services:
  localstack:
    container_name: "localstack-main"
    image: localstack/snowflake
    ports:
      - "127.0.0.1:4566:4566"
    environment:
      - LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN:?}
    volumes:
      - "./volume:/var/lib/localstack"

Start the Snowflake Docker container with the following command:

docker-compose up

Quickstart

After starting the Snowflake Docker container, you can use the Snowflake Python Connector to interact with the LocalStack Snowflake emulator. The following example demonstrates how to create a Snowflake table using the Snowflake Python Connector:

connection = snowflake.connector.connect(
    user="test",
    password="test",
    account="test",
    database="test",
    host="snowflake.localhost.localstack.cloud",
)
connection.cursor().execute("CREATE TABLE table1(col1 INT)")

Check out our documentation for more examples and guides.

Base Image Tags

We currently push the latest tag as our default tag. This tag is fully tested using our extensive integration test suite. This tag should be used if you want to stay up-to-date with the latest changes.

Releases

Please refer to our changelog page to see the complete list of changes for each release.

Support

Get in touch with the LocalStack Team to report issues & request new features, on the following channels:

License

(c) 2024 LocalStack

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

localstack-extension-snowflake-0.1.24.tar.gz (49.6 kB view details)

Uploaded Source

File details

Details for the file localstack-extension-snowflake-0.1.24.tar.gz.

File metadata

File hashes

Hashes for localstack-extension-snowflake-0.1.24.tar.gz
Algorithm Hash digest
SHA256 9e2fbf41408184c1bd87714e45c03a9623af2ae32fe87bbef5832fbe15e406e2
MD5 9d3a5ad82e99afdc71dd00c14fd1b8ce
BLAKE2b-256 021468dd1ae7223d55a035f6a86c187c8b56e7e33a7dd9b51dc842ff3190fff3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page