Skip to content

Commit 2acfe03

Browse files
docs: CRUD support for Secrets in Snow (#201)
1 parent 401f1e0 commit 2acfe03

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: Secrets
3+
description: Get started with Secrets in LocalStack for Snowflake
4+
tags: ["Base"]
5+
---
6+
7+
## Introduction
8+
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.
9+
10+
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.
11+
12+
## Getting started
13+
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.
14+
15+
In this guide, you will:
16+
17+
1. Create a secret.
18+
2. Show and describe existing secrets.
19+
3. Alter a secret.
20+
4. Drop a secret.
21+
22+
### Create a Secret
23+
You can create a secret using the `CREATE SECRET` statement.
24+
25+
The following example creates a password-based secret:
26+
27+
```sql
28+
CREATE SECRET my_secret
29+
TYPE = PASSWORD
30+
USERNAME = 'myuser'
31+
PASSWORD = 'mypassword123';
32+
```
33+
34+
### Show Secrets
35+
36+
You can list all secrets in the account using the `SHOW SECRETS` command:
37+
38+
```sql
39+
SHOW SECRETS;
40+
```
41+
42+
### Describe Secret
43+
44+
You can view the details of a specific secret using the `DESCRIBE SECRET` command:
45+
46+
```sql
47+
DESCRIBE SECRET my_secret;
48+
```
49+
50+
### Alter Secret
51+
52+
You can update the properties of an existing secret with the `ALTER SECRET` command.
53+
54+
For example, changing the password:
55+
56+
```sql
57+
ALTER SECRET my_secret SET PASSWORD = 'newpassword456';
58+
```
59+
60+
### Drop Secret
61+
62+
You can remove a secret using the `DROP SECRET` statement:
63+
64+
```sql
65+
DROP SECRET IF EXISTS my_secret;
66+
```
67+

0 commit comments

Comments
 (0)