Secrets
Introduction
Section titled “Introduction”Secrets in Snowflake provide a secure way to store sensitive credentials, such as usernames and passwords, for use with external integrations. They allow you to centralize authentication information and manage access consistently across your Snowflake environment.
The Snowflake emulator offers CRUD support, which are currently mocked and not functional. This makes it possible to test workloads locally that rely on secure credential management without needing a live Snowflake account.
Getting started
Section titled “Getting started”This guide is designed for users new to Secrets and assumes basic knowledge of SQL and Snowflake. Start your Snowflake emulator and connect to it using an SQL client in order to execute the queries below.
In this guide, you will:
- Create a secret.
- Show and describe existing secrets.
- Alter a secret.
- Drop a secret.
Create a Secret
Section titled “Create a Secret”You can create a secret using the CREATE SECRET
statement.
The following example creates a password-based secret:
CREATE SECRET my_secret TYPE = PASSWORD USERNAME = 'myuser' PASSWORD = 'mypassword123';
Show Secrets
Section titled “Show Secrets”You can list all secrets in the account using the SHOW SECRETS
command:
SHOW SECRETS;
Describe Secret
Section titled “Describe Secret”You can view the details of a specific secret using the DESCRIBE SECRET
command:
DESCRIBE SECRET my_secret;
Alter Secret
Section titled “Alter Secret”You can update the properties of an existing secret with the ALTER SECRET
command.
For example, changing the password:
ALTER SECRET my_secret SET PASSWORD = 'newpassword456';
Drop Secret
Section titled “Drop Secret”You can remove a secret using the DROP SECRET
statement:
DROP SECRET IF EXISTS my_secret;