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
-
arn
optional computed - string -
catalog_id
optional computed - string -
database_name
required - string -
description
optional - string -
id
optional computed - string -
name
required - string -
owner
optional - string -
parameters
optional - map from string to string -
retention
optional - number -
table_type
optional - string -
view_expanded_text
optional - string -
view_original_text
optional - string -
partition_index
list block-
index_name
required - string -
index_status
optional computed - string -
keys
required - set of string
-
-
partition_keys
list block -
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-
comment
optional - string -
name
required - string -
parameters
optional - map from string to string -
type
optional - string
-
-
schema_reference
list block-
schema_version_id
optional - string -
schema_version_number
required - number -
schema_id
list block-
registry_name
optional - string -
schema_arn
optional - string -
schema_name
optional - string
-
-
-
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 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
-
TableInput
required - TableInput -
DatabaseName
required - String -
CatalogId
required - String
Explanation in CloudFormation Registry
The
AWS::Glue::Table
resource 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.