@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
163 lines • 6.74 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, { ...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?.arn;
resourceInputs["catalogId"] = state?.catalogId;
resourceInputs["databaseName"] = state?.databaseName;
resourceInputs["description"] = state?.description;
resourceInputs["name"] = state?.name;
resourceInputs["openTableFormatInput"] = state?.openTableFormatInput;
resourceInputs["owner"] = state?.owner;
resourceInputs["parameters"] = state?.parameters;
resourceInputs["partitionIndices"] = state?.partitionIndices;
resourceInputs["partitionKeys"] = state?.partitionKeys;
resourceInputs["region"] = state?.region;
resourceInputs["retention"] = state?.retention;
resourceInputs["storageDescriptor"] = state?.storageDescriptor;
resourceInputs["tableType"] = state?.tableType;
resourceInputs["targetTable"] = state?.targetTable;
resourceInputs["viewExpandedText"] = state?.viewExpandedText;
resourceInputs["viewOriginalText"] = state?.viewOriginalText;
}
else {
const args = argsOrState;
if (args?.databaseName === undefined && !opts.urn) {
throw new Error("Missing required property 'databaseName'");
}
resourceInputs["catalogId"] = args?.catalogId;
resourceInputs["databaseName"] = args?.databaseName;
resourceInputs["description"] = args?.description;
resourceInputs["name"] = args?.name;
resourceInputs["openTableFormatInput"] = args?.openTableFormatInput;
resourceInputs["owner"] = args?.owner;
resourceInputs["parameters"] = args?.parameters;
resourceInputs["partitionIndices"] = args?.partitionIndices;
resourceInputs["partitionKeys"] = args?.partitionKeys;
resourceInputs["region"] = args?.region;
resourceInputs["retention"] = args?.retention;
resourceInputs["storageDescriptor"] = args?.storageDescriptor;
resourceInputs["tableType"] = args?.tableType;
resourceInputs["targetTable"] = args?.targetTable;
resourceInputs["viewExpandedText"] = args?.viewExpandedText;
resourceInputs["viewOriginalText"] = args?.viewOriginalText;
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
;