UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

111 lines 5.17 kB
"use strict"; // *** 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, Object.assign(Object.assign({}, 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 ? state.arn : undefined; resourceInputs["catalogId"] = state ? state.catalogId : undefined; resourceInputs["className"] = state ? state.className : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["databaseName"] = state ? state.databaseName : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["ownerName"] = state ? state.ownerName : undefined; resourceInputs["ownerType"] = state ? state.ownerType : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["resourceUris"] = state ? state.resourceUris : undefined; } else { const args = argsOrState; if ((!args || args.className === undefined) && !opts.urn) { throw new Error("Missing required property 'className'"); } if ((!args || args.databaseName === undefined) && !opts.urn) { throw new Error("Missing required property 'databaseName'"); } if ((!args || args.ownerName === undefined) && !opts.urn) { throw new Error("Missing required property 'ownerName'"); } if ((!args || args.ownerType === undefined) && !opts.urn) { throw new Error("Missing required property 'ownerType'"); } resourceInputs["catalogId"] = args ? args.catalogId : undefined; resourceInputs["className"] = args ? args.className : undefined; resourceInputs["databaseName"] = args ? args.databaseName : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["ownerName"] = args ? args.ownerName : undefined; resourceInputs["ownerType"] = args ? args.ownerType : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["resourceUris"] = args ? args.resourceUris : undefined; 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