External network access and private connectivity on AWS¶
You can configure Snowflake for outbound private connectivity to an AWS external service by way of external network access.
Unlike public connectivity, with private connectivity you must do the following operations:
Create a private connectivity endpoint. This step requires the ACCOUNTADMIN role.
Create the network rule so the
TYPEproperty is set toPRIVATE_HOST_PORT.
Outbound private connectivity costs¶
You pay for each private connectivity endpoint along with total data processed. For pricing of these items, see the Snowflake Service Consumption Table.
You can explore the cost of these items by filtering on the following service types when querying billing views in the ACCOUNT_USAGE and ORGANIZATION_USAGE schemas:
OUTBOUND_PRIVATELINK_ENDPOINT
OUTBOUND_PRIVATELINK_DATA_PROCESSED
For example, you can query the USAGE_IN_CURRENCY_DAILY view and filter on these service types.
Set up private connectivity to an external Amazon S3 service¶
Call the SYSTEM$PROVISION_PRIVATELINK_ENDPOINT system function to specify Snowflake is connecting to an AWS S3 service, and the hostname to use when connecting to the service:
Note
The asterisk in
*.s3.us-west-2.amazonaws.comspecifies that you can use the endpoint to access multiple S3 buckets.Execute the following SQL statement to create a network rule that allows Snowflake to send requests to an external destination, being sure to set the
TYPEproperty toPRIVATE_HOST_PORT:Execute the following SQL statement to create a security integration for external API authentication:
Execute the following SQL statement to get the
STORAGE_AWS_IAM_USER_ARNandSTORAGE_AWS_EXTERNAL_IDvalues for the IAM user:Using the
STORAGE_AWS_IAM_USER_ARNandSTORAGE_AWS_EXTERNAL_IDvalues, follow Step 5 in Option 1: Configure a Snowflake storage integration to access Amazon S3 to grant the IAM user access to the Amazon S3 service.Execute the following SQL statement to create a token to use for authentication with the AWS S3 service:
Execute the following SQL statement to create an external access integration that uses the network rule and token created in previous steps:
Execute one of the following SQL statements to create a function that can use the external access integration and the token that were previously created:
Execute one of the following SQL statements to run the function you created:
Set up private connectivity to an external Amazon Bedrock service¶
Call the SYSTEM$PROVISION_PRIVATELINK_ENDPOINT system function to specify that Snowflake is connecting to the AWS S3 and Amazon Bedrock services, and the hostnames to use when connecting to the services:
Execute the following SQL statement to create a network rule that allows Snowflake to send requests to an external destination, being sure to set the
TYPEproperty toPRIVATE_HOST_PORT:Execute the following SQL statement to create a security integration for external API authentication:
Execute the following SQL statement to get the
STORAGE_AWS_IAM_USER_ARNandSTORAGE_AWS_EXTERNAL_IDvalues for the IAM user:Using the
STORAGE_AWS_IAM_USER_ARNandSTORAGE_AWS_EXTERNAL_IDvalues, follow Step 5 in Option 1: Configure a Snowflake storage integration to access Amazon S3 to grant the IAM user access to the Amazon Bedrock service.Execute the following SQL statement to create a token to use for authentication with the AWS Bedrock service:
Execute the following SQL statement to create an external access integration that uses the network rule and token created in previous steps:
Execute the following SQL statement to create a function that can use the external access integration and the token that were previously created:
Execute the following SQL statement to run the function you created: