@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
111 lines • 4.76 kB
JavaScript
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserDefinedFunction = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a Glue User Defined Function Resource.
*
* ## Example Usage
*
* ```typescript
* 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", {
* name: "my_func",
* catalogId: example.catalogId,
* databaseName: example.name,
* className: "class",
* ownerName: "owner",
* ownerType: "GROUP",
* resourceUris: [{
* resourceType: "ARCHIVE",
* uri: "uri",
* }],
* });
* ```
*
* ## 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:
*
* ```sh
* $ pulumi import aws:glue/userDefinedFunction:UserDefinedFunction func 123456789012:my_database:my_func
* ```
*/
class UserDefinedFunction extends pulumi.CustomResource {
/**
* Get an existing UserDefinedFunction resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new UserDefinedFunction(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of UserDefinedFunction. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === UserDefinedFunction.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["catalogId"] = state?.catalogId;
resourceInputs["className"] = state?.className;
resourceInputs["createTime"] = state?.createTime;
resourceInputs["databaseName"] = state?.databaseName;
resourceInputs["name"] = state?.name;
resourceInputs["ownerName"] = state?.ownerName;
resourceInputs["ownerType"] = state?.ownerType;
resourceInputs["region"] = state?.region;
resourceInputs["resourceUris"] = state?.resourceUris;
}
else {
const args = argsOrState;
if (args?.className === undefined && !opts.urn) {
throw new Error("Missing required property 'className'");
}
if (args?.databaseName === undefined && !opts.urn) {
throw new Error("Missing required property 'databaseName'");
}
if (args?.ownerName === undefined && !opts.urn) {
throw new Error("Missing required property 'ownerName'");
}
if (args?.ownerType === undefined && !opts.urn) {
throw new Error("Missing required property 'ownerType'");
}
resourceInputs["catalogId"] = args?.catalogId;
resourceInputs["className"] = args?.className;
resourceInputs["databaseName"] = args?.databaseName;
resourceInputs["name"] = args?.name;
resourceInputs["ownerName"] = args?.ownerName;
resourceInputs["ownerType"] = args?.ownerType;
resourceInputs["region"] = args?.region;
resourceInputs["resourceUris"] = args?.resourceUris;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["createTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(UserDefinedFunction.__pulumiType, name, resourceInputs, opts);
}
}
exports.UserDefinedFunction = UserDefinedFunction;
/** @internal */
UserDefinedFunction.__pulumiType = 'aws:glue/userDefinedFunction:UserDefinedFunction';
//# sourceMappingURL=userDefinedFunction.js.map
;