@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
100 lines • 4.66 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, Object.assign(Object.assign({}, 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 ? state.catalogId : undefined;
resourceInputs["creationTime"] = state ? state.creationTime : undefined;
resourceInputs["databaseName"] = state ? state.databaseName : undefined;
resourceInputs["lastAccessedTime"] = state ? state.lastAccessedTime : undefined;
resourceInputs["lastAnalyzedTime"] = state ? state.lastAnalyzedTime : undefined;
resourceInputs["parameters"] = state ? state.parameters : undefined;
resourceInputs["partitionValues"] = state ? state.partitionValues : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["storageDescriptor"] = state ? state.storageDescriptor : undefined;
resourceInputs["tableName"] = state ? state.tableName : undefined;
}
else {
const args = argsOrState;
if ((!args || args.databaseName === undefined) && !opts.urn) {
throw new Error("Missing required property 'databaseName'");
}
if ((!args || args.partitionValues === undefined) && !opts.urn) {
throw new Error("Missing required property 'partitionValues'");
}
if ((!args || args.tableName === undefined) && !opts.urn) {
throw new Error("Missing required property 'tableName'");
}
resourceInputs["catalogId"] = args ? args.catalogId : undefined;
resourceInputs["databaseName"] = args ? args.databaseName : undefined;
resourceInputs["parameters"] = args ? args.parameters : undefined;
resourceInputs["partitionValues"] = args ? args.partitionValues : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["storageDescriptor"] = args ? args.storageDescriptor : undefined;
resourceInputs["tableName"] = args ? args.tableName : undefined;
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