Snowflake tasks run SQL against Snowflake from your workflow. Authentication uses Snowflake key-pair authentication. For background on generating keys, assigning the public key to a Snowflake user, and rotation, see Snowflake’s Key-pair authentication and key-pair rotation guide. Install the workflow SDK with the Snowflake extra:Documentation Index
Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt
Use this file to discover all available pages before exploring further.
Configure the Snowflake private key
The private key must be available in two places: task pods and the Flyte agent.Task pods
Create a TrueFoundry secret with group nameprivate-key and key snowflake, and store your Snowflake RSA private key (PEM) as that secret’s value. See Manage secrets for how to create secrets in TrueFoundry.
Reference the secret in task mounts using its FQN, for example:
tfy-secret://truefoundry:private-key:snowflake
Mount it on any @task that uses Snowflake StructuredDataset URIs (see the example below).
Flyte agent
For the Flyte agent, create and use a TrueFoundry secret for the Snowflake private key, then wire that secret into the Flyte agent secret via kustomize. Set Flyte agent values:SnowflakeTaskConfig
Snowflake user name (the user whose RSA public key is registered in Snowflake).
Snowflake account identifier (for example the value in your account URL).
Default Snowflake database for the task.
Default Snowflake schema for the task.
Snowflake warehouse to use for the session.
SnowflakeTask
Define a Snowflake task with a SQL query template and task config.Example
This workflow runs a select, prints the result, inserts a row, writes a small table via a Python task using a SnowflakeStructuredDataset URI, and runs another select.
Checklist
- Configure key-pair authentication in Snowflake and store the private key securely; see Snowflake key-pair authentication.
- Create a TrueFoundry secret with group
private-keyand keysnowflake, and mount it using an FQN such astfy-secret://truefoundry:private-key:snowflake(see Manage secrets). - Enable
flyteagent, setagentSecret.secretData.secretData: {}in values, and providesnowflake_private_key: tfy-secret://internal:private-key:snowflakevia a kustomizeSecretnamedflyteagent. - Install
truefoundry[workflow,snowflake]and useSnowflakeTask+SnowflakeTaskConfigfor SQL; mount the private key on Python tasks that use SnowflakeStructuredDatasetURIs.