import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * 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 example = new aws.glue.CatalogTable("example", { * name: "MyCatalogTable", * databaseName: "MyCatalogDatabase", * }); * ``` * * ### Parquet Table for Athena * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.glue.CatalogTable("example", { * storageDescriptor: { * 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", * comment: "", * }, * ], * 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", * }, * name: "MyCatalogTable", * databaseName: "MyCatalogDatabase", * tableType: "EXTERNAL_TABLE", * parameters: { * EXTERNAL: "TRUE", * "parquet.compression": "SNAPPY", * }, * }); * ``` * * ### Iceberg Table * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.glue.CatalogTable("example", { * openTableFormatInput: { * icebergInput: { * icebergTableInput: { * schema: { * fields: [ * { * id: 1, * name: "transaction_id", * required: true, * type: " \\\"string\\\"\n", * }, * { * id: 2, * name: "transaction_date", * required: true, * type: " \\\"date\\\"\n", * }, * { * id: 3, * name: "monthly_balance", * required: true, * type: " \\\"float\\\"\n", * }, * ], * schemaId: 0, * type: "struct", * }, * partitionSpec: { * fields: [{ * name: "by_year", * sourceId: 2, * transform: "year", * }], * specId: 0, * }, * sortOrder: { * fields: [{ * direction: "asc", * nullOrder: "nulls-last", * sourceId: 1, * transform: "none", * }], * orderId: 1, * }, * location: "s3://sampledatabucket/bankdataiceberg/transactiontable1/", * }, * metadataOperation: "CREATE", * version: "2", * }, * }, * name: "transactiontable1", * databaseName: "bankdata_icebergdb", * }); * ``` * * ### Protected View * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.glue.CatalogTable("example", { * viewDefinition: { * representations: [{ * dialect: "ATHENA", * dialectVersion: "3", * viewOriginalText: "SELECT * FROM catalog_database.base_table", * validationConnection: exampleAwsGlueConnection.name, * }], * isProtected: true, * }, * name: "multidialect_view", * databaseName: "catalog_database", * tableType: "VIRTUAL_VIEW", * }); * ``` * * ## Import * * ### Identity Schema * * #### Required * * * `catalogId` - (String) ID of the Glue Catalog. * * `databaseName` - (String) Name of the Glue Catalog Database. * * `name` - (String) Name of the Glue Catalog Table. * * #### Optional * * * `accountId` - (String) AWS Account where this resource is managed. * * `region` - (String) Region where this resource is managed. * * 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 * ``` */ export declare 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: string, id: pulumi.Input, state?: CatalogTableState, opts?: pulumi.CustomResourceOptions): CatalogTable; /** * 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: any): obj is CatalogTable; /** * ARN of the Glue Table. */ readonly arn: pulumi.Output; /** * ID of the Glue Catalog and database to create the table in. If omitted, this defaults to the AWS Account ID plus the database name. */ readonly catalogId: pulumi.Output; /** * Name of the metadata database where the table metadata resides. For Hive compatibility, this must be all lowercase. */ readonly databaseName: pulumi.Output; /** * Description of the table. */ readonly description: pulumi.Output; /** * Name of the table. For Hive compatibility, this must be entirely lowercase. * * The following arguments are optional: */ readonly name: pulumi.Output; /** * Configuration block for open table formats. See `openTableFormatInput` below. */ readonly openTableFormatInput: pulumi.Output; /** * Owner of the table. */ readonly owner: pulumi.Output; /** * Properties associated with this table, as a map of key-value pairs. */ readonly parameters: pulumi.Output<{ [key: string]: string; }>; /** * Configuration block for a maximum of 3 partition indexes. See `partitionIndex` below. */ readonly partitionIndices: pulumi.Output; /** * Configuration block of columns by which the table is partitioned. Only primitive types are supported as partition keys. See `partitionKeys` below. */ readonly partitionKeys: pulumi.Output; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output; /** * Retention time for this table. */ readonly retention: pulumi.Output; /** * Configuration block for information about the physical storage of this table. For more information, refer to the [Glue Developer Guide](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-tables.html#aws-glue-api-catalog-tables-StorageDescriptor). See `storageDescriptor` below. */ readonly storageDescriptor: pulumi.Output; /** * Type of this table (EXTERNAL_TABLE, VIRTUAL_VIEW, etc.). While optional, some Athena DDL queries such as `ALTER TABLE` and `SHOW CREATE TABLE` will fail if this argument is empty. */ readonly tableType: pulumi.Output; /** * Configuration block of a target table for resource linking. See `targetTable` below. */ readonly targetTable: pulumi.Output; /** * Structure that contains all the information that defines the view, including the dialect or dialects for the view, and the query. See `viewDefinition` below. */ readonly viewDefinition: pulumi.Output; /** * If the table is a view, the expanded text of the view; otherwise null. */ readonly viewExpandedText: pulumi.Output; /** * If the table is a view, the original text of the view; otherwise null. */ readonly viewOriginalText: pulumi.Output; /** * Create a CatalogTable resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: CatalogTableArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering CatalogTable resources. */ export interface CatalogTableState { /** * ARN of the Glue Table. */ arn?: pulumi.Input; /** * ID of the Glue Catalog and database to create the table in. If omitted, this defaults to the AWS Account ID plus the database name. */ catalogId?: pulumi.Input; /** * Name of the metadata database where the table metadata resides. For Hive compatibility, this must be all lowercase. */ databaseName?: pulumi.Input; /** * Description of the table. */ description?: pulumi.Input; /** * Name of the table. For Hive compatibility, this must be entirely lowercase. * * The following arguments are optional: */ name?: pulumi.Input; /** * Configuration block for open table formats. See `openTableFormatInput` below. */ openTableFormatInput?: pulumi.Input; /** * Owner of the table. */ owner?: pulumi.Input; /** * Properties associated with this table, as a map of key-value pairs. */ parameters?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Configuration block for a maximum of 3 partition indexes. See `partitionIndex` below. */ partitionIndices?: pulumi.Input[] | undefined>; /** * Configuration block of columns by which the table is partitioned. Only primitive types are supported as partition keys. See `partitionKeys` below. */ partitionKeys?: pulumi.Input[] | undefined>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * Retention time for this table. */ retention?: pulumi.Input; /** * Configuration block for information about the physical storage of this table. For more information, refer to the [Glue Developer Guide](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-tables.html#aws-glue-api-catalog-tables-StorageDescriptor). See `storageDescriptor` below. */ storageDescriptor?: pulumi.Input; /** * Type of this table (EXTERNAL_TABLE, VIRTUAL_VIEW, etc.). While optional, some Athena DDL queries such as `ALTER TABLE` and `SHOW CREATE TABLE` will fail if this argument is empty. */ tableType?: pulumi.Input; /** * Configuration block of a target table for resource linking. See `targetTable` below. */ targetTable?: pulumi.Input; /** * Structure that contains all the information that defines the view, including the dialect or dialects for the view, and the query. See `viewDefinition` below. */ viewDefinition?: pulumi.Input; /** * If the table is a view, the expanded text of the view; otherwise null. */ viewExpandedText?: pulumi.Input; /** * If the table is a view, the original text of the view; otherwise null. */ viewOriginalText?: pulumi.Input; } /** * The set of arguments for constructing a CatalogTable resource. */ export interface CatalogTableArgs { /** * ID of the Glue Catalog and database to create the table in. If omitted, this defaults to the AWS Account ID plus the database name. */ catalogId?: pulumi.Input; /** * Name of the metadata database where the table metadata resides. For Hive compatibility, this must be all lowercase. */ databaseName: pulumi.Input; /** * Description of the table. */ description?: pulumi.Input; /** * Name of the table. For Hive compatibility, this must be entirely lowercase. * * The following arguments are optional: */ name?: pulumi.Input; /** * Configuration block for open table formats. See `openTableFormatInput` below. */ openTableFormatInput?: pulumi.Input; /** * Owner of the table. */ owner?: pulumi.Input; /** * Properties associated with this table, as a map of key-value pairs. */ parameters?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Configuration block for a maximum of 3 partition indexes. See `partitionIndex` below. */ partitionIndices?: pulumi.Input[] | undefined>; /** * Configuration block of columns by which the table is partitioned. Only primitive types are supported as partition keys. See `partitionKeys` below. */ partitionKeys?: pulumi.Input[] | undefined>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * Retention time for this table. */ retention?: pulumi.Input; /** * Configuration block for information about the physical storage of this table. For more information, refer to the [Glue Developer Guide](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-tables.html#aws-glue-api-catalog-tables-StorageDescriptor). See `storageDescriptor` below. */ storageDescriptor?: pulumi.Input; /** * Type of this table (EXTERNAL_TABLE, VIRTUAL_VIEW, etc.). While optional, some Athena DDL queries such as `ALTER TABLE` and `SHOW CREATE TABLE` will fail if this argument is empty. */ tableType?: pulumi.Input; /** * Configuration block of a target table for resource linking. See `targetTable` below. */ targetTable?: pulumi.Input; /** * Structure that contains all the information that defines the view, including the dialect or dialects for the view, and the query. See `viewDefinition` below. */ viewDefinition?: pulumi.Input; /** * If the table is a view, the expanded text of the view; otherwise null. */ viewExpandedText?: pulumi.Input; /** * If the table is a view, the original text of the view; otherwise null. */ viewOriginalText?: pulumi.Input; } //# sourceMappingURL=catalogTable.d.ts.map