@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
100 lines • 4.28 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.Partition = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a Glue Partition Resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.glue.Partition("example", {
* databaseName: "some-database",
* tableName: "some-table",
* partitionValues: ["some-value"],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Glue Partitions using the catalog ID (usually AWS account ID), database name, table name and partition values. For example:
*
* ```sh
* $ pulumi import aws:glue/partition:Partition part 123456789012:MyDatabase:MyTable:val1#val2
* ```
*/
class Partition extends pulumi.CustomResource {
/**
* Get an existing Partition 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 Partition(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Partition. 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'] === Partition.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["catalogId"] = state?.catalogId;
resourceInputs["creationTime"] = state?.creationTime;
resourceInputs["databaseName"] = state?.databaseName;
resourceInputs["lastAccessedTime"] = state?.lastAccessedTime;
resourceInputs["lastAnalyzedTime"] = state?.lastAnalyzedTime;
resourceInputs["parameters"] = state?.parameters;
resourceInputs["partitionValues"] = state?.partitionValues;
resourceInputs["region"] = state?.region;
resourceInputs["storageDescriptor"] = state?.storageDescriptor;
resourceInputs["tableName"] = state?.tableName;
}
else {
const args = argsOrState;
if (args?.databaseName === undefined && !opts.urn) {
throw new Error("Missing required property 'databaseName'");
}
if (args?.partitionValues === undefined && !opts.urn) {
throw new Error("Missing required property 'partitionValues'");
}
if (args?.tableName === undefined && !opts.urn) {
throw new Error("Missing required property 'tableName'");
}
resourceInputs["catalogId"] = args?.catalogId;
resourceInputs["databaseName"] = args?.databaseName;
resourceInputs["parameters"] = args?.parameters;
resourceInputs["partitionValues"] = args?.partitionValues;
resourceInputs["region"] = args?.region;
resourceInputs["storageDescriptor"] = args?.storageDescriptor;
resourceInputs["tableName"] = args?.tableName;
resourceInputs["creationTime"] = undefined /*out*/;
resourceInputs["lastAccessedTime"] = undefined /*out*/;
resourceInputs["lastAnalyzedTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Partition.__pulumiType, name, resourceInputs, opts);
}
}
exports.Partition = Partition;
/** @internal */
Partition.__pulumiType = 'aws:glue/partition:Partition';
//# sourceMappingURL=partition.js.map
;