AWS Glue Partition
This page shows how to write Terraform and CloudFormation for AWS Glue Partition and write them securely.
aws_glue_partition (Terraform)
The Partition in AWS Glue can be configured in Terraform with the resource name aws_glue_partition
. The following sections describe 1 example of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_glue_partition" "glue_partition" {
count = var.enable_glue_partition ? 1 : 0
database_name = var.glue_partition_database_name != "" ? var.glue_partition_database_name : (var.enable_glue_catalog_database ? aws_glue_catalog_database.glue_catalog_database[0].name : null)
table_name = var.glue_partition_table_name != "" ? var.glue_partition_table_name : (var.enable_glue_catalog_table ? aws_glue_catalog_table.glue_catalog_table[0].name : null)
partition_values = var.glue_partition_partition_values
Parameters
-
catalog_id
optional computed - string -
creation_time
optional computed - string -
database_name
required - string -
id
optional computed - string -
last_accessed_time
optional computed - string -
last_analyzed_time
optional computed - string -
parameters
optional - map from string to string -
partition_values
required - list of string -
table_name
required - string -
storage_descriptor
list block-
bucket_columns
optional - list of string -
compressed
optional - bool -
input_format
optional - string -
location
optional - string -
number_of_buckets
optional - number -
output_format
optional - string -
parameters
optional - map from string to string -
stored_as_sub_directories
optional - bool -
columns
list block -
ser_de_info
list block-
name
optional - string -
parameters
optional - map from string to string -
serialization_library
optional - string
-
-
skewed_info
list block-
skewed_column_names
optional - list of string -
skewed_column_value_location_maps
optional - map from string to string -
skewed_column_values
optional - list of string
-
-
sort_columns
list block-
column
required - string -
sort_order
required - number
-
-
Explanation in Terraform Registry
Provides a Glue Partition Resource.
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
Type: AWS::Glue::Partition
Properties:
CatalogId: String
DatabaseName: String
PartitionInput:
PartitionInput
Type: AWS::Glue::Partition
Properties:
CatalogId: !Ref AWS::AccountId
DatabaseName: !Ref testdb
TableName: !Ref Table1
PartitionInput:
Type: AWS::Glue::Partition
Properties:
CatalogId: !Ref AWS::AccountId
DatabaseName: !Ref CFNDatabaseName
TableName: !Ref CFNTableName1
PartitionInput:
Type: AWS::Glue::Partition
Properties:
CatalogId: !Ref AWS::AccountId
DatabaseName: !Ref TestDB
TableName: !Ref Table1
PartitionInput:
Type: AWS::Glue::Partition
Properties:
CatalogId: !Ref AWS::AccountId
DatabaseName: !Ref DatabaseName
TableName: !Ref TableName
PartitionInput:
"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",
"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",
"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",
"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",
"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
-
TableName
required - String -
DatabaseName
required - String -
CatalogId
required - String -
PartitionInput
required - PartitionInput
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?
AWS Glue Partition 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?
For Terraform, the SebastianUA/terraform-aws-glue source code example is useful. See the Terraform Example section for further details.
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.