Configuration

Overview of configuration options in LocalStack for Snowflake

LocalStack exposes various configuration options to control its behaviour.

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

$ DEBUG=1 localstack start

Core

Options that affect the core Snowflake emulator functionality.

VariableExample ValuesDescription
DEBUG0 (default) | 1Flag to increase log level and print more verbose logs (useful for troubleshooting issues)
SF_LOGtraceSpecify the log level. Currently overrides the DEBUG configuration. trace for detailed request/response
SF_S3_ENDPOINTs3.localhost.localstack.cloud:4566 (default)Specify the S3 endpoint to use for the Snowflake emulator.
DNS_NAME_PATTERNS_TO_RESOLVE_UPSTREAM*.s3.amazonaws.com (example)List of domain names that should NOT be resolved to the LocalStack container, but instead always forwarded to the upstream resolver (S3 for example). this would be required when importing data into a stage from an external S3 bucket on the real AWS cloud. Comma-separated list of Python-flavored regex patterns.
SF_HOSTNAME_REGEXsnowflake\..+ (default)Allows you to customize the hostname used for matching the Snowflake API routes in the HTTP router. If not set, then it matches on any hostnames that contain a snowflake.* subdomain (e.g., snowflake.localhost.localstack.cloud).
SF_CSV_IMPORT_MAX_ROWS50000 (default)Maximum number of rows to import from CSV files into tables

CLI

These options are applicable when using the CLI to start LocalStack.

VariableExample ValuesDescription
LOCALSTACK_VOLUME_DIR~/.cache/localstack/volume (on Linux)The location on the host of the LocalStack volume directory mount.
CONFIG_PROFILEThe configuration profile to load. See Profiles
CONFIG_DIR~/.localstackThe path where LocalStack can find configuration profiles and other CLI-specific configuration

Docker

Options to configure how LocalStack interacts with Docker.

VariableExample ValuesDescription
DOCKER_FLAGSAllows to pass custom flags (e.g., volume mounts) to “docker run” when running LocalStack in Docker.
DOCKER_SOCK/var/run/docker.sockPath to local Docker UNIX domain socket
DOCKER_BRIDGE_IP172.17.0.1IP of the Docker bridge used to enable access between containers
LEGACY_DOCKER_CLIENT0|1Whether LocalStack should use the command-line Docker client and subprocess execution to run Docker commands, rather than the Docker SDK.
DOCKER_CMDdocker (default), sudo dockerShell command used to run Docker containers (only used in combination with LEGACY_DOCKER_CLIENT)
FORCE_NONINTERACTIVEWhen running with Docker, disables the --interactive and --tty flags. Useful when running headless.

Proxy Configuration

Options to configure Snowflake proxy settings for LocalStack.

VariableExample ValuesDescription
SF_PROXY_HOSTproxy.example.comHostname or IP address of the proxy server to be used for connecting to Snowflake.
SF_PROXY_USERproxy_userUsername for authentication with the proxy server.
SF_PROXY_PASSWORDpassword123Password associated with the proxy user account.

Profiles

LocalStack supports configuration profiles which are stored in the ~/.localstack config directory. A configuration profile is a set of environment variables stored in a *.env file in the LocalStack config directory.

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

$ tree ~/.localstack
/home/username/.localstack
├── default.env
├── dev.env
└── pro.env

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

$ cat ~/.localstack/pro-debug.env
LOCALSTACK_AUTH_TOKEN=XXXXX
SF_LOG=trace
SF_S3_ENDPOINT=s3.localhost.localstack.cloud:4566

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

$ IMAGE_NAME=localstack/snowflake localstack --profile=dev start

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

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

$ localstack --profile=dev config show