github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/glue/getCatalogTable.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package glue 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // This data source can be used to fetch information about an AWS Glue Data Catalog Table. 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/glue" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := glue.LookupCatalogTable(ctx, &glue.LookupCatalogTableArgs{ 32 // Name: "MyCatalogTable", 33 // DatabaseName: "MyCatalogDatabase", 34 // }, nil) 35 // if err != nil { 36 // return err 37 // } 38 // return nil 39 // }) 40 // } 41 // 42 // ``` 43 // <!--End PulumiCodeChooser --> 44 func LookupCatalogTable(ctx *pulumi.Context, args *LookupCatalogTableArgs, opts ...pulumi.InvokeOption) (*LookupCatalogTableResult, error) { 45 opts = internal.PkgInvokeDefaultOpts(opts) 46 var rv LookupCatalogTableResult 47 err := ctx.Invoke("aws:glue/getCatalogTable:getCatalogTable", args, &rv, opts...) 48 if err != nil { 49 return nil, err 50 } 51 return &rv, nil 52 } 53 54 // A collection of arguments for invoking getCatalogTable. 55 type LookupCatalogTableArgs struct { 56 // ID of the Glue Catalog and database where the table metadata resides. If omitted, this defaults to the current AWS Account ID. 57 CatalogId *string `pulumi:"catalogId"` 58 // Name of the metadata database where the table metadata resides. 59 DatabaseName string `pulumi:"databaseName"` 60 // Name of the table. 61 Name string `pulumi:"name"` 62 // The time as of when to read the table contents. If not set, the most recent transaction commit time will be used. Cannot be specified along with `transactionId`. Specified in RFC 3339 format, e.g. `2006-01-02T15:04:05Z07:00`. 63 QueryAsOfTime *string `pulumi:"queryAsOfTime"` 64 // The transaction ID at which to read the table contents. 65 TransactionId *int `pulumi:"transactionId"` 66 } 67 68 // A collection of values returned by getCatalogTable. 69 type LookupCatalogTableResult struct { 70 // The ARN of the Glue Table. 71 Arn string `pulumi:"arn"` 72 // ID of the Data Catalog in which the table resides. 73 CatalogId string `pulumi:"catalogId"` 74 // Name of the catalog database that contains the target table. 75 DatabaseName string `pulumi:"databaseName"` 76 // Description of the table. 77 Description string `pulumi:"description"` 78 // The provider-assigned unique ID for this managed resource. 79 Id string `pulumi:"id"` 80 // Name of the target table. 81 Name string `pulumi:"name"` 82 // Owner of the table. 83 Owner string `pulumi:"owner"` 84 // Map of initialization parameters for the SerDe, in key-value form. 85 Parameters map[string]string `pulumi:"parameters"` 86 // Configuration block for a maximum of 3 partition indexes. See `partitionIndex` below. 87 PartitionIndices []GetCatalogTablePartitionIndex `pulumi:"partitionIndices"` 88 // Configuration block of columns by which the table is partitioned. Only primitive types are supported as partition keys. See `partitionKeys` below. 89 PartitionKeys []GetCatalogTablePartitionKey `pulumi:"partitionKeys"` 90 QueryAsOfTime *string `pulumi:"queryAsOfTime"` 91 // Retention time for this table. 92 Retention int `pulumi:"retention"` 93 // Configuration block for information about the physical storage of this table. For more information, refer to the [Glue Developer Guide](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-tables.html#aws-glue-api-catalog-tables-StorageDescriptor). See `storageDescriptor` below. 94 StorageDescriptors []GetCatalogTableStorageDescriptor `pulumi:"storageDescriptors"` 95 // Type of this table (EXTERNAL_TABLE, VIRTUAL_VIEW, etc.). While optional, some Athena DDL queries such as `ALTER TABLE` and `SHOW CREATE TABLE` will fail if this argument is empty. 96 TableType string `pulumi:"tableType"` 97 // Configuration block of a target table for resource linking. See `targetTable` below. 98 TargetTables []GetCatalogTableTargetTable `pulumi:"targetTables"` 99 TransactionId *int `pulumi:"transactionId"` 100 // If the table is a view, the expanded text of the view; otherwise null. 101 ViewExpandedText string `pulumi:"viewExpandedText"` 102 // If the table is a view, the original text of the view; otherwise null. 103 ViewOriginalText string `pulumi:"viewOriginalText"` 104 } 105 106 func LookupCatalogTableOutput(ctx *pulumi.Context, args LookupCatalogTableOutputArgs, opts ...pulumi.InvokeOption) LookupCatalogTableResultOutput { 107 return pulumi.ToOutputWithContext(context.Background(), args). 108 ApplyT(func(v interface{}) (LookupCatalogTableResult, error) { 109 args := v.(LookupCatalogTableArgs) 110 r, err := LookupCatalogTable(ctx, &args, opts...) 111 var s LookupCatalogTableResult 112 if r != nil { 113 s = *r 114 } 115 return s, err 116 }).(LookupCatalogTableResultOutput) 117 } 118 119 // A collection of arguments for invoking getCatalogTable. 120 type LookupCatalogTableOutputArgs struct { 121 // ID of the Glue Catalog and database where the table metadata resides. If omitted, this defaults to the current AWS Account ID. 122 CatalogId pulumi.StringPtrInput `pulumi:"catalogId"` 123 // Name of the metadata database where the table metadata resides. 124 DatabaseName pulumi.StringInput `pulumi:"databaseName"` 125 // Name of the table. 126 Name pulumi.StringInput `pulumi:"name"` 127 // The time as of when to read the table contents. If not set, the most recent transaction commit time will be used. Cannot be specified along with `transactionId`. Specified in RFC 3339 format, e.g. `2006-01-02T15:04:05Z07:00`. 128 QueryAsOfTime pulumi.StringPtrInput `pulumi:"queryAsOfTime"` 129 // The transaction ID at which to read the table contents. 130 TransactionId pulumi.IntPtrInput `pulumi:"transactionId"` 131 } 132 133 func (LookupCatalogTableOutputArgs) ElementType() reflect.Type { 134 return reflect.TypeOf((*LookupCatalogTableArgs)(nil)).Elem() 135 } 136 137 // A collection of values returned by getCatalogTable. 138 type LookupCatalogTableResultOutput struct{ *pulumi.OutputState } 139 140 func (LookupCatalogTableResultOutput) ElementType() reflect.Type { 141 return reflect.TypeOf((*LookupCatalogTableResult)(nil)).Elem() 142 } 143 144 func (o LookupCatalogTableResultOutput) ToLookupCatalogTableResultOutput() LookupCatalogTableResultOutput { 145 return o 146 } 147 148 func (o LookupCatalogTableResultOutput) ToLookupCatalogTableResultOutputWithContext(ctx context.Context) LookupCatalogTableResultOutput { 149 return o 150 } 151 152 // The ARN of the Glue Table. 153 func (o LookupCatalogTableResultOutput) Arn() pulumi.StringOutput { 154 return o.ApplyT(func(v LookupCatalogTableResult) string { return v.Arn }).(pulumi.StringOutput) 155 } 156 157 // ID of the Data Catalog in which the table resides. 158 func (o LookupCatalogTableResultOutput) CatalogId() pulumi.StringOutput { 159 return o.ApplyT(func(v LookupCatalogTableResult) string { return v.CatalogId }).(pulumi.StringOutput) 160 } 161 162 // Name of the catalog database that contains the target table. 163 func (o LookupCatalogTableResultOutput) DatabaseName() pulumi.StringOutput { 164 return o.ApplyT(func(v LookupCatalogTableResult) string { return v.DatabaseName }).(pulumi.StringOutput) 165 } 166 167 // Description of the table. 168 func (o LookupCatalogTableResultOutput) Description() pulumi.StringOutput { 169 return o.ApplyT(func(v LookupCatalogTableResult) string { return v.Description }).(pulumi.StringOutput) 170 } 171 172 // The provider-assigned unique ID for this managed resource. 173 func (o LookupCatalogTableResultOutput) Id() pulumi.StringOutput { 174 return o.ApplyT(func(v LookupCatalogTableResult) string { return v.Id }).(pulumi.StringOutput) 175 } 176 177 // Name of the target table. 178 func (o LookupCatalogTableResultOutput) Name() pulumi.StringOutput { 179 return o.ApplyT(func(v LookupCatalogTableResult) string { return v.Name }).(pulumi.StringOutput) 180 } 181 182 // Owner of the table. 183 func (o LookupCatalogTableResultOutput) Owner() pulumi.StringOutput { 184 return o.ApplyT(func(v LookupCatalogTableResult) string { return v.Owner }).(pulumi.StringOutput) 185 } 186 187 // Map of initialization parameters for the SerDe, in key-value form. 188 func (o LookupCatalogTableResultOutput) Parameters() pulumi.StringMapOutput { 189 return o.ApplyT(func(v LookupCatalogTableResult) map[string]string { return v.Parameters }).(pulumi.StringMapOutput) 190 } 191 192 // Configuration block for a maximum of 3 partition indexes. See `partitionIndex` below. 193 func (o LookupCatalogTableResultOutput) PartitionIndices() GetCatalogTablePartitionIndexArrayOutput { 194 return o.ApplyT(func(v LookupCatalogTableResult) []GetCatalogTablePartitionIndex { return v.PartitionIndices }).(GetCatalogTablePartitionIndexArrayOutput) 195 } 196 197 // Configuration block of columns by which the table is partitioned. Only primitive types are supported as partition keys. See `partitionKeys` below. 198 func (o LookupCatalogTableResultOutput) PartitionKeys() GetCatalogTablePartitionKeyArrayOutput { 199 return o.ApplyT(func(v LookupCatalogTableResult) []GetCatalogTablePartitionKey { return v.PartitionKeys }).(GetCatalogTablePartitionKeyArrayOutput) 200 } 201 202 func (o LookupCatalogTableResultOutput) QueryAsOfTime() pulumi.StringPtrOutput { 203 return o.ApplyT(func(v LookupCatalogTableResult) *string { return v.QueryAsOfTime }).(pulumi.StringPtrOutput) 204 } 205 206 // Retention time for this table. 207 func (o LookupCatalogTableResultOutput) Retention() pulumi.IntOutput { 208 return o.ApplyT(func(v LookupCatalogTableResult) int { return v.Retention }).(pulumi.IntOutput) 209 } 210 211 // Configuration block for information about the physical storage of this table. For more information, refer to the [Glue Developer Guide](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-tables.html#aws-glue-api-catalog-tables-StorageDescriptor). See `storageDescriptor` below. 212 func (o LookupCatalogTableResultOutput) StorageDescriptors() GetCatalogTableStorageDescriptorArrayOutput { 213 return o.ApplyT(func(v LookupCatalogTableResult) []GetCatalogTableStorageDescriptor { return v.StorageDescriptors }).(GetCatalogTableStorageDescriptorArrayOutput) 214 } 215 216 // Type of this table (EXTERNAL_TABLE, VIRTUAL_VIEW, etc.). While optional, some Athena DDL queries such as `ALTER TABLE` and `SHOW CREATE TABLE` will fail if this argument is empty. 217 func (o LookupCatalogTableResultOutput) TableType() pulumi.StringOutput { 218 return o.ApplyT(func(v LookupCatalogTableResult) string { return v.TableType }).(pulumi.StringOutput) 219 } 220 221 // Configuration block of a target table for resource linking. See `targetTable` below. 222 func (o LookupCatalogTableResultOutput) TargetTables() GetCatalogTableTargetTableArrayOutput { 223 return o.ApplyT(func(v LookupCatalogTableResult) []GetCatalogTableTargetTable { return v.TargetTables }).(GetCatalogTableTargetTableArrayOutput) 224 } 225 226 func (o LookupCatalogTableResultOutput) TransactionId() pulumi.IntPtrOutput { 227 return o.ApplyT(func(v LookupCatalogTableResult) *int { return v.TransactionId }).(pulumi.IntPtrOutput) 228 } 229 230 // If the table is a view, the expanded text of the view; otherwise null. 231 func (o LookupCatalogTableResultOutput) ViewExpandedText() pulumi.StringOutput { 232 return o.ApplyT(func(v LookupCatalogTableResult) string { return v.ViewExpandedText }).(pulumi.StringOutput) 233 } 234 235 // If the table is a view, the original text of the view; otherwise null. 236 func (o LookupCatalogTableResultOutput) ViewOriginalText() pulumi.StringOutput { 237 return o.ApplyT(func(v LookupCatalogTableResult) string { return v.ViewOriginalText }).(pulumi.StringOutput) 238 } 239 240 func init() { 241 pulumi.RegisterOutputType(LookupCatalogTableResultOutput{}) 242 }