Planning an external function for AWS (original) (raw)

This topic helps you prepare to create an external function for AWS (Amazon Web Services) using either the AWS Management Console or an AWS CloudFormation template provided by Snowflake.

Prerequisites

These instructions assume that you are an experienced AWS Management Console user.

You need:

"expires": "2025-03-01T00:00:00",  
"purpose": "generic"  

},
...
]
}
From the function output, for each property identified with “purpose”: “generic”, record the corresponding VPC ID(s).
After you decide whether to create your external function by using the AWS Management Console or an AWS CloudFormation template, copy the VPC IDs to the appropriate tracking worksheet:

Choosing your endpoint type: Regional endpoint vs. Private endpoint

You access a proxy service (such as Amazon API Gateway) via a URI, often referred to as an endpoint. The instructions for creating your Amazon API Gateway ask you to choose one of the following types of endpoints:

The following information can help you choose the type of endpoint.

A regional endpoint can be accessed across AWS regions, or even across cloud platforms. Your Snowflake instance, your proxy service, and your remote service can all be in different regions or even on different cloud platforms. For example, a Snowflake instance running on Azure could send requests to an Amazon API Gateway regional endpoint, which in turn could forward data to a remote service running on GCP.

A private endpoint can be configured to allow access only within a region. For example, you can configure a private endpoint to allow access from only a Snowflake VPC (Virtual Private Cloud) in the same AWS region. Communication between a Snowflake VPC and a private endpoint uses AWS PrivateLink.

For more details about the types of endpoints on AWS, see:

If you want to use a private endpoint, and you are not sure which region you are using, you can look up your region by doing either of the following:

To use a private endpoint, your account must meet the following requirements:

Choosing the method for creating the external function

Snowflake provides instructions for two ways to create an external function on AWS:

AWS Management Console

You can use the AWS Management Console to create a Lambda Function (as the remote service) and an Amazon API Gateway instance (as the proxy service). If you choose this method, you also use the AWS Management Console to configure security-related settings.

The instructions for creating an external function using the AWS Management Console include a sample Lambda Function and details for creating a basic API Gateway:

AWS CloudFormation template

The CloudFormation template performs both of the following steps in creating an external function:

The template also:

Preparing to use the AWS Management Console

Create a worksheet for tracking required information

As you create your external function, you should record specific information that you enter (e.g. the Resource Invocation URL) so that you can use that information in subsequent steps. The worksheet below helps you track this information.

=========================================================================== ================ Tracking Worksheet: AWS Management Console ===============

****** Step 1: Information about the Lambda Function (remote service) *****

Your AWS Account ID: ______________________________________________________

Lambda Function Name: _____________________________________________________

******** Step 2: Information about the API Gateway (proxy Service) ********

New IAM Role Name: ________________________________________________________

New IAM Role ARN: _________________________________________________________

Snowflake VPC ID (optional): ______________________________________________

New API Name: _____________________________________________________________

API Gateway Resource Name: ________________________________________________

Resource Invocation URL: __________________________________________________

Method Request ARN: _______________________________________________________

*** Step 3: Information about the API Integration and External Function ***

API Integration Name: _____________________________________________________

API_AWS_IAM_USER_ARN: _____________________________________________________

API_AWS_EXTERNAL_ID: ______________________________________________________

External Function Name: ___________________________________________________

Preparing to use an AWS CloudFormation template

Download the template

The template is available for download from thedeployment templates directoryin the Snowflake repository in GitHub.

Create a worksheet for tracking required information

As you create your external function, you should record specific information that you enter (e.g. the Resource Invocation URL) so that you can use that information in subsequent steps. The worksheet below helps you track this information.

=========================================================================== ================== Tracking Worksheet: CloudFormation Template ============

New IAM Role Name: ________________________________________________________

New IAM Role ARN: _________________________________________________________

Resource Invocation URL: __________________________________________________

API_AWS_IAM_USER_ARN: _____________________________________________________

API_AWS_EXTERNAL_ID: ______________________________________________________

Additional resources for building external functions on AWS

When you are ready to create your own remote service for your own external function, you might want to look at the examples of remote services based on Lambda Functions that are available inThe Snowflake Labs.

Next step

AWS Management Console:

Step 1: Create the remote service (AWS Lambda function) in the Management Console

AWS CloudFormation template:

Step 1: Use the template to create the remote service (AWS Lambda function) and proxy service (API Gateway)