AWS Glue Catalog Table
This page shows how to write Terraform and CloudFormation for AWS Glue Catalog Table and write them securely.
aws_glue_catalog_table (Terraform)
The Catalog Table in AWS Glue can be configured in Terraform with the resource name aws_glue_catalog_table. The following sections describe 4 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_glue_catalog_table" "fbad_table" {
name = var.fbad_table_name
database_name = aws_glue_catalog_database.database.name
table_type = "EXTERNAL_TABLE"
resource "aws_glue_catalog_table" "glue_aircrafts_table" {
name = "aircrafts"
database_name = aws_glue_catalog_database.glue_flights_analyser_database.name
storage_descriptor {
columns {
resource "aws_glue_catalog_table" "fbad_table" {
name = var.fbad_table_name
database_name = aws_glue_catalog_database.database.name
table_type = "EXTERNAL_TABLE"
resource "aws_glue_catalog_table" "csv_table" {
count = (var.source_type == "csv") ? 1 : 0
name = var.table_name
database_name = var.database_name
table_type = "EXTERNAL_TABLE"
Parameters
-
arnoptional computed - string -
catalog_idoptional computed - string -
database_namerequired - string -
descriptionoptional - string -
idoptional computed - string -
namerequired - string -
owneroptional - string -
parametersoptional - map from string to string -
retentionoptional - number -
table_typeoptional - string -
view_expanded_textoptional - string -
view_original_textoptional - string -
partition_indexlist block-
index_namerequired - string -
index_statusoptional computed - string -
keysrequired - set of string
-
-
partition_keyslist block -
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-
commentoptional - string -
namerequired - string -
parametersoptional - map from string to string -
typeoptional - string
-
-
schema_referencelist block-
schema_version_idoptional - string -
schema_version_numberrequired - number -
schema_idlist block-
registry_nameoptional - string -
schema_arnoptional - string -
schema_nameoptional - string
-
-
-
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 Catalog Table Resource. You can refer to the Glue Developer Guide for a full explanation of the Glue Data Catalog functionality.
AWS::Glue::Table (CloudFormation)
The Table in Glue can be configured in CloudFormation with the resource name AWS::Glue::Table. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
# Type: AWS::Glue::Table
# Properties:
# CatalogId: !Ref AWS::AccountId
# DatabaseName: !Ref CompanyDatabase
# TableInput:
# Name: ${self:custom.employees_table}
Type: 'AWS::Glue::Table'
Properties:
DatabaseName:
Ref: SecGlueDatabase
CatalogId:
Ref: 'AWS::AccountId'
Type: AWS::Glue::Table
DeletionPolicy: Retain
Properties:
CatalogId: !Ref AWS::AccountId
DatabaseName: !Sub ${Database}
TableInput:
Type: AWS::Glue::Table
DeletionPolicy: Retain
Properties:
CatalogId: !Ref AWS::AccountId
DatabaseName: !Sub ${Database}
TableInput:
Type: AWS::Glue::Table
DeletionPolicy: Retain
Properties:
CatalogId: !Ref AWS::AccountId
DatabaseName: !Sub ${Database}
TableInput:
"Type": "AWS::Glue::Table",
"Properties": {
"CatalogId": {
"Ref": "AWS::AccountId"
},
"DatabaseName": {
"Type": "AWS::Glue::Table",
"Properties": {
"CatalogId": {
"Ref": "AWS::AccountId"
},
"DatabaseName": {
"Type": "AWS::Glue::Table",
"Properties": {
"CatalogId": {
"Ref": "AWS::AccountId"
},
"DatabaseName": {
"Type": "AWS::Glue::Table",
"Properties": {
"CatalogId": {
"Ref": "AWS::AccountId"
},
"DatabaseName": {
"Type": "AWS::Glue::Table",
"Properties": {
"CatalogId": {
"Ref": "AWS::AccountId"
},
"DatabaseName": {
Parameters
-
TableInputrequired - TableInput -
DatabaseNamerequired - String -
CatalogIdrequired - String
Explanation in CloudFormation Registry
The
AWS::Glue::Tableresource specifies tabular data in the AWS Glue data catalog. For more information, see Defining Tables in the AWS Glue Data Catalog and Table Structure in the AWS Glue Developer Guide.
Frequently asked questions
What is AWS Glue Catalog Table?
AWS Glue Catalog Table 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 Catalog Table?
For Terraform, the devopsbynaresh/datalake-alsac, piotsik/flights_analyser and devopsbynaresh/infrastructure-alsac source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the edgar-quiroz/aws_data_platform, tradle/mycloud and KazuyaOnda/create-s3-bucket source code examples are useful. See the CloudFormation Example section for further details.