@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
163 lines • 7.39 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.CatalogTable = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a Glue Catalog Table Resource. You can refer to the [Glue Developer Guide](http://docs.aws.amazon.com/glue/latest/dg/populate-data-catalog.html) for a full explanation of the Glue Data Catalog functionality.
*
* ## Example Usage
*
* ### Basic Table
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const awsGlueCatalogTable = new aws.glue.CatalogTable("aws_glue_catalog_table", {
* name: "MyCatalogTable",
* databaseName: "MyCatalogDatabase",
* });
* ```
*
* ### Parquet Table for Athena
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const awsGlueCatalogTable = new aws.glue.CatalogTable("aws_glue_catalog_table", {
* name: "MyCatalogTable",
* databaseName: "MyCatalogDatabase",
* tableType: "EXTERNAL_TABLE",
* parameters: {
* EXTERNAL: "TRUE",
* "parquet.compression": "SNAPPY",
* },
* storageDescriptor: {
* location: "s3://my-bucket/event-streams/my-stream",
* inputFormat: "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat",
* outputFormat: "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat",
* serDeInfo: {
* name: "my-stream",
* serializationLibrary: "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe",
* parameters: {
* "serialization.format": "1",
* },
* },
* columns: [
* {
* name: "my_string",
* type: "string",
* },
* {
* name: "my_double",
* type: "double",
* },
* {
* name: "my_date",
* type: "date",
* comment: "",
* },
* {
* name: "my_bigint",
* type: "bigint",
* comment: "",
* },
* {
* name: "my_struct",
* type: "struct<my_nested_string:string>",
* comment: "",
* },
* ],
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Glue Tables using the catalog ID (usually AWS account ID), database name, and table name. For example:
*
* ```sh
* $ pulumi import aws:glue/catalogTable:CatalogTable MyTable 123456789012:MyDatabase:MyTable
* ```
*/
class CatalogTable extends pulumi.CustomResource {
/**
* Get an existing CatalogTable 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 CatalogTable(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of CatalogTable. 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'] === CatalogTable.__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["databaseName"] = state ? state.databaseName : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["openTableFormatInput"] = state ? state.openTableFormatInput : undefined;
resourceInputs["owner"] = state ? state.owner : undefined;
resourceInputs["parameters"] = state ? state.parameters : undefined;
resourceInputs["partitionIndices"] = state ? state.partitionIndices : undefined;
resourceInputs["partitionKeys"] = state ? state.partitionKeys : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["retention"] = state ? state.retention : undefined;
resourceInputs["storageDescriptor"] = state ? state.storageDescriptor : undefined;
resourceInputs["tableType"] = state ? state.tableType : undefined;
resourceInputs["targetTable"] = state ? state.targetTable : undefined;
resourceInputs["viewExpandedText"] = state ? state.viewExpandedText : undefined;
resourceInputs["viewOriginalText"] = state ? state.viewOriginalText : undefined;
}
else {
const args = argsOrState;
if ((!args || args.databaseName === undefined) && !opts.urn) {
throw new Error("Missing required property 'databaseName'");
}
resourceInputs["catalogId"] = args ? args.catalogId : undefined;
resourceInputs["databaseName"] = args ? args.databaseName : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["openTableFormatInput"] = args ? args.openTableFormatInput : undefined;
resourceInputs["owner"] = args ? args.owner : undefined;
resourceInputs["parameters"] = args ? args.parameters : undefined;
resourceInputs["partitionIndices"] = args ? args.partitionIndices : undefined;
resourceInputs["partitionKeys"] = args ? args.partitionKeys : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["retention"] = args ? args.retention : undefined;
resourceInputs["storageDescriptor"] = args ? args.storageDescriptor : undefined;
resourceInputs["tableType"] = args ? args.tableType : undefined;
resourceInputs["targetTable"] = args ? args.targetTable : undefined;
resourceInputs["viewExpandedText"] = args ? args.viewExpandedText : undefined;
resourceInputs["viewOriginalText"] = args ? args.viewOriginalText : undefined;
resourceInputs["arn"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CatalogTable.__pulumiType, name, resourceInputs, opts);
}
}
exports.CatalogTable = CatalogTable;
/** @internal */
CatalogTable.__pulumiType = 'aws:glue/catalogTable:CatalogTable';
//# sourceMappingURL=catalogTable.js.map