CatalogTable class
Provides a Glue Catalog Table Resource. You can refer to the Glue Developer Guide for a full explanation of the Glue Data Catalog functionality.
Example Usage
Basic Table
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.glue.CatalogTable("example", {
name: "MyCatalogTable",
databaseName: "MyCatalogDatabase",
});
import pulumi
import pulumi_aws as aws
example = aws.glue.CatalogTable("example",
name="MyCatalogTable",
database_name="MyCatalogDatabase")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Glue.CatalogTable("example", new()
{
Name = "MyCatalogTable",
DatabaseName = "MyCatalogDatabase",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/glue"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := glue.NewCatalogTable(ctx, "example", &glue.CatalogTableArgs{
Name: pulumi.String("MyCatalogTable"),
DatabaseName: pulumi.String("MyCatalogDatabase"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_glue_catalogtable" "example" {
name = "MyCatalogTable"
database_name = "MyCatalogDatabase"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.glue.CatalogTable;
import com.pulumi.aws.glue.CatalogTableArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new CatalogTable("example", CatalogTableArgs.builder()
.name("MyCatalogTable")
.databaseName("MyCatalogDatabase")
.build());
}
}
resources:
example:
type: aws:glue:CatalogTable
properties:
name: MyCatalogTable
databaseName: MyCatalogDatabase
Parquet Table for Athena
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.glue.CatalogTable("example", {
storageDescriptor: {
serDeInfo: {
name: "my-stream",
serializationLibrary: "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe",
parameters: {
"serialization.format": "1",
},
},
columns: [
{
name: "my_string",
type: "string",
},
{
name: "my_double",
type: "double",
},
{
name: "my_date",
type: "date",
comment: "",
},
{
name: "my_bigint",
type: "bigint",
comment: "",
},
{
name: "my_struct",
type: "struct<my_nested_string:string>",
comment: "",
},
],
location: "s3://my-bucket/event-streams/my-stream",
inputFormat: "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat",
outputFormat: "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat",
},
name: "MyCatalogTable",
databaseName: "MyCatalogDatabase",
tableType: "EXTERNAL_TABLE",
parameters: {
EXTERNAL: "TRUE",
"parquet.compression": "SNAPPY",
},
});
import pulumi
import pulumi_aws as aws
example = aws.glue.CatalogTable("example",
storage_descriptor={
"ser_de_info": {
"name": "my-stream",
"serialization_library": "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe",
"parameters": {
"serialization.format": "1",
},
},
"columns": [
{
"name": "my_string",
"type": "string",
},
{
"name": "my_double",
"type": "double",
},
{
"name": "my_date",
"type": "date",
"comment": "",
},
{
"name": "my_bigint",
"type": "bigint",
"comment": "",
},
{
"name": "my_struct",
"type": "struct<my_nested_string:string>",
"comment": "",
},
],
"location": "s3://my-bucket/event-streams/my-stream",
"input_format": "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat",
"output_format": "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat",
},
name="MyCatalogTable",
database_name="MyCatalogDatabase",
table_type="EXTERNAL_TABLE",
parameters={
"EXTERNAL": "TRUE",
"parquet.compression": "SNAPPY",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Glue.CatalogTable("example", new()
{
StorageDescriptor = new Aws.Glue.Inputs.CatalogTableStorageDescriptorArgs
{
SerDeInfo = new Aws.Glue.Inputs.CatalogTableStorageDescriptorSerDeInfoArgs
{
Name = "my-stream",
SerializationLibrary = "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe",
Parameters =
{
{ "serialization.format", "1" },
},
},
Columns = new[]
{
new Aws.Glue.Inputs.CatalogTableStorageDescriptorColumnArgs
{
Name = "my_string",
Type = "string",
},
new Aws.Glue.Inputs.CatalogTableStorageDescriptorColumnArgs
{
Name = "my_double",
Type = "double",
},
new Aws.Glue.Inputs.CatalogTableStorageDescriptorColumnArgs
{
Name = "my_date",
Type = "date",
Comment = "",
},
new Aws.Glue.Inputs.CatalogTableStorageDescriptorColumnArgs
{
Name = "my_bigint",
Type = "bigint",
Comment = "",
},
new Aws.Glue.Inputs.CatalogTableStorageDescriptorColumnArgs
{
Name = "my_struct",
Type = "struct<my_nested_string:string>",
Comment = "",
},
},
Location = "s3://my-bucket/event-streams/my-stream",
InputFormat = "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat",
OutputFormat = "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat",
},
Name = "MyCatalogTable",
DatabaseName = "MyCatalogDatabase",
TableType = "EXTERNAL_TABLE",
Parameters =
{
{ "EXTERNAL", "TRUE" },
{ "parquet.compression", "SNAPPY" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/glue"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := glue.NewCatalogTable(ctx, "example", &glue.CatalogTableArgs{
StorageDescriptor: &glue.CatalogTableStorageDescriptorArgs{
SerDeInfo: &glue.CatalogTableStorageDescriptorSerDeInfoArgs{
Name: pulumi.String("my-stream"),
SerializationLibrary: pulumi.String("org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe"),
Parameters: pulumi.StringMap{
"serialization.format": pulumi.String("1"),
},
},
Columns: glue.CatalogTableStorageDescriptorColumnArray{
&glue.CatalogTableStorageDescriptorColumnArgs{
Name: pulumi.String("my_string"),
Type: pulumi.String("string"),
},
&glue.CatalogTableStorageDescriptorColumnArgs{
Name: pulumi.String("my_double"),
Type: pulumi.String("double"),
},
&glue.CatalogTableStorageDescriptorColumnArgs{
Name: pulumi.String("my_date"),
Type: pulumi.String("date"),
Comment: pulumi.String(""),
},
&glue.CatalogTableStorageDescriptorColumnArgs{
Name: pulumi.String("my_bigint"),
Type: pulumi.String("bigint"),
Comment: pulumi.String(""),
},
&glue.CatalogTableStorageDescriptorColumnArgs{
Name: pulumi.String("my_struct"),
Type: pulumi.String("struct<my_nested_string:string>"),
Comment: pulumi.String(""),
},
},
Location: pulumi.String("s3://my-bucket/event-streams/my-stream"),
InputFormat: pulumi.String("org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat"),
OutputFormat: pulumi.String("org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat"),
},
Name: pulumi.String("MyCatalogTable"),
DatabaseName: pulumi.String("MyCatalogDatabase"),
TableType: pulumi.String("EXTERNAL_TABLE"),
Parameters: pulumi.StringMap{
"EXTERNAL": pulumi.String("TRUE"),
"parquet.compression": pulumi.String("SNAPPY"),
},
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_glue_catalogtable" "example" {
storage_descriptor = {
ser_de_info = {
name = "my-stream"
serialization_library = "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe"
parameters = {
"serialization.format" = 1
}
}
columns = [{
"name" = "my_string"
"type" = "string"
}, {
"name" = "my_double"
"type" = "double"
}, {
"name" = "my_date"
"type" = "date"
"comment" = ""
}, {
"name" = "my_bigint"
"type" = "bigint"
"comment" = ""
}, {
"name" = "my_struct"
"type" = "struct<my_nested_string:string>"
"comment" = ""
}]
location = "s3://my-bucket/event-streams/my-stream"
input_format = "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat"
output_format = "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat"
}
name = "MyCatalogTable"
database_name = "MyCatalogDatabase"
table_type = "EXTERNAL_TABLE"
parameters = {
"EXTERNAL" = "TRUE"
"parquet.compression" = "SNAPPY"
}
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.glue.CatalogTable;
import com.pulumi.aws.glue.CatalogTableArgs;
import com.pulumi.aws.glue.inputs.CatalogTableStorageDescriptorArgs;
import com.pulumi.aws.glue.inputs.CatalogTableStorageDescriptorSerDeInfoArgs;
import com.pulumi.aws.glue.inputs.CatalogTableStorageDescriptorColumnArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new CatalogTable("example", CatalogTableArgs.builder()
.storageDescriptor(CatalogTableStorageDescriptorArgs.builder()
.serDeInfo(CatalogTableStorageDescriptorSerDeInfoArgs.builder()
.name("my-stream")
.serializationLibrary("org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe")
.parameters(Map.of("serialization.format", "1"))
.build())
.columns(
CatalogTableStorageDescriptorColumnArgs.builder()
.name("my_string")
.type("string")
.build(),
CatalogTableStorageDescriptorColumnArgs.builder()
.name("my_double")
.type("double")
.build(),
CatalogTableStorageDescriptorColumnArgs.builder()
.name("my_date")
.type("date")
.comment("")
.build(),
CatalogTableStorageDescriptorColumnArgs.builder()
.name("my_bigint")
.type("bigint")
.comment("")
.build(),
CatalogTableStorageDescriptorColumnArgs.builder()
.name("my_struct")
.type("struct<my_nested_string:string>")
.comment("")
.build())
.location("s3://my-bucket/event-streams/my-stream")
.inputFormat("org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat")
.outputFormat("org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat")
.build())
.name("MyCatalogTable")
.databaseName("MyCatalogDatabase")
.tableType("EXTERNAL_TABLE")
.parameters(Map.ofEntries(
Map.entry("EXTERNAL", "TRUE"),
Map.entry("parquet.compression", "SNAPPY")
))
.build());
}
}
resources:
example:
type: aws:glue:CatalogTable
properties:
storageDescriptor:
serDeInfo:
name: my-stream
serializationLibrary: org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe
parameters:
serialization.format: 1
columns:
- name: my_string
type: string
- name: my_double
type: double
- name: my_date
type: date
comment: ""
- name: my_bigint
type: bigint
comment: ""
- name: my_struct
type: struct<my_nested_string:string>
comment: ""
location: s3://my-bucket/event-streams/my-stream
inputFormat: org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat
outputFormat: org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat
name: MyCatalogTable
databaseName: MyCatalogDatabase
tableType: EXTERNAL_TABLE
parameters:
EXTERNAL: TRUE
parquet.compression: SNAPPY
Iceberg Table
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.glue.CatalogTable("example", {
openTableFormatInput: {
icebergInput: {
icebergTableInput: {
schema: {
fields: [
{
id: 1,
name: "transaction_id",
required: true,
type: " \\\"string\\\"\n",
},
{
id: 2,
name: "transaction_date",
required: true,
type: " \\\"date\\\"\n",
},
{
id: 3,
name: "monthly_balance",
required: true,
type: " \\\"float\\\"\n",
},
],
schemaId: 0,
type: "struct",
},
partitionSpec: {
fields: [{
name: "by_year",
sourceId: 2,
transform: "year",
}],
specId: 0,
},
sortOrder: {
fields: [{
direction: "asc",
nullOrder: "nulls-last",
sourceId: 1,
transform: "none",
}],
orderId: 1,
},
location: "s3://sampledatabucket/bankdataiceberg/transactiontable1/",
},
metadataOperation: "CREATE",
version: "2",
},
},
name: "transactiontable1",
databaseName: "bankdata_icebergdb",
});
import pulumi
import pulumi_aws as aws
example = aws.glue.CatalogTable("example",
open_table_format_input={
"iceberg_input": {
"iceberg_table_input": {
"schema": {
"fields": [
{
"id": 1,
"name": "transaction_id",
"required": True,
"type": " \\\"string\\\"\n",
},
{
"id": 2,
"name": "transaction_date",
"required": True,
"type": " \\\"date\\\"\n",
},
{
"id": 3,
"name": "monthly_balance",
"required": True,
"type": " \\\"float\\\"\n",
},
],
"schema_id": 0,
"type": "struct",
},
"partition_spec": {
"fields": [{
"name": "by_year",
"source_id": 2,
"transform": "year",
}],
"spec_id": 0,
},
"sort_order": {
"fields": [{
"direction": "asc",
"null_order": "nulls-last",
"source_id": 1,
"transform": "none",
}],
"order_id": 1,
},
"location": "s3://sampledatabucket/bankdataiceberg/transactiontable1/",
},
"metadata_operation": "CREATE",
"version": "2",
},
},
name="transactiontable1",
database_name="bankdata_icebergdb")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Glue.CatalogTable("example", new()
{
OpenTableFormatInput = new Aws.Glue.Inputs.CatalogTableOpenTableFormatInputArgs
{
IcebergInput = new Aws.Glue.Inputs.CatalogTableOpenTableFormatInputIcebergInputArgs
{
IcebergTableInput = new Aws.Glue.Inputs.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputArgs
{
Schema = new Aws.Glue.Inputs.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSchemaArgs
{
Fields = new[]
{
new Aws.Glue.Inputs.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSchemaFieldArgs
{
Id = 1,
Name = "transaction_id",
Required = true,
Type = @" \""string\""
",
},
new Aws.Glue.Inputs.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSchemaFieldArgs
{
Id = 2,
Name = "transaction_date",
Required = true,
Type = @" \""date\""
",
},
new Aws.Glue.Inputs.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSchemaFieldArgs
{
Id = 3,
Name = "monthly_balance",
Required = true,
Type = @" \""float\""
",
},
},
SchemaId = 0,
Type = "struct",
},
PartitionSpec = new Aws.Glue.Inputs.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputPartitionSpecArgs
{
Fields = new[]
{
new Aws.Glue.Inputs.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputPartitionSpecFieldArgs
{
Name = "by_year",
SourceId = 2,
Transform = "year",
},
},
SpecId = 0,
},
SortOrder = new Aws.Glue.Inputs.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSortOrderArgs
{
Fields = new[]
{
new Aws.Glue.Inputs.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSortOrderFieldArgs
{
Direction = "asc",
NullOrder = "nulls-last",
SourceId = 1,
Transform = "none",
},
},
OrderId = 1,
},
Location = "s3://sampledatabucket/bankdataiceberg/transactiontable1/",
},
MetadataOperation = "CREATE",
Version = "2",
},
},
Name = "transactiontable1",
DatabaseName = "bankdata_icebergdb",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/glue"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := glue.NewCatalogTable(ctx, "example", &glue.CatalogTableArgs{
OpenTableFormatInput: &glue.CatalogTableOpenTableFormatInputArgs{
IcebergInput: &glue.CatalogTableOpenTableFormatInputIcebergInputArgs{
IcebergTableInput: &glue.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputArgs{
Schema: &glue.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSchemaArgs{
Fields: glue.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSchemaFieldArray{
&glue.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSchemaFieldArgs{
Id: pulumi.Int(1),
Name: pulumi.String("transaction_id"),
Required: pulumi.Bool(true),
Type: pulumi.String(" \\\"string\\\"\n"),
},
&glue.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSchemaFieldArgs{
Id: pulumi.Int(2),
Name: pulumi.String("transaction_date"),
Required: pulumi.Bool(true),
Type: pulumi.String(" \\\"date\\\"\n"),
},
&glue.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSchemaFieldArgs{
Id: pulumi.Int(3),
Name: pulumi.String("monthly_balance"),
Required: pulumi.Bool(true),
Type: pulumi.String(" \\\"float\\\"\n"),
},
},
SchemaId: pulumi.Int(0),
Type: pulumi.String("struct"),
},
PartitionSpec: &glue.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputPartitionSpecArgs{
Fields: glue.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputPartitionSpecFieldArray{
&glue.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputPartitionSpecFieldArgs{
Name: pulumi.String("by_year"),
SourceId: pulumi.Int(2),
Transform: pulumi.String("year"),
},
},
SpecId: pulumi.Int(0),
},
SortOrder: &glue.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSortOrderArgs{
Fields: glue.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSortOrderFieldArray{
&glue.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSortOrderFieldArgs{
Direction: pulumi.String("asc"),
NullOrder: pulumi.String("nulls-last"),
SourceId: pulumi.Int(1),
Transform: pulumi.String("none"),
},
},
OrderId: pulumi.Int(1),
},
Location: pulumi.String("s3://sampledatabucket/bankdataiceberg/transactiontable1/"),
},
MetadataOperation: pulumi.String("CREATE"),
Version: pulumi.String("2"),
},
},
Name: pulumi.String("transactiontable1"),
DatabaseName: pulumi.String("bankdata_icebergdb"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_glue_catalogtable" "example" {
open_table_format_input = {
iceberg_input = {
iceberg_table_input = {
schema = {
fields = [{
"id" = 1
"name" = "transaction_id"
"required" = true
"type" = " \\\"string\\\"\n"
}, {
"id" = 2
"name" = "transaction_date"
"required" = true
"type" = " \\\"date\\\"\n"
}, {
"id" = 3
"name" = "monthly_balance"
"required" = true
"type" = " \\\"float\\\"\n"
}]
schema_id = 0
type = "struct"
}
partition_spec = {
fields = [{
"name" = "by_year"
"sourceId" = 2
"transform" = "year"
}]
spec_id = 0
}
sort_order = {
fields = [{
"direction" = "asc"
"nullOrder" = "nulls-last"
"sourceId" = 1
"transform" = "none"
}]
order_id = 1
}
location = "s3://sampledatabucket/bankdataiceberg/transactiontable1/"
}
metadata_operation = "CREATE"
version = 2
}
}
name = "transactiontable1"
database_name = "bankdata_icebergdb"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.glue.CatalogTable;
import com.pulumi.aws.glue.CatalogTableArgs;
import com.pulumi.aws.glue.inputs.CatalogTableOpenTableFormatInputArgs;
import com.pulumi.aws.glue.inputs.CatalogTableOpenTableFormatInputIcebergInputArgs;
import com.pulumi.aws.glue.inputs.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputArgs;
import com.pulumi.aws.glue.inputs.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSchemaArgs;
import com.pulumi.aws.glue.inputs.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSchemaFieldArgs;
import com.pulumi.aws.glue.inputs.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputPartitionSpecArgs;
import com.pulumi.aws.glue.inputs.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputPartitionSpecFieldArgs;
import com.pulumi.aws.glue.inputs.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSortOrderArgs;
import com.pulumi.aws.glue.inputs.CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSortOrderFieldArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new CatalogTable("example", CatalogTableArgs.builder()
.openTableFormatInput(CatalogTableOpenTableFormatInputArgs.builder()
.icebergInput(CatalogTableOpenTableFormatInputIcebergInputArgs.builder()
.icebergTableInput(CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputArgs.builder()
.schema(CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSchemaArgs.builder()
.fields(
CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSchemaFieldArgs.builder()
.id(1)
.name("transaction_id")
.required(true)
.type("""
\"string\"
""")
.build(),
CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSchemaFieldArgs.builder()
.id(2)
.name("transaction_date")
.required(true)
.type("""
\"date\"
""")
.build(),
CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSchemaFieldArgs.builder()
.id(3)
.name("monthly_balance")
.required(true)
.type("""
\"float\"
""")
.build())
.schemaId(0)
.type("struct")
.build())
.partitionSpec(CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputPartitionSpecArgs.builder()
.fields(CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputPartitionSpecFieldArgs.builder()
.name("by_year")
.sourceId(2)
.transform("year")
.build())
.specId(0)
.build())
.sortOrder(CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSortOrderArgs.builder()
.fields(CatalogTableOpenTableFormatInputIcebergInputIcebergTableInputSortOrderFieldArgs.builder()
.direction("asc")
.nullOrder("nulls-last")
.sourceId(1)
.transform("none")
.build())
.orderId(1)
.build())
.location("s3://sampledatabucket/bankdataiceberg/transactiontable1/")
.build())
.metadataOperation("CREATE")
.version("2")
.build())
.build())
.name("transactiontable1")
.databaseName("bankdata_icebergdb")
.build());
}
}
resources:
example:
type: aws:glue:CatalogTable
properties:
openTableFormatInput:
icebergInput:
icebergTableInput:
schema:
fields:
- id: 1
name: transaction_id
required: true
type: |2
\"string\"
- id: 2
name: transaction_date
required: true
type: |2
\"date\"
- id: 3
name: monthly_balance
required: true
type: |2
\"float\"
schemaId: 0
type: struct
partitionSpec:
fields:
- name: by_year
sourceId: 2
transform: year
specId: 0
sortOrder:
fields:
- direction: asc
nullOrder: nulls-last
sourceId: 1
transform: none
orderId: 1
location: s3://sampledatabucket/bankdataiceberg/transactiontable1/
metadataOperation: CREATE
version: 2
name: transactiontable1
databaseName: bankdata_icebergdb
Protected View
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.glue.CatalogTable("example", {
viewDefinition: {
representations: [{
dialect: "ATHENA",
dialectVersion: "3",
viewOriginalText: "SELECT * FROM catalog_database.base_table",
validationConnection: exampleAwsGlueConnection.name,
}],
isProtected: true,
},
name: "multidialect_view",
databaseName: "catalog_database",
tableType: "VIRTUAL_VIEW",
});
import pulumi
import pulumi_aws as aws
example = aws.glue.CatalogTable("example",
view_definition={
"representations": [{
"dialect": "ATHENA",
"dialect_version": "3",
"view_original_text": "SELECT * FROM catalog_database.base_table",
"validation_connection": example_aws_glue_connection["name"],
}],
"is_protected": True,
},
name="multidialect_view",
database_name="catalog_database",
table_type="VIRTUAL_VIEW")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Glue.CatalogTable("example", new()
{
ViewDefinition = new Aws.Glue.Inputs.CatalogTableViewDefinitionArgs
{
Representations = new[]
{
new Aws.Glue.Inputs.CatalogTableViewDefinitionRepresentationArgs
{
Dialect = "ATHENA",
DialectVersion = "3",
ViewOriginalText = "SELECT * FROM catalog_database.base_table",
ValidationConnection = exampleAwsGlueConnection.Name,
},
},
IsProtected = true,
},
Name = "multidialect_view",
DatabaseName = "catalog_database",
TableType = "VIRTUAL_VIEW",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/glue"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := glue.NewCatalogTable(ctx, "example", &glue.CatalogTableArgs{
ViewDefinition: &glue.CatalogTableViewDefinitionArgs{
Representations: glue.CatalogTableViewDefinitionRepresentationArray{
&glue.CatalogTableViewDefinitionRepresentationArgs{
Dialect: pulumi.String("ATHENA"),
DialectVersion: pulumi.String("3"),
ViewOriginalText: pulumi.String("SELECT * FROM catalog_database.base_table"),
ValidationConnection: pulumi.Any(exampleAwsGlueConnection.Name),
},
},
IsProtected: pulumi.Bool(true),
},
Name: pulumi.String("multidialect_view"),
DatabaseName: pulumi.String("catalog_database"),
TableType: pulumi.String("VIRTUAL_VIEW"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_glue_catalogtable" "example" {
view_definition = {
representations = [{
"dialect" = "ATHENA"
"dialectVersion" = "3"
"viewOriginalText" = "SELECT * FROM catalog_database.base_table"
"validationConnection" = exampleAwsGlueConnection.name
}]
is_protected = true
}
name = "multidialect_view"
database_name = "catalog_database"
table_type = "VIRTUAL_VIEW"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.glue.CatalogTable;
import com.pulumi.aws.glue.CatalogTableArgs;
import com.pulumi.aws.glue.inputs.CatalogTableViewDefinitionArgs;
import com.pulumi.aws.glue.inputs.CatalogTableViewDefinitionRepresentationArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new CatalogTable("example", CatalogTableArgs.builder()
.viewDefinition(CatalogTableViewDefinitionArgs.builder()
.representations(CatalogTableViewDefinitionRepresentationArgs.builder()
.dialect("ATHENA")
.dialectVersion("3")
.viewOriginalText("SELECT * FROM catalog_database.base_table")
.validationConnection(exampleAwsGlueConnection.name())
.build())
.isProtected(true)
.build())
.name("multidialect_view")
.databaseName("catalog_database")
.tableType("VIRTUAL_VIEW")
.build());
}
}
resources:
example:
type: aws:glue:CatalogTable
properties:
viewDefinition:
representations:
- dialect: ATHENA
dialectVersion: '3'
viewOriginalText: SELECT * FROM catalog_database.base_table
validationConnection: ${exampleAwsGlueConnection.name}
isProtected: true
name: multidialect_view
databaseName: catalog_database
tableType: VIRTUAL_VIEW
Import
Using pulumi import, import Glue Tables using the catalog ID (usually AWS account ID), database name, and table name. For example:
$ pulumi import aws:glue/catalogTable:CatalogTable MyTable 123456789012:MyDatabase:MyTable
Constructors
- CatalogTable(String name, {CatalogTableArgs? args, CustomResourceOptions? options})
-
Creates a new CatalogTable.
nameThe Pulumi resource name.argsArguments used to configure this CatalogTable. The set of arguments for CatalogTable.optionsResource options controlling this resource's behavior. - CatalogTable.reference(String urn)
- Creates a typed reference to an existing CatalogTable resource.
Properties
-
arn
↔ Output<
String> -
ARN of the Glue Table.
latefinal
-
catalogId
↔ Output<
String> -
ID of the Glue Catalog and database to create the table in. If omitted, this defaults to the AWS Account ID plus the database name.
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
databaseName
↔ Output<
String> -
Name of the metadata database where the table metadata resides. For Hive compatibility, this must be all lowercase.
latefinal
-
description
↔ Output<
String?> -
Description of the table.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
name
↔ Output<
String> -
Name of the table. For Hive compatibility, this must be entirely lowercase.
latefinal
-
openTableFormatInput
↔ Output<
CatalogTableOpenTableFormatInput?> -
Configuration block for open table formats. See
openTableFormatInputbelow.latefinal -
owner
↔ Output<
String?> -
Owner of the table.
latefinal
-
parameters
↔ Output<
Map< String, String> > -
Properties associated with this table, as a map of key-value pairs.
latefinal
-
partitionIndices
↔ Output<
List< CatalogTablePartitionIndex> > -
Configuration block for a maximum of 3 partition indexes. See
partitionIndexbelow.latefinal -
partitionKeys
↔ Output<
List< CatalogTablePartitionKey> ?> -
Configuration block of columns by which the table is partitioned. Only primitive types are supported as partition keys. See
partitionKeysbelow.latefinal -
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
-
retention
↔ Output<
int?> -
Retention time for this table.
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
storageDescriptor
↔ Output<
CatalogTableStorageDescriptor> -
Configuration block for information about the physical storage of this table. For more information, refer to the Glue Developer Guide. See
storageDescriptorbelow.latefinal -
tableType
↔ Output<
String> -
Type of this table (EXTERNAL_TABLE, VIRTUAL_VIEW, etc.). While optional, some Athena DDL queries such as
ALTER TABLEandSHOW CREATE TABLEwill fail if this argument is empty.latefinal -
targetTable
↔ Output<
CatalogTableTargetTable?> -
Configuration block of a target table for resource linking. See
targetTablebelow.latefinal -
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
-
viewDefinition
↔ Output<
CatalogTableViewDefinition?> -
Structure that contains all the information that defines the view, including the dialect or dialects for the view, and the query. See
viewDefinitionbelow.latefinal -
viewExpandedText
↔ Output<
String?> -
If the table is a view, the expanded text of the view; otherwise null.
latefinal
-
viewOriginalText
↔ Output<
String?> -
If the table is a view, the original text of the view; otherwise null.
latefinal
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {CatalogTableState? state, CustomResourceOptions? options}) → CatalogTable -
Gets an existing CatalogTable resource's state with the given
nameandid.