AWS Glue Partition Index

This page shows how to write Terraform and CloudFormation for AWS Glue Partition Index and write them securely.

aws_glue_partition_index (Terraform)

The Partition Index in AWS Glue can be configured in Terraform with the resource name aws_glue_partition_index. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

The following arguments are required:

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

partition_index

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

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

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

Explanation in Terraform Registry

AWS::Glue::Partition (CloudFormation)

The Partition in Glue can be configured in CloudFormation with the resource name AWS::Glue::Partition. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

template.yml#L9
    Type: AWS::Glue::Partition
    Properties:
      CatalogId: String
      DatabaseName: String
      PartitionInput:
        PartitionInput
CF%20Template-data-lake-resource-deploy.yml#L84
    Type: AWS::Glue::Partition
    Properties:
      CatalogId: !Ref AWS::AccountId
      DatabaseName: !Ref testdb
      TableName: !Ref Table1
      PartitionInput:
CFNGlueDatabaseTablePartition.yml#L69
    Type: AWS::Glue::Partition
    Properties:
      CatalogId: !Ref AWS::AccountId
      DatabaseName: !Ref CFNDatabaseName
      TableName: !Ref CFNTableName1
      PartitionInput:
glutable.yml#L68
    Type: AWS::Glue::Partition
    Properties:
      CatalogId: !Ref AWS::AccountId
      DatabaseName: !Ref TestDB
      TableName: !Ref Table1
      PartitionInput:
template2.yml#L103
    Type: AWS::Glue::Partition
    Properties:
      CatalogId: !Ref AWS::AccountId
      DatabaseName: !Ref DatabaseName
      TableName: !Ref TableName
      PartitionInput:
GluePartitionSpecification.json#L3
    "AWS::Glue::Partition.StorageDescriptor": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-partition-storagedescriptor.html",
      "Properties": {
        "StoredAsSubDirectories": {
          "Required": false,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-partition-storagedescriptor.html#cfn-glue-partition-storagedescriptor-storedassubdirectories",
GluePartitionSpecification.json#L3
    "AWS::Glue::Partition.StorageDescriptor": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-partition-storagedescriptor.html",
      "Properties": {
        "StoredAsSubDirectories": {
          "Required": false,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-partition-storagedescriptor.html#cfn-glue-partition-storagedescriptor-storedassubdirectories",
GluePartitionSpecification.json#L3
    "AWS::Glue::Partition.StorageDescriptor": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-partition-storagedescriptor.html",
      "Properties": {
        "StoredAsSubDirectories": {
          "Required": false,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-partition-storagedescriptor.html#cfn-glue-partition-storagedescriptor-storedassubdirectories",
GluePartitionSpecification.json#L3
    "AWS::Glue::Partition.StorageDescriptor": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-partition-storagedescriptor.html",
      "Properties": {
        "StoredAsSubDirectories": {
          "Required": false,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-partition-storagedescriptor.html#cfn-glue-partition-storagedescriptor-storedassubdirectories",
GluePartitionSpecification.json#L3
    "AWS::Glue::Partition.StorageDescriptor": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-partition-storagedescriptor.html",
      "Properties": {
        "StoredAsSubDirectories": {
          "Required": false,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-partition-storagedescriptor.html#cfn-glue-partition-storagedescriptor-storedassubdirectories",

Parameters

Explanation in CloudFormation Registry

The AWS::Glue::Partition resource creates an AWS Glue partition, which represents a slice of table data. For more information, see CreatePartition Action and Partition Structure in the AWS Glue Developer Guide.

Frequently asked questions

What is AWS Glue Partition Index?

AWS Glue Partition Index is a resource for Glue of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Glue Partition Index?

For CloudFormation, the MohamedMesrah/SAM-Resources, godwillngwanah/AWS-Sol-Arch-02 and RittikaJ/awssync source code examples are useful. See the CloudFormation Example section for further details.