Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

docs(syncs): refresh snowflake sync and app connection (#8282)

Adrian Kahali24e3011e13d7
diff --git a/docs/integrations/app-connections/snowflake.mdx b/docs/integrations/app-connections/snowflake.mdx
index 22a6a3868e..cc4019ad7d 100644
--- a/docs/integrations/app-connections/snowflake.mdx
+++ b/docs/integrations/app-connections/snowflake.mdx
@@ -1,207 +1,109 @@
---
title: "Snowflake connection"
sidebarTitle: "Snowflake"
-description: "Learn how to configure a Snowflake Connection for Infisical."
+description: "Learn how to configure a Snowflake connection for Infisical."
---
-Infisical supports connecting to Snowflake using a **Username** and a **Programmatic Access Token (PAT)**. PATs are scoped, revocable credentials that authenticate as a Snowflake user without exposing the user's password.
+import CreateUserAndToken from "/snippets/app-connections/snowflake/create-user-and-token.mdx";
+import ConnectionFormFields from "/snippets/app-connections/snowflake/form-fields.mdx";
-## Prerequisites
-
-- A [Snowflake account](https://app.snowflake.com/) with permission to create Programmatic Access Tokens.
-- The **account identifier** for your Snowflake instance, which combines your organization name and account name. You can find it in your Snowflake login URL (`https://app.snowflake.com/orgName/accountName/#/account/users`) or under **Account Details** in Snowsight.
-
-<Tip>
- Create a dedicated Snowflake user (or role) for Infisical rather than reusing a personal account. This keeps the connection's blast radius small and makes it easy to rotate or revoke access independently.
-</Tip>
+A Snowflake connection authenticates Infisical to your Snowflake account as a Snowflake user, with a [programmatic access token](https://docs.snowflake.com/en/user-guide/programmatic-access-tokens) that you generate for that user. Infisical can then sync secrets into a Snowflake schema and rotate the key pairs of Snowflake users.
-## Create a Snowflake programmatic access token
+<Note>
+ This guide only authenticates Infisical with Snowflake. Once the app connection is ready, you can [use it to set up integrations](#step-3-configure-integrations).
+</Note>
-<Steps>
- <Step title="Open Snowsight User Settings">
- In [Snowsight](https://app.snowflake.com/), open the side bar menu and select **Users & roles** under **Governance & Security**.
-
- ![Snowflake User Profile](/images/app-connections/snowflake/step-1.png)
- </Step>
+## Prerequisites
- <Step title="Create a new User">
- Click **Create user** in the top-right corner.
+- A [Snowflake account](https://app.snowflake.com/) where you can create users, roles, and network policies, such as with the `ACCOUNTADMIN` role
- ![Generate Programmatic Access Token](/images/app-connections/snowflake/step-2.png)
- </Step>
+## Step 1: Create a Snowflake user and programmatic access token
- <Step title="Create a network policy">
- Programmatic Access Tokens require an attached network policy that defines the IPs allowed to authenticate as this user. To create one, hover over **Projects**, click on **Workspaces**, and create a network policy. The snippet below creates one that allows access from any IP.
+Infisical needs a Snowflake user with a programmatic access token, a network policy, and a role with privileges for the integration you'll set up.
+<CreateUserAndToken />
- ![Go into workspace](/images/app-connections/snowflake/step-4-workspace.png)
+## Step 2: Create the app connection
+Next, create the app connection in Infisical.
- ```SQL
- CREATE NETWORK POLICY INFISICAL_SYNC_POLICY
- ALLOWED_IP_LIST = ('0.0.0.0/0')
- COMMENT = 'Allow access from any IP';
-
- ALTER USER INFISICAL set NETWORK_POLICY = 'INFISICAL_SYNC_POLICY';
- ```
+<View title="Organization-level">
+ <Steps>
+ <Step>
+ In the sidebar, select **Organization Settings**, then open the **App Connections** tab.
- <Warning>
- Be careful with the IPs you allow in your network policy. Using `0.0.0.0/0` allows access from **any IP address**, which can be dangerous in production. Prefer restricting the list to only the IP ranges that should be allowed to authenticate (for example, your corporate NAT(s) and/or Infisical's outbound IPs if you have them).
- </Warning>
- </Step>
+ ![App Connections Tab](/images/app-connections/general/add-connection.png)
+ </Step>
+ <Step>
+ Select **+ Add Connection** and choose **Snowflake Connection**.
- <Step title="Configure user details and role">
- Provide a **Username** and assign a role. Then grant the role the privileges required for how you intend to use the connection.
+ ![Select Snowflake Connection](/images/app-connections/snowflake/snowflake-app-connection-option.png)
+ </Step>
+ <Step>
+ Fill out the form's fields:
- ![Configure User](/images/app-connections/snowflake/step-3.png)
+ <ConnectionFormFields />
- To run the grant statements below, select the **Projects** tab and click on **Workspaces** to open the query editor.
+ Then, select **Connect to Snowflake**.
- ![Go into workspace](/images/app-connections/snowflake/step-4-workspace.png)
+ ![Snowflake Connection Form](/images/app-connections/snowflake/snowflake-app-connection-form.png)
+ </Step>
+ </Steps>
+</View>
- <Tabs>
- <Tab title="Secret Syncs">
- The role must have permission to create and manage secrets in the target database. The following snippet grants the minimum privileges required for operations on specific tables and schemas.
+<View title="Project-level">
+ <Steps>
+ <Step>
+ In your Secrets Manager project, select **Integrations** from the sidebar, then open the **App Connections** tab.
+ </Step>
+ <Step>
+ Select **Add Connection** and choose **Snowflake Connection**.
+ </Step>
+ <Step>
+ Fill out the form's fields:
- ```SQL
- -- Grant INFISICAL user access to SECRET_SYNC_TEST
- CREATE ROLE IF NOT EXISTS INFISICAL_ROLE;
- GRANT ROLE INFISICAL_ROLE TO USER INFISICAL; -- Change INFISICAL to be your user
+ <ConnectionFormFields />
- GRANT ALL PRIVILEGES ON DATABASE SECRET_SYNC_TEST TO ROLE INFISICAL_ROLE;
- GRANT ALL PRIVILEGES ON SCHEMA SECRET_SYNC_TEST.PUBLIC TO ROLE INFISICAL_ROLE;
- GRANT OWNERSHIP ON ALL SECRETS IN SCHEMA SECRET_SYNC_TEST.PUBLIC TO ROLE INFISICAL_ROLE REVOKE CURRENT GRANTS; -- Transfers ownership
- GRANT OWNERSHIP ON FUTURE SECRETS IN SCHEMA SECRET_SYNC_TEST.PUBLIC TO ROLE INFISICAL_ROLE REVOKE CURRENT GRANTS; -- Transfers ownership
- ```
+ Then, select **Connect to Snowflake**.
+ </Step>
+ </Steps>
+</View>
- <Note>
- If you select a custom role, note that **secret ownership is enforced per object**. Existing secrets in the target schema remain owned by their creator unless you transfer ownership. Infisical must use a role that **owns every secret it manages** (required for `CREATE OR REPLACE SECRET` and `DROP SECRET`). If the schema already has secrets, run the `GRANT OWNERSHIP ON ALL SECRETS ...` statement; always keep the `GRANT OWNERSHIP ON FUTURE SECRETS ...` statement.
- </Note>
- </Tab>
- <Tab title="Secret Rotations">
- For [Snowflake User Key Pair rotation](/documentation/platform/secret-rotation/snowflake-user-key-pair), the connection's role must be able to alter the target user whose key pair will be rotated. Grant a role that can manage the user and assign it to your connection user:
+When you submit the form, Infisical signs in to Snowflake with the account identifier, username, and token, and shows Snowflake's error if the sign-in fails.
- ```SQL
- -- create a role Infisical will use to manage the target user
- CREATE ROLE IF NOT EXISTS INFISICAL_ROTATION_ROLE;
+<Check>
+ Your Snowflake app connection is ready to use.
+</Check>
- -- allow the role to alter the target user's RSA public key
- GRANT OWNERSHIP ON USER MY_TARGET_USER TO ROLE INFISICAL_ROTATION_ROLE;
+<Accordion title="Create the connection with the API">
+ Send the account identifier, username, and programmatic access token to the create endpoint for Snowflake connections. The token goes in the `password` field.
- -- (optional) allow the role to create the target user if it does not exist yet
- GRANT CREATE USER ON ACCOUNT TO ROLE INFISICAL_ROTATION_ROLE;
-
- -- assign the role to the user backing your Snowflake Connection
- GRANT ROLE INFISICAL_ROTATION_ROLE TO USER MY_CONNECTION_USER;
- ```
-
- If the target user already exists, the connection's role only needs privileges to **alter** it (e.g. `OWNERSHIP` on the user). If the user does **not** exist yet, the role additionally requires the `CREATE USER` privilege on the account.
-
- <Tip>
- To learn more about managing users and privileges in Snowflake, see their [access control documentation](https://docs.snowflake.com/en/user-guide/security-access-control-overview).
- </Tip>
- </Tab>
- </Tabs>
- </Step>
-
-
- <Step title="Generate a Programmatic Access Token">
- Hover over **Governance & Security** and click on **Users & roles**. Select the user you want to use in Infisical. Open the **Programmatic access tokens** tab and click **Generate new token**. Give the token a descriptive name (e.g. `infisical`) and configure its expiration and role restrictions according to your security policy.
-
- ![Generate Programmatic Access Token](/images/app-connections/snowflake/step-5.png)
- ![Fill up PAT info](/images/app-connections/snowflake/step-6.png)
- </Step>
- <Step title="Copy the Token">
- Copy the generated token. Snowflake only displays it once — store it somewhere secure for the next step.
-
- ![Copy Programmatic Access Token](/images/app-connections/snowflake/step-7.png)
- </Step>
-
- <Step title="Copy the Snowflake Account">
- Copy the **Account identifier**. The fastest way is to read it from your Snowsight URL (`https://app.snowflake.com/orgName/accountName/#/account/users`), where the identifier is `orgName-accountName`.
-
- Alternatively, click your username in the bottom-left corner, open **Account details**, and copy the **Account** value from the **Config File** tab.
-
- ![Account details button](/images/app-connections/snowflake/account-info-left-corner.png)
- ![Account details](/images/app-connections/snowflake/account-details.png)
- ![Account info](/images/app-connections/snowflake/account-info.png)
- </Step>
-</Steps>
-
-
-## Create Snowflake connection in Infisical
-
-<Tabs>
- <Tab title="Infisical UI">
- <Steps>
- <Step title="Navigate to App Connections">
- In your Infisical dashboard, go to **Integrations** → **App Connections** in your organization.
-
- ![App Connections Tab](/images/app-connections/general/add-connection.png)
- </Step>
- <Step title="Select Snowflake Connection">
- Click **Add Connection** and choose **Snowflake** from the list of available connections.
-
- ![Select Snowflake Connection](/images/app-connections/snowflake/snowflake-app-connection-option.png)
- </Step>
- <Step title="Fill out Connection Form">
- Complete the form with:
- - A **name** for the connection (e.g. `snowflake-prod`)
- - An optional **description**
- - The Snowflake **Account** identifier (e.g. `orgName-accountName`)
- - The Snowflake **Username** (The name of the user that was created)
- - The **Programmatic Access Token** generated in the previous section
-
- ![Snowflake Connection Form](/images/app-connections/snowflake/snowflake-app-connection-form.png)
- </Step>
- <Step title="Connection Created">
- After clicking **Create**, Infisical validates the credentials by opening a connection to your Snowflake account. Once validated, your **Snowflake Connection** is ready to use.
-
- ![Snowflake Connection Created](/images/app-connections/snowflake/snowflake-app-connection-created.png)
- </Step>
- </Steps>
- </Tab>
- <Tab title="API">
- Create a Snowflake connection via the API.
-
- ### Sample request
-
- ```bash Request
- curl --request POST \
- --url https://app.infisical.com/api/v1/app-connections/snowflake \
- --header 'Content-Type: application/json' \
- --data '{
- "name": "my-snowflake-connection",
- "method": "username-and-token",
- "credentials": {
- "account": "xy12345.us-east-1",
- "username": "<YOUR-SNOWFLAKE-USERNAME>",
- "password": "<YOUR-PROGRAMMATIC-ACCESS-TOKEN>"
- }
- }'
- ```
-
- ### Sample response
-
- ```bash Response
- {
- "appConnection": {
- "id": "e5d18aca-86f7-4026-a95e-efb8aeb0d8e6",
- "name": "my-snowflake-connection",
- "description": null,
- "version": 1,
- "orgId": "6f03caa1-a5de-43ce-b127-95a145d3464c",
- "createdAt": "2025-04-23T19:46:34.831Z",
- "updatedAt": "2025-04-23T19:46:34.831Z",
- "isPlatformManagedCredentials": false,
- "app": "snowflake",
- "method": "username-and-token",
- "credentials": {
- "account": "xy12345.us-east-1",
- "username": "<YOUR-SNOWFLAKE-USERNAME>"
- }
- }
+ ```bash
+ curl --request POST \
+ --url https://app.infisical.com/api/v1/app-connections/snowflake \
+ --header 'Authorization: Bearer <access-token>' \
+ --header 'Content-Type: application/json' \
+ --data '{
+ "name": "my-snowflake-connection",
+ "method": "username-and-token",
+ "credentials": {
+ "account": "<org-name>-<account-name>",
+ "username": "<snowflake-username>",
+ "password": "<programmatic-access-token>"
}
- ```
- </Tab>
-</Tabs>
+ }'
+ ```
+</Accordion>
+
+## Step 3: Configure integrations
+
+Now that your Snowflake app connection is configured, you can use it to set up the following integrations:
+
+<CardGroup cols={2}>
+ <Card title="Snowflake secret sync" icon="refresh-cw" href="/integrations/secret-syncs/snowflake">
+ Sync secrets from Infisical to Snowflake secrets in a schema.
+ </Card>
+ <Card title="Snowflake user key pair rotation" icon="key" href="/documentation/platform/secret-rotation/snowflake-user-key-pair">
+ Rotate the RSA key pair of a Snowflake user.
+ </Card>
+</CardGroup>
diff --git a/docs/integrations/secret-syncs/snowflake.mdx b/docs/integrations/secret-syncs/snowflake.mdx
index b64dcaf4d8..8b43dae0a2 100644
--- a/docs/integrations/secret-syncs/snowflake.mdx
+++ b/docs/integrations/secret-syncs/snowflake.mdx
@@ -1,157 +1,144 @@
---
title: "Snowflake sync"
sidebarTitle: "Snowflake"
-description: "Learn how to configure a Snowflake Sync for Infisical."
+description: "Learn how to configure a Snowflake sync for Infisical."
---
-**Prerequisites:**
+import CreateUserAndToken from "/snippets/app-connections/snowflake/create-user-and-token.mdx";
+import ConnectionFormFields from "/snippets/app-connections/snowflake/form-fields.mdx";
-- Set up and add secrets to [Infisical Cloud](https://app.infisical.com)
-- Create a [Snowflake Connection](/integrations/app-connections/snowflake)
-- An existing Snowflake **database** and **schema** that secrets should be written to
-- The Snowflake user behind the connection must have the following privileges on the target schema: `USAGE` on the database, `USAGE` on the schema, and `CREATE SECRET` (plus `OWNERSHIP` on the synced secrets to support deletions)
-- Ensure your network security policies allow incoming requests from Infisical to your Snowflake account, if network restrictions apply
+A Snowflake Secret Sync pushes secrets from Infisical into a Snowflake schema, where your functions and procedures can reference them as [Snowflake secrets](https://docs.snowflake.com/en/sql-reference/sql/create-secret). Each Infisical secret becomes a `GENERIC_STRING` secret in the schema, with the same name unless you customize key names to add a prefix or suffix.
-<Info>
- Snowflake Sync writes Infisical secrets as native Snowflake secrets of type
- `GENERIC_STRING` (created via `CREATE OR REPLACE SECRET`).
-</Info>
+<Note>
+ The Snowflake Secret Sync requires a [Snowflake app connection](/integrations/app-connections/snowflake). This guide walks you through creating a project-scoped app connection.
+</Note>
-<Tabs>
- <Tab title="Infisical UI">
- 1. Navigate to **Project** > **Integrations** and select the **Secret Syncs** tab. Select the **Add Sync** button.
- ![Secret Syncs Tab](/images/secret-syncs/general/secret-sync-tab.png)
+## Prerequisites
- 2. Select the **Snowflake** option.
+- A [project with secrets configured](/documentation/platform/secrets-mgmt/quick-starts/deliver-first-secret)
+- A [Snowflake account](https://app.snowflake.com/) where you can create users, roles, and network policies, such as with the `ACCOUNTADMIN` role
+- A Snowflake [database](https://docs.snowflake.com/en/sql-reference/sql/create-database) and [schema](https://docs.snowflake.com/en/sql-reference/sql/create-schema) for the synced secrets
- ![Select Snowflake](/images/secret-syncs/snowflake/select-option.png)
+## Step 1: Create a Snowflake user and programmatic access token
- 3. Configure the **Source** from where secrets should be retrieved, then click **Next**.
+Infisical needs a Snowflake user with a programmatic access token, a network policy, and a role that can create and own secrets in the schema. When you grant privileges, use the statements in the **Secret syncs** tab.
- ![Configure Source](/images/secret-syncs/snowflake/sync-source.png)
+<CreateUserAndToken />
+## Step 2: Set up the sync in Infisical
- - **Environment**: The project environment to retrieve secrets from.
- - **Secret Path**: The folder path to retrieve secrets from.
+<Tip>
+ To create the sync using the API, use the [Create Snowflake Sync](/api-reference/endpoints/secret-syncs/snowflake/create) endpoint.
+</Tip>
+
+<Steps>
+ <Step>
+ In your project, go to **Integrations** and open the **Secret Syncs** tab. Select **+ Add Sync**.
+
+ ![Secret Syncs Tab](/images/secret-syncs/general/secret-sync-tab.png)
+
+ Then, select the **Snowflake** sync.
+
+ ![Select Snowflake](/images/secret-syncs/snowflake/select-option.png)
+ </Step>
+ <Step>
+ Under **Source**, choose which secrets to sync from Infisical:
+
+ - **Environment**: The project environment to retrieve secrets from
+ - **Secret Path**: The folder path to retrieve secrets from
+ - **Include secrets from all subfolders**: When enabled, also syncs secrets from every folder under the secret path (secret names must be unique across those folders)
<Tip>
- If you need to sync secrets from multiple folder locations, check out [secret imports](/documentation/platform/secret-reference#secret-imports).
+ If you need to sync secrets from multiple folder locations, use [secret imports](/documentation/platform/secret-reference#secret-imports).
</Tip>
- 4. Configure the **Destination** to where secrets should be deployed, then click **Next**.
+ ![Configure Source](/images/secret-syncs/snowflake/sync-source.png)
- ![Configure Destination](/images/secret-syncs/snowflake/sync-destination.png)
+ Then select **Continue**.
+ </Step>
+ <Step>
+ Under **Destination**, create or select the Snowflake app connection the sync will use, then choose where secrets go in Snowflake.
- - **Snowflake Connection**: The Snowflake Connection to authenticate with.
- - **Database**: The name of the Snowflake database to write secrets to. The database must already exist.
- - **Schema**: The name of the Snowflake schema (within the selected database) where secrets will be created. The schema must already exist.
+ <Tabs>
+ <Tab title="Create a new app connection">
+ Under **Snowflake Connection**, select **Create Connection** in the dropdown, then fill in:
- <Note>
- Infisical validates that the database and schema exist before creating any secrets. If either is missing or the connected Snowflake user lacks access, the sync fails with a descriptive error and no changes are written.
- </Note>
+ <ConnectionFormFields />
- <Note>
- Databases and schemas in the selectors are returned in lexicographic (A–Z) order by name. See [Snowflake's `SHOW DATABASES` reference](https://docs.snowflake.com/en/sql-reference/sql/show-databases) for details.
- </Note>
+ Select **Connect to Snowflake**. Infisical returns you to the sync form with the new connection selected.
+
+ <Note>
+ This creates a connection scoped to the current project. To share the connection across other projects, [create it at the organization level](/integrations/app-connections/snowflake#step-2-create-the-app-connection) first, then select it here.
+ </Note>
+ </Tab>
+ <Tab title="Use an existing connection">
+ Under **Snowflake Connection**, select the app connection you'd like to use.
+ </Tab>
+ </Tabs>
+
+ - **Database**: The Snowflake database that contains the schema
+ - **Schema**: The schema the sync writes secrets to
+
+ Before the sync writes any secrets, Infisical checks that the database and schema exist and that the connection's role can access them. If either check fails, the sync fails without writing anything.
+
+ ![Configure Destination](/images/secret-syncs/snowflake/sync-destination.png)
- 5. Configure the **Sync Options** to specify how secrets should be synced, then click **Next**.
- ![Configure Options](/images/secret-syncs/snowflake/sync-options.png)
+ Then select **Continue**.
+ </Step>
+ <Step>
+ Under **Initial Sync Behavior**, select **Overwrite Snowflake**, then select **Continue**.
- - **Initial Sync Behavior**: Determines how Infisical should resolve the initial sync.
- - **Overwrite Destination Secrets**: Removes any secrets at the destination endpoint not present in Infisical.
- <Note>
- Snowflake does not support importing secrets.
- </Note>
- - **Key Schema**: Template that determines how secret names are transformed when syncing, using `{{secretKey}}` as a placeholder for the original secret name and `{{environment}}` for the environment.
<Note>
- We highly recommend using a Key Schema to ensure that Infisical only manages the specific keys you intend, keeping everything else in the schema untouched.
+ Snowflake doesn't return a secret's value after the secret is created, so this sync can't import existing Snowflake secrets into Infisical. **Overwrite Snowflake** is the only option.
</Note>
- - **Auto-Sync Enabled**: If enabled, secrets will automatically be synced from the source location when changes occur. Disable to enforce manual syncing only.
- - **Disable Secret Deletion**: If enabled, Infisical will not remove secrets from the sync destination. Enable this option if you intend to manage some secrets manually outside of Infisical.
-
- 6. Configure the **Details** of your Snowflake Sync, then click **Next**.
-
- ![Configure Details](/images/secret-syncs/snowflake/sync-details.png)
-
- - **Name**: The name of your sync. Must be slug-friendly.
- - **Description**: An optional description for your sync.
-
- 7. Review your Snowflake Sync configuration, then click **Create Sync**.
-
- 8. If enabled, your Snowflake Sync will begin syncing your secrets to the destination schema.
- ![Sync Created](/images/secret-syncs/snowflake/sync-created.png)
-
- </Tab>
- <Tab title="API">
- To create a **Snowflake Sync**, make an API request to the [Create Snowflake Sync](/api-reference/endpoints/secret-syncs/snowflake/create) API endpoint.
-
- ### Sample request
-
- ```bash Request
- curl --request POST \
- --url https://app.infisical.com/api/v1/secret-syncs/snowflake \
- --header 'Content-Type: application/json' \
- --data '{
- "name": "my-snowflake-sync",
- "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
- "description": "sync to snowflake schema",
- "connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
- "environment": "dev",
- "secretPath": "/",
- "isAutoSyncEnabled": true,
- "syncOptions": {
- "initialSyncBehavior": "overwrite-destination",
- "disableSecretDeletion": false
- },
- "destinationConfig": {
- "database": "MY_DATABASE",
- "schema": "MY_SCHEMA"
- }
- }'
- ```
-
- ### Sample response
-
- ```bash Response
- {
- "secretSync": {
- "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
- "name": "my-snowflake-sync",
- "description": "sync to snowflake schema",
- "folderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
- "connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
- "createdAt": "2026-04-29T12:00:00Z",
- "updatedAt": "2026-04-29T12:00:00Z",
- "syncStatus": "succeeded",
- "lastSyncJobId": "job-1234",
- "lastSyncMessage": null,
- "lastSyncedAt": "2026-04-29T12:00:00Z",
- "syncOptions": {
- "initialSyncBehavior": "overwrite-destination",
- "disableSecretDeletion": false
- },
- "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
- "connection": {
- "app": "snowflake",
- "name": "my-snowflake-connection",
- "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
- },
- "environment": {
- "slug": "dev",
- "name": "Development",
- "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
- },
- "folder": {
- "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
- "path": "/"
- },
- "destination": "snowflake",
- "destinationConfig": {
- "database": "MY_DATABASE",
- "schema": "MY_SCHEMA"
- }
- }
- }
- ```
- </Tab>
-</Tabs>
+ </Step>
+ <Step>
+ Under **Sync Options**, choose how secrets are synced:
+
+ - **Prevent secret deletion**: When enabled, Infisical adds and updates secrets in Snowflake but never deletes them; enable this if you manage some Snowflake secrets outside of Infisical
+ - **Auto-sync on changes**: When enabled, secrets sync to Snowflake automatically as the source changes; turn it off to sync manually only
+ - **Customize key names**: Adds a prefix or suffix to every synced name, using `{{secretKey}}` for the original name and `{{environment}}` for the environment slug
+
+ <Warning>
+ A Snowflake schema can hold secrets that other tools created, so a sync can change secrets that were created outside Infisical. If you don't customize key names, the sync treats every secret in the schema that its role owns as one it manages:
+
+ - If a Snowflake secret has the same name as an Infisical secret, the sync overwrites the Snowflake secret's value
+ - If **Prevent secret deletion** is off, every Snowflake secret that isn't in Infisical is deleted
+
+ With customized key names, the sync writes only names with your prefix or suffix, and deletes only Snowflake secrets whose names match it.
+
+ Before the first sync, customize key names or keep **Prevent secret deletion** on. **Prevent secret deletion** is on by default when you create the sync in the UI, but off unless you set `disableSecretDeletion` when you create it through the API.
+ </Warning>
+
+ ![Configure Sync Options](/images/secret-syncs/snowflake/sync-options.png)
+
+ Then select **Continue**.
+ </Step>
+ <Step>
+ Give the sync a **Name** and an optional **Description**. The name must be slug-friendly.
+
+ ![Sync Details](/images/secret-syncs/snowflake/sync-details.png)
+
+ Then select **Continue**.
+ </Step>
+ <Step>
+ Review your Snowflake Sync configuration, then select **Create Sync**.
+
+ ![Review and Create](/images/secret-syncs/snowflake/sync-created.png)
+
+ <Check>
+ The sync is created. If **Auto-sync on changes** is enabled, it begins syncing secrets to the schema right away.
+ </Check>
+ </Step>
+</Steps>
+
+## Next steps
+
+<CardGroup cols={2}>
+ <Card title="Secret syncs overview" icon="refresh-cw" href="/integrations/secret-syncs/overview">
+ Learn how syncs run, how key schemas work, and how to sync subfolders.
+ </Card>
+ <Card title="Snowflake user key pair rotation" icon="key" href="/documentation/platform/secret-rotation/snowflake-user-key-pair">
+ Rotate the RSA key pair of a Snowflake user with the same app connection.
+ </Card>
+</CardGroup>
diff --git a/docs/snippets/app-connections/snowflake/create-user-and-token.mdx b/docs/snippets/app-connections/snowflake/create-user-and-token.mdx
new file mode 100644
index 0000000000..fc4479ead5
--- /dev/null
+++ b/docs/snippets/app-connections/snowflake/create-user-and-token.mdx
@@ -0,0 +1,102 @@
+<Steps>
+ <Step>
+ In [Snowsight](https://app.snowflake.com/), open the sidebar and select **Users & roles** under **Governance & Security**.
+
+ ![Users and roles](/images/app-connections/snowflake/step-1.png)
+ </Step>
+ <Step>
+ Select **Create user**, then enter a **Username** for the user Infisical will authenticate as.
+
+ ![Create user](/images/app-connections/snowflake/step-2.png)
+ ![Configure user](/images/app-connections/snowflake/step-3.png)
+ </Step>
+ <Step>
+ If a user authenticates with a programmatic access token, Snowflake requires the user to have a network policy. Attach one to the user:
+
+ To run SQL in Snowflake, select **Projects**, then **Workspaces**, to open the query editor.
+
+ ![Workspaces](/images/app-connections/snowflake/step-4-workspace.png)
+
+ The following statements create a network policy and attach it to a user named `INFISICAL`. Replace `INFISICAL` with the username you entered.
+
+ ```SQL
+ CREATE NETWORK POLICY INFISICAL_SYNC_POLICY
+ ALLOWED_IP_LIST = ('0.0.0.0/0')
+ COMMENT = 'Allow access from any IP';
+
+ ALTER USER INFISICAL SET NETWORK_POLICY = 'INFISICAL_SYNC_POLICY';
+ ```
+
+ <Warning>
+ `0.0.0.0/0` lets the user authenticate from any IP address. In production, replace it with the IP addresses Infisical connects from.
+ </Warning>
+ </Step>
+ <Step>
+ Create a role for the user, grant the role the privileges for the integration you'll set up, and make it the user's default role, using the same query editor.
+
+ <Note>
+ Infisical doesn't choose a role when it signs in, so Snowflake runs every Infisical operation under the user's default role. If you skip the `ALTER USER` statement, the default role stays `PUBLIC`, and syncs and rotations fail even though the grants exist.
+ </Note>
+
+ A connection signs in with one role. If you want one connection for both a [sync](/integrations/secret-syncs/snowflake) and a [rotation](/documentation/platform/secret-rotation/snowflake-user-key-pair), grant both sets of privileges to the same role and make that role the user's default.
+
+ <Tabs>
+ <Tab title="Secret syncs">
+ The role needs access to the database and schema the sync writes to, and ownership of every secret in that schema that the sync manages. The following statements grant those privileges on the `PUBLIC` schema of a database named `SECRET_SYNC_TEST`:
+
+ ```SQL
+ CREATE ROLE IF NOT EXISTS INFISICAL_ROLE;
+ GRANT ROLE INFISICAL_ROLE TO USER INFISICAL;
+
+ GRANT ALL PRIVILEGES ON DATABASE SECRET_SYNC_TEST TO ROLE INFISICAL_ROLE;
+ GRANT ALL PRIVILEGES ON SCHEMA SECRET_SYNC_TEST.PUBLIC TO ROLE INFISICAL_ROLE;
+ GRANT OWNERSHIP ON ALL SECRETS IN SCHEMA SECRET_SYNC_TEST.PUBLIC TO ROLE INFISICAL_ROLE REVOKE CURRENT GRANTS;
+ GRANT OWNERSHIP ON FUTURE SECRETS IN SCHEMA SECRET_SYNC_TEST.PUBLIC TO ROLE INFISICAL_ROLE REVOKE CURRENT GRANTS;
+
+ ALTER USER INFISICAL SET DEFAULT_ROLE = INFISICAL_ROLE;
+ ```
+
+ <Note>
+ Snowflake only lets the role that owns a secret replace or drop it. If a secret already exists in the schema, it stays owned by the role that created it, so the sync fails on that secret until you transfer ownership with the `GRANT OWNERSHIP ON ALL SECRETS` statement. The `GRANT OWNERSHIP ON FUTURE SECRETS` statement covers secrets created later.
+ </Note>
+ </Tab>
+ <Tab title="Secret rotations">
+ For [Snowflake user key pair rotation](/documentation/platform/secret-rotation/snowflake-user-key-pair), the role needs to be able to change the key pair of the user you're rotating. The following statements grant that to a role, assign the role to the `INFISICAL` user, and make it the user's default role:
+
+ ```SQL
+ CREATE ROLE IF NOT EXISTS INFISICAL_ROTATION_ROLE;
+
+ GRANT OWNERSHIP ON USER MY_TARGET_USER TO ROLE INFISICAL_ROTATION_ROLE;
+
+ -- Only needed if Infisical should create the target user
+ GRANT CREATE USER ON ACCOUNT TO ROLE INFISICAL_ROTATION_ROLE;
+
+ GRANT ROLE INFISICAL_ROTATION_ROLE TO USER INFISICAL;
+ ALTER USER INFISICAL SET DEFAULT_ROLE = INFISICAL_ROTATION_ROLE;
+ ```
+
+ If the target user already exists, `OWNERSHIP` on that user is enough. If you want Infisical to create the target user, the role also needs `CREATE USER` on the account. For more about roles and privileges, see Snowflake's [access control documentation](https://docs.snowflake.com/en/user-guide/security-access-control-overview).
+ </Tab>
+ </Tabs>
+ </Step>
+ <Step>
+ Go back to **Governance & Security** > **Users & roles** and select the user. Open the **Programmatic access tokens** tab and select **Generate new token**. Give the token a name, such as `infisical`, restrict it to the role you made the user's default, and set its expiration to match your security policy.
+
+ ![Programmatic access tokens tab](/images/app-connections/snowflake/step-5.png)
+ ![Generate new token](/images/app-connections/snowflake/step-6.png)
+ </Step>
+ <Step>
+ Copy the token. Snowflake shows the token only once, so save it for the Infisical form.
+
+ ![Copy the token](/images/app-connections/snowflake/step-7.png)
+ </Step>
+ <Step>
+ Copy your account identifier, which has the form `orgName-accountName`. You can read both parts from your Snowsight URL: `https://app.snowflake.com/orgName/accountName/`.
+
+ You can also select your username in the bottom-left corner, open **Account details**, and copy the **Account** value from the **Config File** tab.
+
+ ![Account details menu](/images/app-connections/snowflake/account-info-left-corner.png)
+ ![Account details](/images/app-connections/snowflake/account-details.png)
+ ![Account identifier](/images/app-connections/snowflake/account-info.png)
+ </Step>
+</Steps>
diff --git a/docs/snippets/app-connections/snowflake/form-fields.mdx b/docs/snippets/app-connections/snowflake/form-fields.mdx
new file mode 100644
index 0000000000..55bed97330
--- /dev/null
+++ b/docs/snippets/app-connections/snowflake/form-fields.mdx
@@ -0,0 +1,5 @@
+- **Name**: A descriptive name for the connection
+- **Description** (optional): A note for future reference
+- **Account**: Your Snowflake [account identifier](#step-1-create-a-snowflake-user-and-programmatic-access-token), such as `orgName-accountName`
+- **Username**: The Snowflake user you created for Infisical
+- **Programmatic Access Token**: The token you generated for that user