Documentation
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

CREATE SUNDECK TOKEN

Creates or replaces a Sundeck Token.

See also:
DROP SUNDECK TOKEN, SHOW SUNDECK TOKENS

Syntax

CREATE OR REPLACE SUNDECK TOKEN [IF NOT EXISTS] <token_name> PURPOSE = <token_type>

Parameters

<token_name>
specifies token name, which is Snowflake identifier. If the identifier contains spaces, special characters, or mixed-case characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive (e.g. “My Token”).
<token_type>
type of the Sundeck token. Two available types: NATIVE_APP or BROKER. Both values are case sensitive and should not be quoted.
Once the user retrieves token value, it will never be available for retrieval again. Only name, creation time and token type will be available.

Example:

kai#COMPUTE_WH@(no database).(no schema)>show sundeck tokens;
+------------------+--------------------------------------+------------+        
| TOKEN_NAME       | TOKEN_CREATED_AT                     | TOKEN_TYPE |
|------------------+--------------------------------------+------------|
| OPS_CENTER_TOKEN | 2023-12-02 04:48:26.672124 +0000 UTC | NATIVE_APP |
+------------------+--------------------------------------+------------+
1 Row(s) produced. 

kai#COMPUTE_WH@(no database).(no schema)>create sundeck token PRIVATE_BROKER_TOKEN purpose = BROKER;
+----------------------+-----------------------------------------+--------------------------------------------------------------------------------------+------------+
| TOKEN_NAME           | TOKEN_CREATED_AT                        | TOKEN_VALUE                                                                          | TOKEN_TYPE |
|----------------------+-----------------------------------------+--------------------------------------------------------------------------------------+------------|
| PRIVATE_BROKER_TOKEN | 2023-12-03 21:13:49.890611307 +0000 UTC | sndk_EcvwkSgFn448B0b9sLJlKzpneWJrOG92aDp5dWliNDh4Yw.dzRjdTcxMWpkMjp1cy13ZXN0LTI6ZGV2 | BROKER     |
+----------------------+-----------------------------------------+--------------------------------------------------------------------------------------+------------+
1 Row(s) produced. 

kai#COMPUTE_WH@(no database).(no schema)>show sundeck tokens;
+----------------------+--------------------------------------+------------+    
| TOKEN_NAME           | TOKEN_CREATED_AT                     | TOKEN_TYPE |
|----------------------+--------------------------------------+------------|
| OPS_CENTER_TOKEN     | 2023-12-02 04:48:26.672124 +0000 UTC | NATIVE_APP |
| PRIVATE_BROKER_TOKEN | 2023-12-03 21:13:49.890611 +0000 UTC | BROKER     |
+----------------------+--------------------------------------+------------+
2 Row(s) produced. 

kai#COMPUTE_WH@(no database).(no schema)>create sundeck token if not exists PRIVATE_BROKER_TOKEN  purpose = BROKER;
+----------------------+--------------------------------------+-------------+------------+
| TOKEN_NAME           | TOKEN_CREATED_AT                     | TOKEN_VALUE | TOKEN_TYPE |
|----------------------+--------------------------------------+-------------+------------|
| PRIVATE_BROKER_TOKEN | 2023-12-03 21:13:49.890611 +0000 UTC |             | BROKER     |
+----------------------+--------------------------------------+-------------+------------+
1 Row(s) produced.