Skip to content

Resource: awsGluePartitionIndex

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsGlueCatalogDatabaseExample =
  new aws.glueCatalogDatabase.GlueCatalogDatabase(this, "example", {
    name: "example",
  });
const awsGlueCatalogTableExample = new aws.glueCatalogTable.GlueCatalogTable(
  this,
  "example_1",
  {
    databaseName: awsGlueCatalogDatabaseExample.name,
    name: "example",
    owner: "my_owner",
    parameters: {
      param1: "param1_val",
    },
    partitionKeys: [
      {
        comment: "my_column_1_comment",
        name: "my_column_1",
        type: "int",
      },
      {
        comment: "my_column_2_comment",
        name: "my_column_2",
        type: "string",
      },
    ],
    retention: 1,
    storageDescriptor: {
      bucketColumns: ["bucket_column_1"],
      columns: [
        {
          comment: "my_column1_comment",
          name: "my_column_1",
          type: "int",
        },
        {
          comment: "my_column2_comment",
          name: "my_column_2",
          type: "string",
        },
      ],
      compressed: false,
      inputFormat: "SequenceFileInputFormat",
      location: "my_location",
      numberOfBuckets: 1,
      outputFormat: "SequenceFileInputFormat",
      parameters: {
        param1: "param1_val",
      },
      serDeInfo: {
        name: "ser_de_name",
        parameters: {
          param1: "param_val_1",
        },
        serializationLibrary:
          "org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe",
      },
      skewedInfo: {
        skewedColumnNames: ["my_column_1"],
        skewedColumnValueLocationMaps: {
          myColumn1: "my_column_1_val_loc_map",
        },
        skewedColumnValues: ["skewed_val_1"],
      },
      sortColumns: [
        {
          column: "my_column_1",
          sortOrder: 1,
        },
      ],
      storedAsSubDirectories: false,
    },
    tableType: "VIRTUAL_VIEW",
    viewExpandedText: "view_expanded_text_1",
    viewOriginalText: "view_original_text_1",
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsGlueCatalogTableExample.overrideLogicalId("example");
const awsGluePartitionIndexExample =
  new aws.gluePartitionIndex.GluePartitionIndex(this, "example_2", {
    databaseName: awsGlueCatalogDatabaseExample.name,
    partitionIndex: {
      indexName: "example",
      keys: ["my_column_1", "my_column_2"],
    },
    tableName: awsGlueCatalogTableExample.name,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsGluePartitionIndexExample.overrideLogicalId("example");

Argument Reference

The following arguments are required:

  • tableName - (Required) Name of the table. For Hive compatibility, this must be entirely lowercase.
  • databaseName - (Required) Name of the metadata database where the table metadata resides. For Hive compatibility, this must be all lowercase.
  • partitionIndex - (Required) Configuration block for a partition index. See partitionIndex below.
  • catalogId - (Optional) The catalog ID where the table resides.

partitionIndex

  • indexName - (Required) Name of the partition index.
  • keys - (Required) Keys for the partition index.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - Catalog ID, Database name, table name, and index name.

Timeouts

Configuration options:

  • create - (Default 10M)
  • delete - (Default 10M)

Import

Glue Partition Indexes can be imported with their catalog ID (usually AWS account ID), database name, table name, and index name, e.g.,

$ terraform import aws_glue_partition_index.example 123456789012:MyDatabase:MyTable:index-name