|
| 1 | +--- |
| 2 | +title: Configuration |
| 3 | +description: Overview of configuration options in LocalStack for Snowflake. |
| 4 | +template: doc |
| 5 | +nav: |
| 6 | +label: |
| 7 | +--- |
| 8 | + |
| 9 | + |
| 10 | +{{< preview-notice >}} |
| 11 | + |
| 12 | +LocalStack exposes various configuration options to control its behaviour. |
| 13 | + |
| 14 | +These options can be passed to LocalStack as environment variables like so: |
| 15 | + |
| 16 | +{{< command >}} |
| 17 | +$ DEBUG=1 localstack start |
| 18 | +{{< / command >}} |
| 19 | + |
| 20 | +## Core |
| 21 | + |
| 22 | +Options that affect the core Snowflake emulator functionality. |
| 23 | + |
| 24 | +| Variable | Example Values | Description | |
| 25 | +|----------|----------------------|-------------------------------------------------------------------------------------------------------------| |
| 26 | +| `DEBUG` | `0` (default) \| `1` | Flag to increase log level and print more verbose logs (useful for troubleshooting issues) | |
| 27 | +| `SF_LOG` | `trace` | Specify the log level. Currently overrides the `DEBUG` configuration. `trace` for detailed request/response | |
| 28 | +| `SF_S3_ENDPOINT` | `s3.localhost.localstack.cloud:4566` (default) | Specify the S3 endpoint to use for the Snowflake emulator. | |
| 29 | +| `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. | |
| 30 | +| `SF_HOSTNAME_REGEX` | `snowflake\..+` (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`). | |
| 31 | +| `SF_CSV_IMPORT_MAX_ROWS` | `50000` (default) | Maximum number of rows to import from CSV files into tables | |
| 32 | +| `SF_DEFAULT_USER` | `test` (default) | Specify the default user to be used by the Snowflake emulator. | |
| 33 | +| `SF_DEFAULT_PASSWORD` | `test` (default) | Specify the default password to be used by the Snowflake emulator. | |
| 34 | + |
| 35 | +## CLI |
| 36 | + |
| 37 | +These options are applicable when using the CLI to start LocalStack. |
| 38 | + |
| 39 | +| Variable | Example Values | Description | |
| 40 | +| - | - | - | |
| 41 | +| `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" >}}) | |
| 43 | +| `CONFIG_DIR` | `~/.localstack` | The path where LocalStack can find configuration profiles and other CLI-specific configuration | |
| 44 | + |
| 45 | +## Docker |
| 46 | + |
| 47 | +Options to configure how LocalStack interacts with Docker. |
| 48 | + |
| 49 | +| Variable | Example Values | Description | |
| 50 | +| - | - | - | |
| 51 | +| `DOCKER_FLAGS` | | Allows to pass custom flags (e.g., volume mounts) to "docker run" when running LocalStack in Docker. | |
| 52 | +| `DOCKER_SOCK` | `/var/run/docker.sock` | Path to local Docker UNIX domain socket | |
| 53 | +| `DOCKER_BRIDGE_IP` | `172.17.0.1` | IP of the Docker bridge used to enable access between containers | |
| 54 | +| `LEGACY_DOCKER_CLIENT` | `0`\|`1` | Whether LocalStack should use the command-line Docker client and subprocess execution to run Docker commands, rather than the Docker SDK. | |
| 55 | +| `DOCKER_CMD` | `docker` (default), `sudo docker`| Shell command used to run Docker containers (only used in combination with `LEGACY_DOCKER_CLIENT`) | |
| 56 | +| `FORCE_NONINTERACTIVE` | | When running with Docker, disables the `--interactive` and `--tty` flags. Useful when running headless. | |
| 57 | + |
| 58 | +## Proxy Configuration |
| 59 | + |
| 60 | +Options to configure Snowflake proxy settings for LocalStack. |
| 61 | + |
| 62 | +| Variable | Example Values | Description | |
| 63 | +| - | - | - | |
| 64 | +| `SF_PROXY_HOST` | `proxy.example.com` | Hostname or IP address of the proxy server to be used for connecting to Snowflake. | |
| 65 | +| `SF_PROXY_USER` | `proxy_user` | Username for authentication with the proxy server. | |
| 66 | +| `SF_PROXY_PASSWORD` | `password123` | Password associated with the proxy user account. | |
| 67 | + |
| 68 | +## Profiles |
| 69 | + |
| 70 | +LocalStack supports configuration profiles which are stored in the `~/.localstack` config directory. |
| 71 | +A configuration profile is a set of environment variables stored in a `*.env` file in the LocalStack config directory. |
| 72 | + |
| 73 | +Here is an example of what configuration profiles might look like: |
| 74 | + |
| 75 | +{{< command >}} |
| 76 | +$ tree ~/.localstack |
| 77 | +/home/username/.localstack |
| 78 | +├── default.env |
| 79 | +├── dev.env |
| 80 | +└── pro.env |
| 81 | +{{< / command >}} |
| 82 | + |
| 83 | +Here is an example of what a specific environment profile looks like |
| 84 | + |
| 85 | +{{< command >}} |
| 86 | +$ cat ~/.localstack/pro-debug.env |
| 87 | +LOCALSTACK_AUTH_TOKEN=XXXXX |
| 88 | +SF_LOG=trace |
| 89 | +SF_S3_ENDPOINT=s3.localhost.localstack.cloud:4566 |
| 90 | +{{< / command >}} |
| 91 | + |
| 92 | +You can load a profile by either setting the environment variable `CONFIG_PROFILE=<profile>` or the `--profile=<profile>` CLI flag when using the CLI. |
| 93 | +Let's take an example to load the `dev.env` profile file if it exists: |
| 94 | + |
| 95 | +{{< command >}} |
| 96 | +$ IMAGE_NAME=localstack/snowflake localstack --profile=dev start |
| 97 | +{{< / command >}} |
| 98 | + |
| 99 | +If no profile is specified, the `default.env` profile will be loaded. |
| 100 | +If explicitly specified, any environment variables will overwrite the configurations defined in the profile. |
| 101 | + |
| 102 | +To display the config environment variables, you can use the following command: |
| 103 | + |
| 104 | +{{< command >}} |
| 105 | +$ localstack --profile=dev config show |
| 106 | +{{< / command >}} |
| 107 | + |
| 108 | +{{< alert title="Note" >}} |
| 109 | +The `CONFIG_PROFILE` is a CLI feature and cannot be used directly with a docker-compose setup. |
| 110 | +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. |
| 111 | +For Docker setups, we recommend passing the environment variables directly to the `docker run` command. |
| 112 | +{{< /alert >}} |
| 113 | + |
0 commit comments