CREATE SECURITY INTEGRATION (External secret provider)¶
Creates an API authentication security integration that uses workload identity federation to access AWS Secrets Manager, Azure Key Vault, or Google Cloud Secret Manager.
For other external API authentication methods, see CREATE SECURITY INTEGRATION (External API Authentication).
- See also:
CREATE SECURITY INTEGRATION , CREATE SECURITY INTEGRATION (External API Authentication) , ALTER SECURITY INTEGRATION (External secret provider) , SYSTEM$VERIFY_EXTERNAL_SECRET_INTEGRATION , SYSTEM$LIST_EXTERNAL_SECRETS , SYSTEM$FETCH_EXTERNAL_SECRET_FROM_INTEGRATION , SYSTEM$GET_SECURITY_INTEGRATIONS_FOR_API_PROVIDER , DESCRIBE INTEGRATION , DROP INTEGRATION , SHOW INTEGRATIONS
Syntax¶
Required parameters¶
nameSpecifies the identifier for the integration. The identifier must be unique in your account.
For more information, see Identifier requirements.
TYPE = API_AUTHENTICATIONSpecifies that the integration authenticates Snowflake to an external API.
AUTH_TYPE = WORKLOAD_IDENTITY_FEDERATIONSpecifies that Snowflake authenticates with workload identity federation. Snowflake issues a short-lived token for the integration and exchanges it with the cloud provider.
API_PROVIDER = { AWS_SECRETS_MANAGER | AZURE_KEY_VAULT | GCP_SECRET_MANAGER }Specifies the external secret provider. The selected provider determines which additional parameters are required:
Provider Required parameters AWS_SECRETS_MANAGERAWS_ROLE_ARN,AWS_REGIONAZURE_KEY_VAULTAZURE_TENANT_ID,AZURE_AD_APPLICATION_ID,AZURE_KEY_VAULT_URIGCP_SECRET_MANAGERGCP_SECRET_MANAGER_PROJECT,GCP_WIF_PROVIDER,GCP_SERVICE_ACCOUNT_EMAILYou can’t change
API_PROVIDERafter creating the integration.ENABLED = { TRUE | FALSE }Specifies whether the integration can be used:
TRUEallows roles withUSAGEon the integration to call the external secret provider functions.FALSEprevents the integration from being used.
Optional parameters¶
COMMENT = 'string_literal'Specifies a comment for the integration.
Default: No value
Provider parameters¶
Specify only the parameters for the selected API_PROVIDER.
AWS Secrets Manager¶
AWS_ROLE_ARN = 'aws_role_arn'Specifies the ARN of the AWS IAM role that Snowflake assumes with workload identity federation.
AWS_REGION = 'aws_region'Specifies the AWS region used for AWS Security Token Service (STS) and Secrets Manager calls. Snowflake derives the token audience from this region’s AWS partition.
Azure Key Vault¶
AZURE_TENANT_ID = 'azure_tenant_id'Specifies the Microsoft Entra tenant ID.
AZURE_AD_APPLICATION_ID = 'azure_application_id'Specifies the application (client) ID of the Entra application configured with the federated identity credential.
AZURE_KEY_VAULT_URI = 'azure_key_vault_uri'Specifies the HTTPS URI of the key vault, such as
https://my-vault.vault.azure.net.
Google Cloud Secret Manager¶
GCP_SECRET_MANAGER_PROJECT = 'gcp_project'Specifies the Google Cloud project ID that contains the secrets.
GCP_WIF_PROVIDER = 'gcp_workload_identity_provider'Specifies the workload identity provider resource path without the
//iam.googleapis.com/prefix. Use this form:Snowflake adds the prefix when deriving the token audience.
GCP_SERVICE_ACCOUNT_EMAIL = 'gcp_service_account_email'Specifies the Google service account that Snowflake impersonates before calling Secret Manager.
Access control requirements¶
A role used to execute this operation must have the following privileges at a minimum:
| Privilege | Object | Notes |
|---|---|---|
| CREATE INTEGRATION | Account | Only the ACCOUNTADMIN role has this privilege by default. The privilege can be granted to additional roles as needed. |
| CREATE SECURITY INTEGRATION | Account | Available to Native Apps. Grants the ability to create external security integrations of type API_AUTHENTICATION. This privilege doesn’t grant the ability to create other security integration types. |
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¶
-
You can’t specify
OR REPLACEandIF NOT EXISTSin the same statement. -
Regarding metadata:
Attention
Customers should ensure that no personal data (other than for a User object), sensitive data, export-controlled data, or other regulated data is entered as metadata when using the Snowflake service. For more information, see Metadata fields in Snowflake.
-
CREATE OR REPLACE <object> statements are atomic. That is, when an object is replaced, the old object is deleted and the new object is created in a single transaction.
-
Before creating the integration, prepare the cloud resource identifiers required for the selected provider. For the complete setup sequence, see External secret providers.
-
After creating the integration, run
DESCRIBE SECURITY INTEGRATIONto getWORKLOAD_IDENTITY_FEDERATION_ISSUERandWORKLOAD_IDENTITY_FEDERATION_SUBJECT. Use those values to configure cloud trust. -
Replacing an integration generates a new subject. If the cloud trust configuration uses the old subject, provider authentication fails. Use ALTER SECURITY INTEGRATION (External secret provider) to change provider settings without changing the subject.
Examples¶
Create an integration for AWS Secrets Manager:
Create an integration for Azure Key Vault:
Create an integration for Google Cloud Secret Manager: