When creating an environment for a Snowflake data warehouse, you can choose to use key-pair authentication. To use this authentication method, the Snowflake private key must be stored as a secret, as described in this document.Documentation Index
Fetch the complete documentation index at: https://docs.maia.ai/llms.txt
Use this file to discover all available pages before exploring further.
This page covers Snowflake key-pair authentication for environment-level connections only. The plaintext storage guidance on this page does not apply to component-level usage. Components such as Database Query, JDBC Table Metadata to Grid, and Bash Pushdown store private keys as key/value JSON secrets with escaped newlines (
\n) instead. Refer to the individual component documentation for those patterns.Prerequisites
Generate a private and public key in Snowflake and configure your Snowflake user, following the procedure given in the Snowflake documentation.Video example
Storing the private key
If you are running in a Hybrid SaaS deployment model, you must store the private key as a secret within your own infrastructure, in either an AWS Secrets Manager or an Azure Key Vault. Follow the procedure in the appropriate section below. If you are running in a Full SaaS deployment model, you must copy the private key into the Private key field when you create your Environment. Copy the full content of the Snowflake private key file you generated, including the header and footer lines. In a Full SaaS deployment model, your encrypted private key, including the header and footer, should look like this:--- END ENCRYPTED PRIVATE KEY --- to avoid connection or JSON Web Token (JWT) errors.
An unencrypted private key, including the header and footer, should look like this:
--- END PRIVATE KEY --- to avoid connection or JSON Web Token (JWT) errors.
If your private key has been shared, the format may have been altered. To correct this, run the following command to validate and convert the key to the correct format:
AWS Secrets Manager
- Log in to the AWS account that houses your .
- Browse to the Secrets Manager service.
- Ensure you’re in the same AWS region as your .
- Click Store a new secret.
- Click Other type of secret.
- Click the Plaintext tab.
- Copy the full content, including header and footer, of the Snowflake private key file you generated.
- The private key must be stored as a plaintext secret.
- You must add a new AWS secret for every private key you want to use.
- Ensure that the has permissions to use the new secret by giving the ‘s IAM task role permissions to use the new secret. Read AWS IAM roles for details.
