github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/glue/catalogDatabase.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 // Provides a Glue Catalog Database Resource. You can refer to the [Glue Developer Guide](http://docs.aws.amazon.com/glue/latest/dg/populate-data-catalog.html) for a full explanation of the Glue Data Catalog functionality 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.NewCatalogDatabase(ctx, "example", &glue.CatalogDatabaseArgs{ 32 // Name: pulumi.String("MyCatalogDatabase"), 33 // }) 34 // if err != nil { 35 // return err 36 // } 37 // return nil 38 // }) 39 // } 40 // 41 // ``` 42 // <!--End PulumiCodeChooser --> 43 // 44 // ### Create Table Default Permissions 45 // 46 // <!--Start PulumiCodeChooser --> 47 // ```go 48 // package main 49 // 50 // import ( 51 // 52 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/glue" 53 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 54 // 55 // ) 56 // 57 // func main() { 58 // pulumi.Run(func(ctx *pulumi.Context) error { 59 // _, err := glue.NewCatalogDatabase(ctx, "example", &glue.CatalogDatabaseArgs{ 60 // Name: pulumi.String("MyCatalogDatabase"), 61 // CreateTableDefaultPermissions: glue.CatalogDatabaseCreateTableDefaultPermissionArray{ 62 // &glue.CatalogDatabaseCreateTableDefaultPermissionArgs{ 63 // Permissions: pulumi.StringArray{ 64 // pulumi.String("SELECT"), 65 // }, 66 // Principal: &glue.CatalogDatabaseCreateTableDefaultPermissionPrincipalArgs{ 67 // DataLakePrincipalIdentifier: pulumi.String("IAM_ALLOWED_PRINCIPALS"), 68 // }, 69 // }, 70 // }, 71 // }) 72 // if err != nil { 73 // return err 74 // } 75 // return nil 76 // }) 77 // } 78 // 79 // ``` 80 // <!--End PulumiCodeChooser --> 81 // 82 // ## Import 83 // 84 // Using `pulumi import`, import Glue Catalog Databases using the `catalog_id:name`. If you have not set a Catalog ID specify the AWS Account ID that the database is in. For example: 85 // 86 // ```sh 87 // $ pulumi import aws:glue/catalogDatabase:CatalogDatabase database 123456789012:my_database 88 // ``` 89 type CatalogDatabase struct { 90 pulumi.CustomResourceState 91 92 // ARN of the Glue Catalog Database. 93 Arn pulumi.StringOutput `pulumi:"arn"` 94 // ID of the Glue Catalog to create the database in. If omitted, this defaults to the AWS Account ID. 95 CatalogId pulumi.StringOutput `pulumi:"catalogId"` 96 // Creates a set of default permissions on the table for principals. See `createTableDefaultPermission` below. 97 CreateTableDefaultPermissions CatalogDatabaseCreateTableDefaultPermissionArrayOutput `pulumi:"createTableDefaultPermissions"` 98 // Description of the database. 99 Description pulumi.StringPtrOutput `pulumi:"description"` 100 // Configuration block that references an entity outside the AWS Glue Data Catalog. See `federatedDatabase` below. 101 FederatedDatabase CatalogDatabaseFederatedDatabasePtrOutput `pulumi:"federatedDatabase"` 102 // Location of the database (for example, an HDFS path). 103 LocationUri pulumi.StringOutput `pulumi:"locationUri"` 104 // Name of the database. The acceptable characters are lowercase letters, numbers, and the underscore character. 105 Name pulumi.StringOutput `pulumi:"name"` 106 // List of key-value pairs that define parameters and properties of the database. 107 Parameters pulumi.StringMapOutput `pulumi:"parameters"` 108 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 109 Tags pulumi.StringMapOutput `pulumi:"tags"` 110 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 111 // 112 // Deprecated: Please use `tags` instead. 113 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 114 // Configuration block for a target database for resource linking. See `targetDatabase` below. 115 TargetDatabase CatalogDatabaseTargetDatabasePtrOutput `pulumi:"targetDatabase"` 116 } 117 118 // NewCatalogDatabase registers a new resource with the given unique name, arguments, and options. 119 func NewCatalogDatabase(ctx *pulumi.Context, 120 name string, args *CatalogDatabaseArgs, opts ...pulumi.ResourceOption) (*CatalogDatabase, error) { 121 if args == nil { 122 args = &CatalogDatabaseArgs{} 123 } 124 125 opts = internal.PkgResourceDefaultOpts(opts) 126 var resource CatalogDatabase 127 err := ctx.RegisterResource("aws:glue/catalogDatabase:CatalogDatabase", name, args, &resource, opts...) 128 if err != nil { 129 return nil, err 130 } 131 return &resource, nil 132 } 133 134 // GetCatalogDatabase gets an existing CatalogDatabase resource's state with the given name, ID, and optional 135 // state properties that are used to uniquely qualify the lookup (nil if not required). 136 func GetCatalogDatabase(ctx *pulumi.Context, 137 name string, id pulumi.IDInput, state *CatalogDatabaseState, opts ...pulumi.ResourceOption) (*CatalogDatabase, error) { 138 var resource CatalogDatabase 139 err := ctx.ReadResource("aws:glue/catalogDatabase:CatalogDatabase", name, id, state, &resource, opts...) 140 if err != nil { 141 return nil, err 142 } 143 return &resource, nil 144 } 145 146 // Input properties used for looking up and filtering CatalogDatabase resources. 147 type catalogDatabaseState struct { 148 // ARN of the Glue Catalog Database. 149 Arn *string `pulumi:"arn"` 150 // ID of the Glue Catalog to create the database in. If omitted, this defaults to the AWS Account ID. 151 CatalogId *string `pulumi:"catalogId"` 152 // Creates a set of default permissions on the table for principals. See `createTableDefaultPermission` below. 153 CreateTableDefaultPermissions []CatalogDatabaseCreateTableDefaultPermission `pulumi:"createTableDefaultPermissions"` 154 // Description of the database. 155 Description *string `pulumi:"description"` 156 // Configuration block that references an entity outside the AWS Glue Data Catalog. See `federatedDatabase` below. 157 FederatedDatabase *CatalogDatabaseFederatedDatabase `pulumi:"federatedDatabase"` 158 // Location of the database (for example, an HDFS path). 159 LocationUri *string `pulumi:"locationUri"` 160 // Name of the database. The acceptable characters are lowercase letters, numbers, and the underscore character. 161 Name *string `pulumi:"name"` 162 // List of key-value pairs that define parameters and properties of the database. 163 Parameters map[string]string `pulumi:"parameters"` 164 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 165 Tags map[string]string `pulumi:"tags"` 166 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 167 // 168 // Deprecated: Please use `tags` instead. 169 TagsAll map[string]string `pulumi:"tagsAll"` 170 // Configuration block for a target database for resource linking. See `targetDatabase` below. 171 TargetDatabase *CatalogDatabaseTargetDatabase `pulumi:"targetDatabase"` 172 } 173 174 type CatalogDatabaseState struct { 175 // ARN of the Glue Catalog Database. 176 Arn pulumi.StringPtrInput 177 // ID of the Glue Catalog to create the database in. If omitted, this defaults to the AWS Account ID. 178 CatalogId pulumi.StringPtrInput 179 // Creates a set of default permissions on the table for principals. See `createTableDefaultPermission` below. 180 CreateTableDefaultPermissions CatalogDatabaseCreateTableDefaultPermissionArrayInput 181 // Description of the database. 182 Description pulumi.StringPtrInput 183 // Configuration block that references an entity outside the AWS Glue Data Catalog. See `federatedDatabase` below. 184 FederatedDatabase CatalogDatabaseFederatedDatabasePtrInput 185 // Location of the database (for example, an HDFS path). 186 LocationUri pulumi.StringPtrInput 187 // Name of the database. The acceptable characters are lowercase letters, numbers, and the underscore character. 188 Name pulumi.StringPtrInput 189 // List of key-value pairs that define parameters and properties of the database. 190 Parameters pulumi.StringMapInput 191 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 192 Tags pulumi.StringMapInput 193 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 194 // 195 // Deprecated: Please use `tags` instead. 196 TagsAll pulumi.StringMapInput 197 // Configuration block for a target database for resource linking. See `targetDatabase` below. 198 TargetDatabase CatalogDatabaseTargetDatabasePtrInput 199 } 200 201 func (CatalogDatabaseState) ElementType() reflect.Type { 202 return reflect.TypeOf((*catalogDatabaseState)(nil)).Elem() 203 } 204 205 type catalogDatabaseArgs struct { 206 // ID of the Glue Catalog to create the database in. If omitted, this defaults to the AWS Account ID. 207 CatalogId *string `pulumi:"catalogId"` 208 // Creates a set of default permissions on the table for principals. See `createTableDefaultPermission` below. 209 CreateTableDefaultPermissions []CatalogDatabaseCreateTableDefaultPermission `pulumi:"createTableDefaultPermissions"` 210 // Description of the database. 211 Description *string `pulumi:"description"` 212 // Configuration block that references an entity outside the AWS Glue Data Catalog. See `federatedDatabase` below. 213 FederatedDatabase *CatalogDatabaseFederatedDatabase `pulumi:"federatedDatabase"` 214 // Location of the database (for example, an HDFS path). 215 LocationUri *string `pulumi:"locationUri"` 216 // Name of the database. The acceptable characters are lowercase letters, numbers, and the underscore character. 217 Name *string `pulumi:"name"` 218 // List of key-value pairs that define parameters and properties of the database. 219 Parameters map[string]string `pulumi:"parameters"` 220 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 221 Tags map[string]string `pulumi:"tags"` 222 // Configuration block for a target database for resource linking. See `targetDatabase` below. 223 TargetDatabase *CatalogDatabaseTargetDatabase `pulumi:"targetDatabase"` 224 } 225 226 // The set of arguments for constructing a CatalogDatabase resource. 227 type CatalogDatabaseArgs struct { 228 // ID of the Glue Catalog to create the database in. If omitted, this defaults to the AWS Account ID. 229 CatalogId pulumi.StringPtrInput 230 // Creates a set of default permissions on the table for principals. See `createTableDefaultPermission` below. 231 CreateTableDefaultPermissions CatalogDatabaseCreateTableDefaultPermissionArrayInput 232 // Description of the database. 233 Description pulumi.StringPtrInput 234 // Configuration block that references an entity outside the AWS Glue Data Catalog. See `federatedDatabase` below. 235 FederatedDatabase CatalogDatabaseFederatedDatabasePtrInput 236 // Location of the database (for example, an HDFS path). 237 LocationUri pulumi.StringPtrInput 238 // Name of the database. The acceptable characters are lowercase letters, numbers, and the underscore character. 239 Name pulumi.StringPtrInput 240 // List of key-value pairs that define parameters and properties of the database. 241 Parameters pulumi.StringMapInput 242 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 243 Tags pulumi.StringMapInput 244 // Configuration block for a target database for resource linking. See `targetDatabase` below. 245 TargetDatabase CatalogDatabaseTargetDatabasePtrInput 246 } 247 248 func (CatalogDatabaseArgs) ElementType() reflect.Type { 249 return reflect.TypeOf((*catalogDatabaseArgs)(nil)).Elem() 250 } 251 252 type CatalogDatabaseInput interface { 253 pulumi.Input 254 255 ToCatalogDatabaseOutput() CatalogDatabaseOutput 256 ToCatalogDatabaseOutputWithContext(ctx context.Context) CatalogDatabaseOutput 257 } 258 259 func (*CatalogDatabase) ElementType() reflect.Type { 260 return reflect.TypeOf((**CatalogDatabase)(nil)).Elem() 261 } 262 263 func (i *CatalogDatabase) ToCatalogDatabaseOutput() CatalogDatabaseOutput { 264 return i.ToCatalogDatabaseOutputWithContext(context.Background()) 265 } 266 267 func (i *CatalogDatabase) ToCatalogDatabaseOutputWithContext(ctx context.Context) CatalogDatabaseOutput { 268 return pulumi.ToOutputWithContext(ctx, i).(CatalogDatabaseOutput) 269 } 270 271 // CatalogDatabaseArrayInput is an input type that accepts CatalogDatabaseArray and CatalogDatabaseArrayOutput values. 272 // You can construct a concrete instance of `CatalogDatabaseArrayInput` via: 273 // 274 // CatalogDatabaseArray{ CatalogDatabaseArgs{...} } 275 type CatalogDatabaseArrayInput interface { 276 pulumi.Input 277 278 ToCatalogDatabaseArrayOutput() CatalogDatabaseArrayOutput 279 ToCatalogDatabaseArrayOutputWithContext(context.Context) CatalogDatabaseArrayOutput 280 } 281 282 type CatalogDatabaseArray []CatalogDatabaseInput 283 284 func (CatalogDatabaseArray) ElementType() reflect.Type { 285 return reflect.TypeOf((*[]*CatalogDatabase)(nil)).Elem() 286 } 287 288 func (i CatalogDatabaseArray) ToCatalogDatabaseArrayOutput() CatalogDatabaseArrayOutput { 289 return i.ToCatalogDatabaseArrayOutputWithContext(context.Background()) 290 } 291 292 func (i CatalogDatabaseArray) ToCatalogDatabaseArrayOutputWithContext(ctx context.Context) CatalogDatabaseArrayOutput { 293 return pulumi.ToOutputWithContext(ctx, i).(CatalogDatabaseArrayOutput) 294 } 295 296 // CatalogDatabaseMapInput is an input type that accepts CatalogDatabaseMap and CatalogDatabaseMapOutput values. 297 // You can construct a concrete instance of `CatalogDatabaseMapInput` via: 298 // 299 // CatalogDatabaseMap{ "key": CatalogDatabaseArgs{...} } 300 type CatalogDatabaseMapInput interface { 301 pulumi.Input 302 303 ToCatalogDatabaseMapOutput() CatalogDatabaseMapOutput 304 ToCatalogDatabaseMapOutputWithContext(context.Context) CatalogDatabaseMapOutput 305 } 306 307 type CatalogDatabaseMap map[string]CatalogDatabaseInput 308 309 func (CatalogDatabaseMap) ElementType() reflect.Type { 310 return reflect.TypeOf((*map[string]*CatalogDatabase)(nil)).Elem() 311 } 312 313 func (i CatalogDatabaseMap) ToCatalogDatabaseMapOutput() CatalogDatabaseMapOutput { 314 return i.ToCatalogDatabaseMapOutputWithContext(context.Background()) 315 } 316 317 func (i CatalogDatabaseMap) ToCatalogDatabaseMapOutputWithContext(ctx context.Context) CatalogDatabaseMapOutput { 318 return pulumi.ToOutputWithContext(ctx, i).(CatalogDatabaseMapOutput) 319 } 320 321 type CatalogDatabaseOutput struct{ *pulumi.OutputState } 322 323 func (CatalogDatabaseOutput) ElementType() reflect.Type { 324 return reflect.TypeOf((**CatalogDatabase)(nil)).Elem() 325 } 326 327 func (o CatalogDatabaseOutput) ToCatalogDatabaseOutput() CatalogDatabaseOutput { 328 return o 329 } 330 331 func (o CatalogDatabaseOutput) ToCatalogDatabaseOutputWithContext(ctx context.Context) CatalogDatabaseOutput { 332 return o 333 } 334 335 // ARN of the Glue Catalog Database. 336 func (o CatalogDatabaseOutput) Arn() pulumi.StringOutput { 337 return o.ApplyT(func(v *CatalogDatabase) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 338 } 339 340 // ID of the Glue Catalog to create the database in. If omitted, this defaults to the AWS Account ID. 341 func (o CatalogDatabaseOutput) CatalogId() pulumi.StringOutput { 342 return o.ApplyT(func(v *CatalogDatabase) pulumi.StringOutput { return v.CatalogId }).(pulumi.StringOutput) 343 } 344 345 // Creates a set of default permissions on the table for principals. See `createTableDefaultPermission` below. 346 func (o CatalogDatabaseOutput) CreateTableDefaultPermissions() CatalogDatabaseCreateTableDefaultPermissionArrayOutput { 347 return o.ApplyT(func(v *CatalogDatabase) CatalogDatabaseCreateTableDefaultPermissionArrayOutput { 348 return v.CreateTableDefaultPermissions 349 }).(CatalogDatabaseCreateTableDefaultPermissionArrayOutput) 350 } 351 352 // Description of the database. 353 func (o CatalogDatabaseOutput) Description() pulumi.StringPtrOutput { 354 return o.ApplyT(func(v *CatalogDatabase) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 355 } 356 357 // Configuration block that references an entity outside the AWS Glue Data Catalog. See `federatedDatabase` below. 358 func (o CatalogDatabaseOutput) FederatedDatabase() CatalogDatabaseFederatedDatabasePtrOutput { 359 return o.ApplyT(func(v *CatalogDatabase) CatalogDatabaseFederatedDatabasePtrOutput { return v.FederatedDatabase }).(CatalogDatabaseFederatedDatabasePtrOutput) 360 } 361 362 // Location of the database (for example, an HDFS path). 363 func (o CatalogDatabaseOutput) LocationUri() pulumi.StringOutput { 364 return o.ApplyT(func(v *CatalogDatabase) pulumi.StringOutput { return v.LocationUri }).(pulumi.StringOutput) 365 } 366 367 // Name of the database. The acceptable characters are lowercase letters, numbers, and the underscore character. 368 func (o CatalogDatabaseOutput) Name() pulumi.StringOutput { 369 return o.ApplyT(func(v *CatalogDatabase) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 370 } 371 372 // List of key-value pairs that define parameters and properties of the database. 373 func (o CatalogDatabaseOutput) Parameters() pulumi.StringMapOutput { 374 return o.ApplyT(func(v *CatalogDatabase) pulumi.StringMapOutput { return v.Parameters }).(pulumi.StringMapOutput) 375 } 376 377 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 378 func (o CatalogDatabaseOutput) Tags() pulumi.StringMapOutput { 379 return o.ApplyT(func(v *CatalogDatabase) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 380 } 381 382 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 383 // 384 // Deprecated: Please use `tags` instead. 385 func (o CatalogDatabaseOutput) TagsAll() pulumi.StringMapOutput { 386 return o.ApplyT(func(v *CatalogDatabase) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 387 } 388 389 // Configuration block for a target database for resource linking. See `targetDatabase` below. 390 func (o CatalogDatabaseOutput) TargetDatabase() CatalogDatabaseTargetDatabasePtrOutput { 391 return o.ApplyT(func(v *CatalogDatabase) CatalogDatabaseTargetDatabasePtrOutput { return v.TargetDatabase }).(CatalogDatabaseTargetDatabasePtrOutput) 392 } 393 394 type CatalogDatabaseArrayOutput struct{ *pulumi.OutputState } 395 396 func (CatalogDatabaseArrayOutput) ElementType() reflect.Type { 397 return reflect.TypeOf((*[]*CatalogDatabase)(nil)).Elem() 398 } 399 400 func (o CatalogDatabaseArrayOutput) ToCatalogDatabaseArrayOutput() CatalogDatabaseArrayOutput { 401 return o 402 } 403 404 func (o CatalogDatabaseArrayOutput) ToCatalogDatabaseArrayOutputWithContext(ctx context.Context) CatalogDatabaseArrayOutput { 405 return o 406 } 407 408 func (o CatalogDatabaseArrayOutput) Index(i pulumi.IntInput) CatalogDatabaseOutput { 409 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CatalogDatabase { 410 return vs[0].([]*CatalogDatabase)[vs[1].(int)] 411 }).(CatalogDatabaseOutput) 412 } 413 414 type CatalogDatabaseMapOutput struct{ *pulumi.OutputState } 415 416 func (CatalogDatabaseMapOutput) ElementType() reflect.Type { 417 return reflect.TypeOf((*map[string]*CatalogDatabase)(nil)).Elem() 418 } 419 420 func (o CatalogDatabaseMapOutput) ToCatalogDatabaseMapOutput() CatalogDatabaseMapOutput { 421 return o 422 } 423 424 func (o CatalogDatabaseMapOutput) ToCatalogDatabaseMapOutputWithContext(ctx context.Context) CatalogDatabaseMapOutput { 425 return o 426 } 427 428 func (o CatalogDatabaseMapOutput) MapIndex(k pulumi.StringInput) CatalogDatabaseOutput { 429 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CatalogDatabase { 430 return vs[0].(map[string]*CatalogDatabase)[vs[1].(string)] 431 }).(CatalogDatabaseOutput) 432 } 433 434 func init() { 435 pulumi.RegisterInputType(reflect.TypeOf((*CatalogDatabaseInput)(nil)).Elem(), &CatalogDatabase{}) 436 pulumi.RegisterInputType(reflect.TypeOf((*CatalogDatabaseArrayInput)(nil)).Elem(), CatalogDatabaseArray{}) 437 pulumi.RegisterInputType(reflect.TypeOf((*CatalogDatabaseMapInput)(nil)).Elem(), CatalogDatabaseMap{}) 438 pulumi.RegisterOutputType(CatalogDatabaseOutput{}) 439 pulumi.RegisterOutputType(CatalogDatabaseArrayOutput{}) 440 pulumi.RegisterOutputType(CatalogDatabaseMapOutput{}) 441 }