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_idoptional computed - string -
creation_timeoptional computed - string -
database_namerequired - string -
idoptional computed - string -
last_accessed_timeoptional computed - string -
last_analyzed_timeoptional computed - string -
parametersoptional - map from string to string -
partition_valuesrequired - list of string -
table_namerequired - string -
storage_descriptorlist block-
bucket_columnsoptional - list of string -
compressedoptional - bool -
input_formatoptional - string -
locationoptional - string -
number_of_bucketsoptional - number -
output_formatoptional - string -
parametersoptional - map from string to string -
stored_as_sub_directoriesoptional - bool -
columnslist block -
ser_de_infolist block-
nameoptional - string -
parametersoptional - map from string to string -
serialization_libraryoptional - string
-
-
skewed_infolist block-
skewed_column_namesoptional - list of string -
skewed_column_value_location_mapsoptional - map from string to string -
skewed_column_valuesoptional - list of string
-
-
sort_columnslist block-
columnrequired - string -
sort_orderrequired - 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
-
TableNamerequired - String -
DatabaseNamerequired - String -
CatalogIdrequired - String -
PartitionInputrequired - PartitionInput
Explanation in CloudFormation Registry
The
AWS::Glue::Partitionresource 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.