github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/glue/partitionIndex.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 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // ## Example Usage 16 // 17 // <!--Start PulumiCodeChooser --> 18 // ```go 19 // package main 20 // 21 // import ( 22 // 23 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/glue" 24 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 25 // 26 // ) 27 // 28 // func main() { 29 // pulumi.Run(func(ctx *pulumi.Context) error { 30 // example, err := glue.NewCatalogDatabase(ctx, "example", &glue.CatalogDatabaseArgs{ 31 // Name: pulumi.String("example"), 32 // }) 33 // if err != nil { 34 // return err 35 // } 36 // exampleCatalogTable, err := glue.NewCatalogTable(ctx, "example", &glue.CatalogTableArgs{ 37 // Name: pulumi.String("example"), 38 // DatabaseName: example.Name, 39 // Owner: pulumi.String("my_owner"), 40 // Retention: pulumi.Int(1), 41 // TableType: pulumi.String("VIRTUAL_VIEW"), 42 // ViewExpandedText: pulumi.String("view_expanded_text_1"), 43 // ViewOriginalText: pulumi.String("view_original_text_1"), 44 // StorageDescriptor: &glue.CatalogTableStorageDescriptorArgs{ 45 // BucketColumns: pulumi.StringArray{ 46 // pulumi.String("bucket_column_1"), 47 // }, 48 // Compressed: pulumi.Bool(false), 49 // InputFormat: pulumi.String("SequenceFileInputFormat"), 50 // Location: pulumi.String("my_location"), 51 // NumberOfBuckets: pulumi.Int(1), 52 // OutputFormat: pulumi.String("SequenceFileInputFormat"), 53 // StoredAsSubDirectories: pulumi.Bool(false), 54 // Parameters: pulumi.StringMap{ 55 // "param1": pulumi.String("param1_val"), 56 // }, 57 // Columns: glue.CatalogTableStorageDescriptorColumnArray{ 58 // &glue.CatalogTableStorageDescriptorColumnArgs{ 59 // Name: pulumi.String("my_column_1"), 60 // Type: pulumi.String("int"), 61 // Comment: pulumi.String("my_column1_comment"), 62 // }, 63 // &glue.CatalogTableStorageDescriptorColumnArgs{ 64 // Name: pulumi.String("my_column_2"), 65 // Type: pulumi.String("string"), 66 // Comment: pulumi.String("my_column2_comment"), 67 // }, 68 // }, 69 // SerDeInfo: &glue.CatalogTableStorageDescriptorSerDeInfoArgs{ 70 // Name: pulumi.String("ser_de_name"), 71 // Parameters: pulumi.StringMap{ 72 // "param1": pulumi.String("param_val_1"), 73 // }, 74 // SerializationLibrary: pulumi.String("org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe"), 75 // }, 76 // SortColumns: glue.CatalogTableStorageDescriptorSortColumnArray{ 77 // &glue.CatalogTableStorageDescriptorSortColumnArgs{ 78 // Column: pulumi.String("my_column_1"), 79 // SortOrder: pulumi.Int(1), 80 // }, 81 // }, 82 // SkewedInfo: &glue.CatalogTableStorageDescriptorSkewedInfoArgs{ 83 // SkewedColumnNames: pulumi.StringArray{ 84 // pulumi.String("my_column_1"), 85 // }, 86 // SkewedColumnValueLocationMaps: pulumi.StringMap{ 87 // "my_column_1": pulumi.String("my_column_1_val_loc_map"), 88 // }, 89 // SkewedColumnValues: pulumi.StringArray{ 90 // pulumi.String("skewed_val_1"), 91 // }, 92 // }, 93 // }, 94 // PartitionKeys: glue.CatalogTablePartitionKeyArray{ 95 // &glue.CatalogTablePartitionKeyArgs{ 96 // Name: pulumi.String("my_column_1"), 97 // Type: pulumi.String("int"), 98 // Comment: pulumi.String("my_column_1_comment"), 99 // }, 100 // &glue.CatalogTablePartitionKeyArgs{ 101 // Name: pulumi.String("my_column_2"), 102 // Type: pulumi.String("string"), 103 // Comment: pulumi.String("my_column_2_comment"), 104 // }, 105 // }, 106 // Parameters: pulumi.StringMap{ 107 // "param1": pulumi.String("param1_val"), 108 // }, 109 // }) 110 // if err != nil { 111 // return err 112 // } 113 // _, err = glue.NewPartitionIndex(ctx, "example", &glue.PartitionIndexArgs{ 114 // DatabaseName: example.Name, 115 // TableName: exampleCatalogTable.Name, 116 // PartitionIndex: &glue.PartitionIndexPartitionIndexArgs{ 117 // IndexName: pulumi.String("example"), 118 // Keys: pulumi.StringArray{ 119 // pulumi.String("my_column_1"), 120 // pulumi.String("my_column_2"), 121 // }, 122 // }, 123 // }) 124 // if err != nil { 125 // return err 126 // } 127 // return nil 128 // }) 129 // } 130 // 131 // ``` 132 // <!--End PulumiCodeChooser --> 133 // 134 // ## Import 135 // 136 // Using `pulumi import`, import Glue Partition Indexes using the catalog ID (usually AWS account ID), database name, table name, and index name. For example: 137 // 138 // ```sh 139 // $ pulumi import aws:glue/partitionIndex:PartitionIndex example 123456789012:MyDatabase:MyTable:index-name 140 // ``` 141 type PartitionIndex struct { 142 pulumi.CustomResourceState 143 144 // The catalog ID where the table resides. 145 CatalogId pulumi.StringOutput `pulumi:"catalogId"` 146 // Name of the metadata database where the table metadata resides. For Hive compatibility, this must be all lowercase. 147 DatabaseName pulumi.StringOutput `pulumi:"databaseName"` 148 // Configuration block for a partition index. See `partitionIndex` below. 149 PartitionIndex PartitionIndexPartitionIndexOutput `pulumi:"partitionIndex"` 150 // Name of the table. For Hive compatibility, this must be entirely lowercase. 151 TableName pulumi.StringOutput `pulumi:"tableName"` 152 } 153 154 // NewPartitionIndex registers a new resource with the given unique name, arguments, and options. 155 func NewPartitionIndex(ctx *pulumi.Context, 156 name string, args *PartitionIndexArgs, opts ...pulumi.ResourceOption) (*PartitionIndex, error) { 157 if args == nil { 158 return nil, errors.New("missing one or more required arguments") 159 } 160 161 if args.DatabaseName == nil { 162 return nil, errors.New("invalid value for required argument 'DatabaseName'") 163 } 164 if args.PartitionIndex == nil { 165 return nil, errors.New("invalid value for required argument 'PartitionIndex'") 166 } 167 if args.TableName == nil { 168 return nil, errors.New("invalid value for required argument 'TableName'") 169 } 170 opts = internal.PkgResourceDefaultOpts(opts) 171 var resource PartitionIndex 172 err := ctx.RegisterResource("aws:glue/partitionIndex:PartitionIndex", name, args, &resource, opts...) 173 if err != nil { 174 return nil, err 175 } 176 return &resource, nil 177 } 178 179 // GetPartitionIndex gets an existing PartitionIndex resource's state with the given name, ID, and optional 180 // state properties that are used to uniquely qualify the lookup (nil if not required). 181 func GetPartitionIndex(ctx *pulumi.Context, 182 name string, id pulumi.IDInput, state *PartitionIndexState, opts ...pulumi.ResourceOption) (*PartitionIndex, error) { 183 var resource PartitionIndex 184 err := ctx.ReadResource("aws:glue/partitionIndex:PartitionIndex", name, id, state, &resource, opts...) 185 if err != nil { 186 return nil, err 187 } 188 return &resource, nil 189 } 190 191 // Input properties used for looking up and filtering PartitionIndex resources. 192 type partitionIndexState struct { 193 // The catalog ID where the table resides. 194 CatalogId *string `pulumi:"catalogId"` 195 // Name of the metadata database where the table metadata resides. For Hive compatibility, this must be all lowercase. 196 DatabaseName *string `pulumi:"databaseName"` 197 // Configuration block for a partition index. See `partitionIndex` below. 198 PartitionIndex *PartitionIndexPartitionIndex `pulumi:"partitionIndex"` 199 // Name of the table. For Hive compatibility, this must be entirely lowercase. 200 TableName *string `pulumi:"tableName"` 201 } 202 203 type PartitionIndexState struct { 204 // The catalog ID where the table resides. 205 CatalogId pulumi.StringPtrInput 206 // Name of the metadata database where the table metadata resides. For Hive compatibility, this must be all lowercase. 207 DatabaseName pulumi.StringPtrInput 208 // Configuration block for a partition index. See `partitionIndex` below. 209 PartitionIndex PartitionIndexPartitionIndexPtrInput 210 // Name of the table. For Hive compatibility, this must be entirely lowercase. 211 TableName pulumi.StringPtrInput 212 } 213 214 func (PartitionIndexState) ElementType() reflect.Type { 215 return reflect.TypeOf((*partitionIndexState)(nil)).Elem() 216 } 217 218 type partitionIndexArgs struct { 219 // The catalog ID where the table resides. 220 CatalogId *string `pulumi:"catalogId"` 221 // Name of the metadata database where the table metadata resides. For Hive compatibility, this must be all lowercase. 222 DatabaseName string `pulumi:"databaseName"` 223 // Configuration block for a partition index. See `partitionIndex` below. 224 PartitionIndex PartitionIndexPartitionIndex `pulumi:"partitionIndex"` 225 // Name of the table. For Hive compatibility, this must be entirely lowercase. 226 TableName string `pulumi:"tableName"` 227 } 228 229 // The set of arguments for constructing a PartitionIndex resource. 230 type PartitionIndexArgs struct { 231 // The catalog ID where the table resides. 232 CatalogId pulumi.StringPtrInput 233 // Name of the metadata database where the table metadata resides. For Hive compatibility, this must be all lowercase. 234 DatabaseName pulumi.StringInput 235 // Configuration block for a partition index. See `partitionIndex` below. 236 PartitionIndex PartitionIndexPartitionIndexInput 237 // Name of the table. For Hive compatibility, this must be entirely lowercase. 238 TableName pulumi.StringInput 239 } 240 241 func (PartitionIndexArgs) ElementType() reflect.Type { 242 return reflect.TypeOf((*partitionIndexArgs)(nil)).Elem() 243 } 244 245 type PartitionIndexInput interface { 246 pulumi.Input 247 248 ToPartitionIndexOutput() PartitionIndexOutput 249 ToPartitionIndexOutputWithContext(ctx context.Context) PartitionIndexOutput 250 } 251 252 func (*PartitionIndex) ElementType() reflect.Type { 253 return reflect.TypeOf((**PartitionIndex)(nil)).Elem() 254 } 255 256 func (i *PartitionIndex) ToPartitionIndexOutput() PartitionIndexOutput { 257 return i.ToPartitionIndexOutputWithContext(context.Background()) 258 } 259 260 func (i *PartitionIndex) ToPartitionIndexOutputWithContext(ctx context.Context) PartitionIndexOutput { 261 return pulumi.ToOutputWithContext(ctx, i).(PartitionIndexOutput) 262 } 263 264 // PartitionIndexArrayInput is an input type that accepts PartitionIndexArray and PartitionIndexArrayOutput values. 265 // You can construct a concrete instance of `PartitionIndexArrayInput` via: 266 // 267 // PartitionIndexArray{ PartitionIndexArgs{...} } 268 type PartitionIndexArrayInput interface { 269 pulumi.Input 270 271 ToPartitionIndexArrayOutput() PartitionIndexArrayOutput 272 ToPartitionIndexArrayOutputWithContext(context.Context) PartitionIndexArrayOutput 273 } 274 275 type PartitionIndexArray []PartitionIndexInput 276 277 func (PartitionIndexArray) ElementType() reflect.Type { 278 return reflect.TypeOf((*[]*PartitionIndex)(nil)).Elem() 279 } 280 281 func (i PartitionIndexArray) ToPartitionIndexArrayOutput() PartitionIndexArrayOutput { 282 return i.ToPartitionIndexArrayOutputWithContext(context.Background()) 283 } 284 285 func (i PartitionIndexArray) ToPartitionIndexArrayOutputWithContext(ctx context.Context) PartitionIndexArrayOutput { 286 return pulumi.ToOutputWithContext(ctx, i).(PartitionIndexArrayOutput) 287 } 288 289 // PartitionIndexMapInput is an input type that accepts PartitionIndexMap and PartitionIndexMapOutput values. 290 // You can construct a concrete instance of `PartitionIndexMapInput` via: 291 // 292 // PartitionIndexMap{ "key": PartitionIndexArgs{...} } 293 type PartitionIndexMapInput interface { 294 pulumi.Input 295 296 ToPartitionIndexMapOutput() PartitionIndexMapOutput 297 ToPartitionIndexMapOutputWithContext(context.Context) PartitionIndexMapOutput 298 } 299 300 type PartitionIndexMap map[string]PartitionIndexInput 301 302 func (PartitionIndexMap) ElementType() reflect.Type { 303 return reflect.TypeOf((*map[string]*PartitionIndex)(nil)).Elem() 304 } 305 306 func (i PartitionIndexMap) ToPartitionIndexMapOutput() PartitionIndexMapOutput { 307 return i.ToPartitionIndexMapOutputWithContext(context.Background()) 308 } 309 310 func (i PartitionIndexMap) ToPartitionIndexMapOutputWithContext(ctx context.Context) PartitionIndexMapOutput { 311 return pulumi.ToOutputWithContext(ctx, i).(PartitionIndexMapOutput) 312 } 313 314 type PartitionIndexOutput struct{ *pulumi.OutputState } 315 316 func (PartitionIndexOutput) ElementType() reflect.Type { 317 return reflect.TypeOf((**PartitionIndex)(nil)).Elem() 318 } 319 320 func (o PartitionIndexOutput) ToPartitionIndexOutput() PartitionIndexOutput { 321 return o 322 } 323 324 func (o PartitionIndexOutput) ToPartitionIndexOutputWithContext(ctx context.Context) PartitionIndexOutput { 325 return o 326 } 327 328 // The catalog ID where the table resides. 329 func (o PartitionIndexOutput) CatalogId() pulumi.StringOutput { 330 return o.ApplyT(func(v *PartitionIndex) pulumi.StringOutput { return v.CatalogId }).(pulumi.StringOutput) 331 } 332 333 // Name of the metadata database where the table metadata resides. For Hive compatibility, this must be all lowercase. 334 func (o PartitionIndexOutput) DatabaseName() pulumi.StringOutput { 335 return o.ApplyT(func(v *PartitionIndex) pulumi.StringOutput { return v.DatabaseName }).(pulumi.StringOutput) 336 } 337 338 // Configuration block for a partition index. See `partitionIndex` below. 339 func (o PartitionIndexOutput) PartitionIndex() PartitionIndexPartitionIndexOutput { 340 return o.ApplyT(func(v *PartitionIndex) PartitionIndexPartitionIndexOutput { return v.PartitionIndex }).(PartitionIndexPartitionIndexOutput) 341 } 342 343 // Name of the table. For Hive compatibility, this must be entirely lowercase. 344 func (o PartitionIndexOutput) TableName() pulumi.StringOutput { 345 return o.ApplyT(func(v *PartitionIndex) pulumi.StringOutput { return v.TableName }).(pulumi.StringOutput) 346 } 347 348 type PartitionIndexArrayOutput struct{ *pulumi.OutputState } 349 350 func (PartitionIndexArrayOutput) ElementType() reflect.Type { 351 return reflect.TypeOf((*[]*PartitionIndex)(nil)).Elem() 352 } 353 354 func (o PartitionIndexArrayOutput) ToPartitionIndexArrayOutput() PartitionIndexArrayOutput { 355 return o 356 } 357 358 func (o PartitionIndexArrayOutput) ToPartitionIndexArrayOutputWithContext(ctx context.Context) PartitionIndexArrayOutput { 359 return o 360 } 361 362 func (o PartitionIndexArrayOutput) Index(i pulumi.IntInput) PartitionIndexOutput { 363 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PartitionIndex { 364 return vs[0].([]*PartitionIndex)[vs[1].(int)] 365 }).(PartitionIndexOutput) 366 } 367 368 type PartitionIndexMapOutput struct{ *pulumi.OutputState } 369 370 func (PartitionIndexMapOutput) ElementType() reflect.Type { 371 return reflect.TypeOf((*map[string]*PartitionIndex)(nil)).Elem() 372 } 373 374 func (o PartitionIndexMapOutput) ToPartitionIndexMapOutput() PartitionIndexMapOutput { 375 return o 376 } 377 378 func (o PartitionIndexMapOutput) ToPartitionIndexMapOutputWithContext(ctx context.Context) PartitionIndexMapOutput { 379 return o 380 } 381 382 func (o PartitionIndexMapOutput) MapIndex(k pulumi.StringInput) PartitionIndexOutput { 383 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PartitionIndex { 384 return vs[0].(map[string]*PartitionIndex)[vs[1].(string)] 385 }).(PartitionIndexOutput) 386 } 387 388 func init() { 389 pulumi.RegisterInputType(reflect.TypeOf((*PartitionIndexInput)(nil)).Elem(), &PartitionIndex{}) 390 pulumi.RegisterInputType(reflect.TypeOf((*PartitionIndexArrayInput)(nil)).Elem(), PartitionIndexArray{}) 391 pulumi.RegisterInputType(reflect.TypeOf((*PartitionIndexMapInput)(nil)).Elem(), PartitionIndexMap{}) 392 pulumi.RegisterOutputType(PartitionIndexOutput{}) 393 pulumi.RegisterOutputType(PartitionIndexArrayOutput{}) 394 pulumi.RegisterOutputType(PartitionIndexMapOutput{}) 395 }