UserDefinedFunction class
Provides a Glue User Defined Function Resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.glue.CatalogDatabase("example", {name: "my_database"});
const exampleUserDefinedFunction = new aws.glue.UserDefinedFunction("example", {
resourceUris: [{
resourceType: "ARCHIVE",
uri: "uri",
}],
name: "my_func",
catalogId: example.catalogId,
databaseName: example.name,
className: "class",
ownerName: "owner",
ownerType: "GROUP",
});
import pulumi
import pulumi_aws as aws
example = aws.glue.CatalogDatabase("example", name="my_database")
example_user_defined_function = aws.glue.UserDefinedFunction("example",
resource_uris=[{
"resource_type": "ARCHIVE",
"uri": "uri",
}],
name="my_func",
catalog_id=example.catalog_id,
database_name=example.name,
class_name="class",
owner_name="owner",
owner_type="GROUP")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Glue.CatalogDatabase("example", new()
{
Name = "my_database",
});
var exampleUserDefinedFunction = new Aws.Glue.UserDefinedFunction("example", new()
{
ResourceUris = new[]
{
new Aws.Glue.Inputs.UserDefinedFunctionResourceUriArgs
{
ResourceType = "ARCHIVE",
Uri = "uri",
},
},
Name = "my_func",
CatalogId = example.CatalogId,
DatabaseName = example.Name,
ClassName = "class",
OwnerName = "owner",
OwnerType = "GROUP",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/glue"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := glue.NewCatalogDatabase(ctx, "example", &glue.CatalogDatabaseArgs{
Name: pulumi.String("my_database"),
})
if err != nil {
return err
}
_, err = glue.NewUserDefinedFunction(ctx, "example", &glue.UserDefinedFunctionArgs{
ResourceUris: glue.UserDefinedFunctionResourceUriArray{
&glue.UserDefinedFunctionResourceUriArgs{
ResourceType: pulumi.String("ARCHIVE"),
Uri: pulumi.String("uri"),
},
},
Name: pulumi.String("my_func"),
CatalogId: example.CatalogId,
DatabaseName: example.Name,
ClassName: pulumi.String("class"),
OwnerName: pulumi.String("owner"),
OwnerType: pulumi.String("GROUP"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_glue_catalogdatabase" "example" {
name = "my_database"
}
resource "aws_glue_userdefinedfunction" "example" {
resource_uris {
resource_type = "ARCHIVE"
uri = "uri"
}
name = "my_func"
catalog_id = aws_glue_catalogdatabase.example.catalog_id
database_name = aws_glue_catalogdatabase.example.name
class_name = "class"
owner_name = "owner"
owner_type = "GROUP"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.glue.CatalogDatabase;
import com.pulumi.aws.glue.CatalogDatabaseArgs;
import com.pulumi.aws.glue.UserDefinedFunction;
import com.pulumi.aws.glue.UserDefinedFunctionArgs;
import com.pulumi.aws.glue.inputs.UserDefinedFunctionResourceUriArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new CatalogDatabase("example", CatalogDatabaseArgs.builder()
.name("my_database")
.build());
var exampleUserDefinedFunction = new UserDefinedFunction("exampleUserDefinedFunction", UserDefinedFunctionArgs.builder()
.resourceUris(UserDefinedFunctionResourceUriArgs.builder()
.resourceType("ARCHIVE")
.uri("uri")
.build())
.name("my_func")
.catalogId(example.catalogId())
.databaseName(example.name())
.className("class")
.ownerName("owner")
.ownerType("GROUP")
.build());
}
}
resources:
example:
type: aws:glue:CatalogDatabase
properties:
name: my_database
exampleUserDefinedFunction:
type: aws:glue:UserDefinedFunction
name: example
properties:
resourceUris:
- resourceType: ARCHIVE
uri: uri
name: my_func
catalogId: ${example.catalogId}
databaseName: ${example.name}
className: class
ownerName: owner
ownerType: GROUP
Import
Using pulumi import, import Glue User Defined Functions using the catalog_id:database_name:function_name. If you have not set a Catalog ID specify the AWS Account ID that the database is in. For example:
$ pulumi import aws:glue/userDefinedFunction:UserDefinedFunction func 123456789012:my_database:my_func
Constructors
- UserDefinedFunction(String name, {UserDefinedFunctionArgs? args, CustomResourceOptions? options})
-
Creates a new UserDefinedFunction.
nameThe Pulumi resource name.argsArguments used to configure this UserDefinedFunction. The set of arguments for UserDefinedFunction.optionsResource options controlling this resource's behavior. - UserDefinedFunction.reference(String urn)
- Creates a typed reference to an existing UserDefinedFunction resource.
Properties
-
arn
↔ Output<
String> -
The ARN of the Glue User Defined Function.
latefinal
-
catalogId
↔ Output<
String?> -
ID of the Glue Catalog to create the function in. If omitted, this defaults to the AWS Account ID.
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
className
↔ Output<
String> -
The Java class that contains the function code.
latefinal
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
createTime
↔ Output<
String> -
The time at which the function was created.
latefinal
-
databaseName
↔ Output<
String> -
The name of the Database to create the Function.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
name
↔ Output<
String> -
The name of the function.
latefinal
-
ownerName
↔ Output<
String> -
The owner of the function.
latefinal
-
ownerType
↔ Output<
String> -
The owner type. can be one of
USER,ROLE, andGROUP.latefinal -
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
-
resourceUris
↔ Output<
List< UserDefinedFunctionResourceUri> ?> -
The configuration block for Resource URIs. See resource uris below for more details.
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {UserDefinedFunctionState? state, CustomResourceOptions? options}) → UserDefinedFunction -
Gets an existing UserDefinedFunction resource's state with the given
nameandid.