CREATE SECRET

Syntax

CREATE SECRET [IF NOT EXISTS] secret_name WITH (secret_parameter = value [, ...]);

Description

Creates a new Secret within the Organization.

Arguments

secret_name

Name of the Secret to define. For case-sensitive names, the name must be wrapped in double quotes, otherwise, the lowercased name will be used.

WITH (secret_parameter = value [, …​ ])

This clause specifies Secret parameters; see Secret Parameters for more information.

Secret Parameters

Parameter NameDescription

type

Required. Specifies the Secret type.

Type: SECRET_TYPE

Valid values: GENERIC_SECRET

access_region

Required, unless specified in properties.file. Specifies the region that the secret is available in. Valid values: See LIST REGIONS

description

Optional. A description for the secret Type: String

### GENERIC_SECRET Specific Parameters

Parameters to be used if type is GENERIC_SECRET:

Parameter NameDescription

secret_string

The string to store in the secret. The string may function as either an API token or a sensitive value string, to be utilized within the handler code of a User-Defined Function (UDF). Required: Yes Default value: None Type: String

Examples

Create a GENERIC_SECRET

The following creates a new Secret name my_secret:

db.public/sfstore# CREATE SECRET IF NOT EXISTS
    my_secret  
WITH ( 
    'type' = GENERIC_STRING, 
    'access_region' = "AWS us-east-1", 
    'secret_string' = 'SGVsbG8gRGVsdGFzU3RyZWFtIQo=', 
    'description' = 'This is a generic_string secret'
);
+------------+------------+------------+------------------------------------------+
|  Type      |  Name      |  Command   |  Summary                                 |
+============+============+============+==========================================+
| secret     | my_secret  | CREATE     | secret "my_secret" was successfully      |
|            |            |            | created                                  |
+------------+------------+------------+------------------------------------------+

Last updated