- Categories:
System functions (System Information)
SYSTEM$FETCH_ EXTERNAL_ SECRET_ FROM_ INTEGRATION¶
Fetches one secret value through an external secret provider security integration.
Syntax¶
Arguments¶
integration_nameName of an external secret provider security integration with
TYPE = API_AUTHENTICATIONandAUTH_TYPE = WORKLOAD_IDENTITY_FEDERATION.secret_identifierProvider-specific identifier for exactly one secret:
Provider Required identifier AWS Secrets Manager Full secret ARN, without a version or stage qualifier appended Azure Key Vault Secret name returned by SYSTEM$LIST_EXTERNAL_SECRETSGoogle Cloud Secret Manager Secret ID returned by SYSTEM$LIST_EXTERNAL_SECRETS
Returns¶
Returns a provider-specific JSON object that contains the secret value and metadata. Every provider response includes
name, value, and version_id. AWS responses include arn; Azure and Google Cloud responses include id.
Example response from AWS Secrets Manager:
Access control requirements¶
A role used to execute this operation must have the following privileges at a minimum:
| Privilege | Object | Notes |
|---|---|---|
| USAGE | Integration | Required on the specified integration. |
The USAGE privilege authorizes the current role to use the integration, including through role inheritance. The
cloud permissions granted to the integration’s federated identity determine which operations the integration can
perform and which secrets it can access.
For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.
For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.
Usage notes¶
- Queries that call this function don’t appear in query history. Snowflake purges the persisted query result after approximately five minutes.
- The active query result contains the secret in plaintext. Don’t log, persist, or expose the result to unauthorized users.
- AWS binary secrets aren’t supported.
- For Google Cloud Secret Manager, the function returns the latest secret version. You can’t request an earlier version.
Examples¶
Fetch an AWS Secrets Manager secret:
Extract the value field from an Azure Key Vault response: