Skip to content

Commit 1710cd4

Browse files
committed
DOC-337: Clarify custom Snowflake hostnames
Explain the separate routing, DNS, and TLS requirements so custom hostname configurations work as expected.
1 parent 9ea97ab commit 1710cd4

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

src/content/docs/snowflake/capabilities/configuration.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,35 @@ Options that affect the core Snowflake emulator functionality.
3535
### Custom Snowflake hostnames
3636

3737
By default, the Snowflake emulator accepts requests for hostnames such as `snowflake.localhost.localstack.cloud` and other `*.snowflake.*` hostnames.
38-
If you expose the emulator through a custom DNS name, for example in Kubernetes or behind an ingress, set `SF_HOSTNAMES` to the exact hostnames clients use to reach the emulator:
38+
If you expose the emulator through a custom DNS name, for example in Kubernetes or behind an ingress, set `SF_HOSTNAMES` to the exact hostnames clients use to reach the emulator.
39+
When you use the `localstack` CLI, add the `LOCALSTACK_` prefix so the CLI passes the variable to the container:
3940

4041
```bash
41-
SF_HOSTNAMES=snowflake.internal.example.com,snowflake.internal \
42+
LOCALSTACK_SF_HOSTNAMES=snowflake.internal.example.com,snowflake.internal,snowflake.localhost.localstack.cloud \
4243
localstack start --stack snowflake
4344
```
4445

4546
The first hostname in `SF_HOSTNAMES` is used as the primary hostname for local connection defaults and generated URLs.
4647
When `SF_HOSTNAMES` is set, the default wildcard fallback is disabled, and only the configured hostnames are routed to the Snowflake emulator.
48+
Include `snowflake.localhost.localstack.cloud` in the list, as shown above, if you want the default hostname to continue working.
49+
50+
`SF_HOSTNAMES` controls Host-header routing only.
51+
It does not configure DNS or TLS for custom hostnames.
52+
Configure each hostname to resolve to the LocalStack host from every client that connects to the emulator.
53+
For example, add the following entries to the client's `/etc/hosts` file when LocalStack runs on the same machine:
54+
55+
```text title="/etc/hosts"
56+
127.0.0.1 snowflake.internal.example.com
57+
127.0.0.1 snowflake.internal
58+
```
59+
60+
The default LocalStack certificate does not match custom domains.
61+
Configure a matching custom TLS certificate before connecting through a custom hostname.
62+
63+
::::caution
64+
Do not use `insecure_mode=True` in the Snowflake Connector for Python to work around a certificate hostname mismatch.
65+
This deprecated option disables certificate revocation checks, but the connector still verifies the certificate and hostname.
66+
::::
4767

4868
::::note
4969
`SF_HOSTNAME_REGEX` is no longer supported.
@@ -53,7 +73,7 @@ If you previously used `SF_HOSTNAME_REGEX`, migrate to `SF_HOSTNAMES` and list e
5373
If your custom hostname also needs a matching TLS certificate, use LocalStack's standard certificate configuration options:
5474

5575
```bash
56-
SF_HOSTNAMES=snowflake.internal.example.com \
76+
LOCALSTACK_SF_HOSTNAMES=snowflake.internal.example.com \
5777
CUSTOM_SSL_CERT_PATH=/var/lib/localstack/custom/cert.pem \
5878
SKIP_SSL_CERT_DOWNLOAD=1 \
5979
localstack start --stack snowflake

0 commit comments

Comments
 (0)