Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Snowflake

v0.2.1 published on Monday, Sep 27, 2021 by Pulumi

ExternalFunction

Import

format is database name | schema name | external function name | <list of function arg types, separated with ‘-'>

 $ pulumi import snowflake:index/externalFunction:ExternalFunction example 'dbName|schemaName|externalFunctionName|varchar-varchar-varchar'

Example Usage

using Pulumi;
using Snowflake = Pulumi.Snowflake;

class MyStack : Stack
{
    public MyStack()
    {
        var testExtFunc = new Snowflake.ExternalFunction("testExtFunc", new Snowflake.ExternalFunctionArgs
        {
            ApiIntegration = "api_integration_name",
            Args = 
            {
                new Snowflake.Inputs.ExternalFunctionArgArgs
                {
                    Name = "arg1",
                    Type = "varchar",
                },
                new Snowflake.Inputs.ExternalFunctionArgArgs
                {
                    Name = "arg2",
                    Type = "varchar",
                },
            },
            Database = "my_test_db",
            ReturnBehavior = "IMMUTABLE",
            ReturnType = "varchar",
            Schema = "my_test_schema",
            UrlOfProxyAndResource = "https://123456.execute-api.us-west-2.amazonaws.com/prod/test_func",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-snowflake/sdk/go/snowflake"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := snowflake.NewExternalFunction(ctx, "testExtFunc", &snowflake.ExternalFunctionArgs{
			ApiIntegration: pulumi.String("api_integration_name"),
			Args: ExternalFunctionArgArray{
				&ExternalFunctionArgArgs{
					Name: pulumi.String("arg1"),
					Type: pulumi.String("varchar"),
				},
				&ExternalFunctionArgArgs{
					Name: pulumi.String("arg2"),
					Type: pulumi.String("varchar"),
				},
			},
			Database:              pulumi.String("my_test_db"),
			ReturnBehavior:        pulumi.String("IMMUTABLE"),
			ReturnType:            pulumi.String("varchar"),
			Schema:                pulumi.String("my_test_schema"),
			UrlOfProxyAndResource: pulumi.String("https://123456.execute-api.us-west-2.amazonaws.com/prod/test_func"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_snowflake as snowflake

test_ext_func = snowflake.ExternalFunction("testExtFunc",
    api_integration="api_integration_name",
    args=[
        snowflake.ExternalFunctionArgArgs(
            name="arg1",
            type="varchar",
        ),
        snowflake.ExternalFunctionArgArgs(
            name="arg2",
            type="varchar",
        ),
    ],
    database="my_test_db",
    return_behavior="IMMUTABLE",
    return_type="varchar",
    schema="my_test_schema",
    url_of_proxy_and_resource="https://123456.execute-api.us-west-2.amazonaws.com/prod/test_func")
import * as pulumi from "@pulumi/pulumi";
import * as snowflake from "@pulumi/snowflake";

const testExtFunc = new snowflake.ExternalFunction("test_ext_func", {
    apiIntegration: "api_integration_name",
    args: [
        {
            name: "arg1",
            type: "varchar",
        },
        {
            name: "arg2",
            type: "varchar",
        },
    ],
    database: "my_test_db",
    returnBehavior: "IMMUTABLE",
    returnType: "varchar",
    schema: "my_test_schema",
    urlOfProxyAndResource: "https://123456.execute-api.us-west-2.amazonaws.com/prod/test_func",
});

Create a ExternalFunction Resource

new ExternalFunction(name: string, args: ExternalFunctionArgs, opts?: CustomResourceOptions);
@overload
def ExternalFunction(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     api_integration: Optional[str] = None,
                     args: Optional[Sequence[ExternalFunctionArgArgs]] = None,
                     comment: Optional[str] = None,
                     compression: Optional[str] = None,
                     context_headers: Optional[Sequence[str]] = None,
                     database: Optional[str] = None,
                     headers: Optional[Sequence[ExternalFunctionHeaderArgs]] = None,
                     max_batch_rows: Optional[int] = None,
                     name: Optional[str] = None,
                     null_input_behavior: Optional[str] = None,
                     return_behavior: Optional[str] = None,
                     return_null_allowed: Optional[bool] = None,
                     return_type: Optional[str] = None,
                     schema: Optional[str] = None,
                     url_of_proxy_and_resource: Optional[str] = None)
@overload
def ExternalFunction(resource_name: str,
                     args: ExternalFunctionArgs,
                     opts: Optional[ResourceOptions] = None)
func NewExternalFunction(ctx *Context, name string, args ExternalFunctionArgs, opts ...ResourceOption) (*ExternalFunction, error)
public ExternalFunction(string name, ExternalFunctionArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ExternalFunctionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ExternalFunctionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ExternalFunctionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ExternalFunctionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ExternalFunction Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The ExternalFunction resource accepts the following input properties:

ApiIntegration string
The name of the API integration object that should be used to authenticate the call to the proxy service.
Database string
The database in which to create the external function.
ReturnBehavior string
Specifies the behavior of the function when returning results
ReturnType string
Specifies the data type returned by the external function.
Schema string
The schema in which to create the external function.
UrlOfProxyAndResource string
This is the invocation URL of the proxy service and resource through which Snowflake calls the remote service.
Args List<ExternalFunctionArgArgs>
Specifies the arguments/inputs for the external function. These should correspond to the arguments that the remote service expects.
Comment string
A description of the external function.
Compression string
If specified, the JSON payload is compressed when sent from Snowflake to the proxy service, and when sent back from the proxy service to Snowflake.
ContextHeaders List<string>
Binds Snowflake context function results to HTTP headers.
Headers List<ExternalFunctionHeaderArgs>
Allows users to specify key-value metadata that is sent with every request as HTTP headers.
MaxBatchRows int
This specifies the maximum number of rows in each batch sent to the proxy service.
Name string
Specifies the identifier for the external function. The identifier can contain the schema name and database name, as well as the function name. The function’s signature (name and argument data types) must be unique within the schema.
NullInputBehavior string
Specifies the behavior of the external function when called with null inputs.
ReturnNullAllowed bool
Indicates whether the function can return NULL values or must return only NON-NULL values.
ApiIntegration string
The name of the API integration object that should be used to authenticate the call to the proxy service.
Database string
The database in which to create the external function.
ReturnBehavior string
Specifies the behavior of the function when returning results
ReturnType string
Specifies the data type returned by the external function.
Schema string
The schema in which to create the external function.
UrlOfProxyAndResource string
This is the invocation URL of the proxy service and resource through which Snowflake calls the remote service.
Args []ExternalFunctionArgArgs
Specifies the arguments/inputs for the external function. These should correspond to the arguments that the remote service expects.
Comment string
A description of the external function.
Compression string
If specified, the JSON payload is compressed when sent from Snowflake to the proxy service, and when sent back from the proxy service to Snowflake.
ContextHeaders []string
Binds Snowflake context function results to HTTP headers.
Headers []ExternalFunctionHeaderArgs
Allows users to specify key-value metadata that is sent with every request as HTTP headers.
MaxBatchRows int
This specifies the maximum number of rows in each batch sent to the proxy service.
Name string
Specifies the identifier for the external function. The identifier can contain the schema name and database name, as well as the function name. The function’s signature (name and argument data types) must be unique within the schema.
NullInputBehavior string
Specifies the behavior of the external function when called with null inputs.
ReturnNullAllowed bool
Indicates whether the function can return NULL values or must return only NON-NULL values.
apiIntegration string
The name of the API integration object that should be used to authenticate the call to the proxy service.
database string
The database in which to create the external function.
returnBehavior string
Specifies the behavior of the function when returning results
returnType string
Specifies the data type returned by the external function.
schema string
The schema in which to create the external function.
urlOfProxyAndResource string
This is the invocation URL of the proxy service and resource through which Snowflake calls the remote service.
args ExternalFunctionArgArgs[]
Specifies the arguments/inputs for the external function. These should correspond to the arguments that the remote service expects.
comment string
A description of the external function.
compression string
If specified, the JSON payload is compressed when sent from Snowflake to the proxy service, and when sent back from the proxy service to Snowflake.
contextHeaders string[]
Binds Snowflake context function results to HTTP headers.
headers ExternalFunctionHeaderArgs[]
Allows users to specify key-value metadata that is sent with every request as HTTP headers.
maxBatchRows number
This specifies the maximum number of rows in each batch sent to the proxy service.
name string
Specifies the identifier for the external function. The identifier can contain the schema name and database name, as well as the function name. The function’s signature (name and argument data types) must be unique within the schema.
nullInputBehavior string
Specifies the behavior of the external function when called with null inputs.
returnNullAllowed boolean
Indicates whether the function can return NULL values or must return only NON-NULL values.
api_integration str
The name of the API integration object that should be used to authenticate the call to the proxy service.
database str
The database in which to create the external function.
return_behavior str
Specifies the behavior of the function when returning results
return_type str
Specifies the data type returned by the external function.
schema str
The schema in which to create the external function.
url_of_proxy_and_resource str
This is the invocation URL of the proxy service and resource through which Snowflake calls the remote service.
args Sequence[ExternalFunctionArgArgs]
Specifies the arguments/inputs for the external function. These should correspond to the arguments that the remote service expects.
comment str
A description of the external function.
compression str
If specified, the JSON payload is compressed when sent from Snowflake to the proxy service, and when sent back from the proxy service to Snowflake.
context_headers Sequence[str]
Binds Snowflake context function results to HTTP headers.
headers Sequence[ExternalFunctionHeaderArgs]
Allows users to specify key-value metadata that is sent with every request as HTTP headers.
max_batch_rows int
This specifies the maximum number of rows in each batch sent to the proxy service.
name str
Specifies the identifier for the external function. The identifier can contain the schema name and database name, as well as the function name. The function’s signature (name and argument data types) must be unique within the schema.
null_input_behavior str
Specifies the behavior of the external function when called with null inputs.
return_null_allowed bool
Indicates whether the function can return NULL values or must return only NON-NULL values.

Outputs

All input properties are implicitly available as output properties. Additionally, the ExternalFunction resource produces the following output properties:

CreatedOn string
Date and time when the external function was created.
Id string
The provider-assigned unique ID for this managed resource.
CreatedOn string
Date and time when the external function was created.
Id string
The provider-assigned unique ID for this managed resource.
createdOn string
Date and time when the external function was created.
id string
The provider-assigned unique ID for this managed resource.
created_on str
Date and time when the external function was created.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing ExternalFunction Resource

Get an existing ExternalFunction resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ExternalFunctionState, opts?: CustomResourceOptions): ExternalFunction
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        api_integration: Optional[str] = None,
        args: Optional[Sequence[ExternalFunctionArgArgs]] = None,
        comment: Optional[str] = None,
        compression: Optional[str] = None,
        context_headers: Optional[Sequence[str]] = None,
        created_on: Optional[str] = None,
        database: Optional[str] = None,
        headers: Optional[Sequence[ExternalFunctionHeaderArgs]] = None,
        max_batch_rows: Optional[int] = None,
        name: Optional[str] = None,
        null_input_behavior: Optional[str] = None,
        return_behavior: Optional[str] = None,
        return_null_allowed: Optional[bool] = None,
        return_type: Optional[str] = None,
        schema: Optional[str] = None,
        url_of_proxy_and_resource: Optional[str] = None) -> ExternalFunction
func GetExternalFunction(ctx *Context, name string, id IDInput, state *ExternalFunctionState, opts ...ResourceOption) (*ExternalFunction, error)
public static ExternalFunction Get(string name, Input<string> id, ExternalFunctionState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

ApiIntegration string
The name of the API integration object that should be used to authenticate the call to the proxy service.
Args List<ExternalFunctionArgArgs>
Specifies the arguments/inputs for the external function. These should correspond to the arguments that the remote service expects.
Comment string
A description of the external function.
Compression string
If specified, the JSON payload is compressed when sent from Snowflake to the proxy service, and when sent back from the proxy service to Snowflake.
ContextHeaders List<string>
Binds Snowflake context function results to HTTP headers.
CreatedOn string
Date and time when the external function was created.
Database string
The database in which to create the external function.
Headers List<ExternalFunctionHeaderArgs>
Allows users to specify key-value metadata that is sent with every request as HTTP headers.
MaxBatchRows int
This specifies the maximum number of rows in each batch sent to the proxy service.
Name string
Specifies the identifier for the external function. The identifier can contain the schema name and database name, as well as the function name. The function’s signature (name and argument data types) must be unique within the schema.
NullInputBehavior string
Specifies the behavior of the external function when called with null inputs.
ReturnBehavior string
Specifies the behavior of the function when returning results
ReturnNullAllowed bool
Indicates whether the function can return NULL values or must return only NON-NULL values.
ReturnType string
Specifies the data type returned by the external function.
Schema string
The schema in which to create the external function.
UrlOfProxyAndResource string
This is the invocation URL of the proxy service and resource through which Snowflake calls the remote service.
ApiIntegration string
The name of the API integration object that should be used to authenticate the call to the proxy service.
Args []ExternalFunctionArgArgs
Specifies the arguments/inputs for the external function. These should correspond to the arguments that the remote service expects.
Comment string
A description of the external function.
Compression string
If specified, the JSON payload is compressed when sent from Snowflake to the proxy service, and when sent back from the proxy service to Snowflake.
ContextHeaders []string
Binds Snowflake context function results to HTTP headers.
CreatedOn string
Date and time when the external function was created.
Database string
The database in which to create the external function.
Headers []ExternalFunctionHeaderArgs
Allows users to specify key-value metadata that is sent with every request as HTTP headers.
MaxBatchRows int
This specifies the maximum number of rows in each batch sent to the proxy service.
Name string
Specifies the identifier for the external function. The identifier can contain the schema name and database name, as well as the function name. The function’s signature (name and argument data types) must be unique within the schema.
NullInputBehavior string
Specifies the behavior of the external function when called with null inputs.
ReturnBehavior string
Specifies the behavior of the function when returning results
ReturnNullAllowed bool
Indicates whether the function can return NULL values or must return only NON-NULL values.
ReturnType string
Specifies the data type returned by the external function.
Schema string
The schema in which to create the external function.
UrlOfProxyAndResource string
This is the invocation URL of the proxy service and resource through which Snowflake calls the remote service.
apiIntegration string
The name of the API integration object that should be used to authenticate the call to the proxy service.
args ExternalFunctionArgArgs[]
Specifies the arguments/inputs for the external function. These should correspond to the arguments that the remote service expects.
comment string
A description of the external function.
compression string
If specified, the JSON payload is compressed when sent from Snowflake to the proxy service, and when sent back from the proxy service to Snowflake.
contextHeaders string[]
Binds Snowflake context function results to HTTP headers.
createdOn string
Date and time when the external function was created.
database string
The database in which to create the external function.
headers ExternalFunctionHeaderArgs[]
Allows users to specify key-value metadata that is sent with every request as HTTP headers.
maxBatchRows number
This specifies the maximum number of rows in each batch sent to the proxy service.
name string
Specifies the identifier for the external function. The identifier can contain the schema name and database name, as well as the function name. The function’s signature (name and argument data types) must be unique within the schema.
nullInputBehavior string
Specifies the behavior of the external function when called with null inputs.
returnBehavior string
Specifies the behavior of the function when returning results
returnNullAllowed boolean
Indicates whether the function can return NULL values or must return only NON-NULL values.
returnType string
Specifies the data type returned by the external function.
schema string
The schema in which to create the external function.
urlOfProxyAndResource string
This is the invocation URL of the proxy service and resource through which Snowflake calls the remote service.
api_integration str
The name of the API integration object that should be used to authenticate the call to the proxy service.
args Sequence[ExternalFunctionArgArgs]
Specifies the arguments/inputs for the external function. These should correspond to the arguments that the remote service expects.
comment str
A description of the external function.
compression str
If specified, the JSON payload is compressed when sent from Snowflake to the proxy service, and when sent back from the proxy service to Snowflake.
context_headers Sequence[str]
Binds Snowflake context function results to HTTP headers.
created_on str
Date and time when the external function was created.
database str
The database in which to create the external function.
headers Sequence[ExternalFunctionHeaderArgs]
Allows users to specify key-value metadata that is sent with every request as HTTP headers.
max_batch_rows int
This specifies the maximum number of rows in each batch sent to the proxy service.
name str
Specifies the identifier for the external function. The identifier can contain the schema name and database name, as well as the function name. The function’s signature (name and argument data types) must be unique within the schema.
null_input_behavior str
Specifies the behavior of the external function when called with null inputs.
return_behavior str
Specifies the behavior of the function when returning results
return_null_allowed bool
Indicates whether the function can return NULL values or must return only NON-NULL values.
return_type str
Specifies the data type returned by the external function.
schema str
The schema in which to create the external function.
url_of_proxy_and_resource str
This is the invocation URL of the proxy service and resource through which Snowflake calls the remote service.

Supporting Types

ExternalFunctionArg

Name string
Argument name
Type string
Argument type, e.g. VARCHAR
Name string
Argument name
Type string
Argument type, e.g. VARCHAR
name string
Argument name
type string
Argument type, e.g. VARCHAR
name str
Argument name
type str
Argument type, e.g. VARCHAR

ExternalFunctionHeader

Name string
Header name
Value string
Header value
Name string
Header name
Value string
Header value
name string
Header name
value string
Header value
name str
Header name
value str
Header value

Package Details

Repository
https://github.com/pulumi/pulumi-snowflake
License
Apache-2.0
Notes
This Pulumi package is based on the snowflake Terraform Provider.