/
resourceLfTags.go
428 lines (377 loc) · 15.5 KB
/
resourceLfTags.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package lakeformation
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an attachment between one or more existing LF-tags and an existing Lake Formation resource.
//
// ## Example Usage
//
// ### Database Example
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lakeformation"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := lakeformation.NewLfTag(ctx, "example", &lakeformation.LfTagArgs{
// Key: pulumi.String("right"),
// Values: pulumi.StringArray{
// pulumi.String("abbey"),
// pulumi.String("village"),
// pulumi.String("luffield"),
// pulumi.String("woodcote"),
// pulumi.String("copse"),
// pulumi.String("chapel"),
// pulumi.String("stowe"),
// pulumi.String("club"),
// },
// })
// if err != nil {
// return err
// }
// _, err = lakeformation.NewResourceLfTags(ctx, "example", &lakeformation.ResourceLfTagsArgs{
// Database: &lakeformation.ResourceLfTagsDatabaseArgs{
// Name: pulumi.Any(exampleAwsGlueCatalogDatabase.Name),
// },
// LfTags: lakeformation.ResourceLfTagsLfTagArray{
// &lakeformation.ResourceLfTagsLfTagArgs{
// Key: example.Key,
// Value: pulumi.String("stowe"),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### Multiple Tags Example
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lakeformation"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := lakeformation.NewLfTag(ctx, "example", &lakeformation.LfTagArgs{
// Key: pulumi.String("right"),
// Values: pulumi.StringArray{
// pulumi.String("abbey"),
// pulumi.String("village"),
// pulumi.String("luffield"),
// pulumi.String("woodcote"),
// pulumi.String("copse"),
// pulumi.String("chapel"),
// pulumi.String("stowe"),
// pulumi.String("club"),
// },
// })
// if err != nil {
// return err
// }
// _, err = lakeformation.NewLfTag(ctx, "example2", &lakeformation.LfTagArgs{
// Key: pulumi.String("left"),
// Values: pulumi.StringArray{
// pulumi.String("farm"),
// pulumi.String("theloop"),
// pulumi.String("aintree"),
// pulumi.String("brooklands"),
// pulumi.String("maggotts"),
// pulumi.String("becketts"),
// pulumi.String("vale"),
// },
// })
// if err != nil {
// return err
// }
// _, err = lakeformation.NewResourceLfTags(ctx, "example", &lakeformation.ResourceLfTagsArgs{
// Database: &lakeformation.ResourceLfTagsDatabaseArgs{
// Name: pulumi.Any(exampleAwsGlueCatalogDatabase.Name),
// },
// LfTags: lakeformation.ResourceLfTagsLfTagArray{
// &lakeformation.ResourceLfTagsLfTagArgs{
// Key: pulumi.String("right"),
// Value: pulumi.String("luffield"),
// },
// &lakeformation.ResourceLfTagsLfTagArgs{
// Key: pulumi.String("left"),
// Value: pulumi.String("aintree"),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
type ResourceLfTags struct {
pulumi.CustomResourceState
// Identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your Lake Formation environment.
CatalogId pulumi.StringOutput `pulumi:"catalogId"`
// Configuration block for a database resource. See below.
Database ResourceLfTagsDatabaseOutput `pulumi:"database"`
// Set of LF-tags to attach to the resource. See below.
//
// Exactly one of the following is required:
LfTags ResourceLfTagsLfTagArrayOutput `pulumi:"lfTags"`
// Configuration block for a table resource. See below.
Table ResourceLfTagsTableOutput `pulumi:"table"`
// Configuration block for a table with columns resource. See below.
//
// The following arguments are optional:
TableWithColumns ResourceLfTagsTableWithColumnsOutput `pulumi:"tableWithColumns"`
}
// NewResourceLfTags registers a new resource with the given unique name, arguments, and options.
func NewResourceLfTags(ctx *pulumi.Context,
name string, args *ResourceLfTagsArgs, opts ...pulumi.ResourceOption) (*ResourceLfTags, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.LfTags == nil {
return nil, errors.New("invalid value for required argument 'LfTags'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ResourceLfTags
err := ctx.RegisterResource("aws:lakeformation/resourceLfTags:ResourceLfTags", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetResourceLfTags gets an existing ResourceLfTags resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetResourceLfTags(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ResourceLfTagsState, opts ...pulumi.ResourceOption) (*ResourceLfTags, error) {
var resource ResourceLfTags
err := ctx.ReadResource("aws:lakeformation/resourceLfTags:ResourceLfTags", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ResourceLfTags resources.
type resourceLfTagsState struct {
// Identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your Lake Formation environment.
CatalogId *string `pulumi:"catalogId"`
// Configuration block for a database resource. See below.
Database *ResourceLfTagsDatabase `pulumi:"database"`
// Set of LF-tags to attach to the resource. See below.
//
// Exactly one of the following is required:
LfTags []ResourceLfTagsLfTag `pulumi:"lfTags"`
// Configuration block for a table resource. See below.
Table *ResourceLfTagsTable `pulumi:"table"`
// Configuration block for a table with columns resource. See below.
//
// The following arguments are optional:
TableWithColumns *ResourceLfTagsTableWithColumns `pulumi:"tableWithColumns"`
}
type ResourceLfTagsState struct {
// Identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your Lake Formation environment.
CatalogId pulumi.StringPtrInput
// Configuration block for a database resource. See below.
Database ResourceLfTagsDatabasePtrInput
// Set of LF-tags to attach to the resource. See below.
//
// Exactly one of the following is required:
LfTags ResourceLfTagsLfTagArrayInput
// Configuration block for a table resource. See below.
Table ResourceLfTagsTablePtrInput
// Configuration block for a table with columns resource. See below.
//
// The following arguments are optional:
TableWithColumns ResourceLfTagsTableWithColumnsPtrInput
}
func (ResourceLfTagsState) ElementType() reflect.Type {
return reflect.TypeOf((*resourceLfTagsState)(nil)).Elem()
}
type resourceLfTagsArgs struct {
// Identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your Lake Formation environment.
CatalogId *string `pulumi:"catalogId"`
// Configuration block for a database resource. See below.
Database *ResourceLfTagsDatabase `pulumi:"database"`
// Set of LF-tags to attach to the resource. See below.
//
// Exactly one of the following is required:
LfTags []ResourceLfTagsLfTag `pulumi:"lfTags"`
// Configuration block for a table resource. See below.
Table *ResourceLfTagsTable `pulumi:"table"`
// Configuration block for a table with columns resource. See below.
//
// The following arguments are optional:
TableWithColumns *ResourceLfTagsTableWithColumns `pulumi:"tableWithColumns"`
}
// The set of arguments for constructing a ResourceLfTags resource.
type ResourceLfTagsArgs struct {
// Identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your Lake Formation environment.
CatalogId pulumi.StringPtrInput
// Configuration block for a database resource. See below.
Database ResourceLfTagsDatabasePtrInput
// Set of LF-tags to attach to the resource. See below.
//
// Exactly one of the following is required:
LfTags ResourceLfTagsLfTagArrayInput
// Configuration block for a table resource. See below.
Table ResourceLfTagsTablePtrInput
// Configuration block for a table with columns resource. See below.
//
// The following arguments are optional:
TableWithColumns ResourceLfTagsTableWithColumnsPtrInput
}
func (ResourceLfTagsArgs) ElementType() reflect.Type {
return reflect.TypeOf((*resourceLfTagsArgs)(nil)).Elem()
}
type ResourceLfTagsInput interface {
pulumi.Input
ToResourceLfTagsOutput() ResourceLfTagsOutput
ToResourceLfTagsOutputWithContext(ctx context.Context) ResourceLfTagsOutput
}
func (*ResourceLfTags) ElementType() reflect.Type {
return reflect.TypeOf((**ResourceLfTags)(nil)).Elem()
}
func (i *ResourceLfTags) ToResourceLfTagsOutput() ResourceLfTagsOutput {
return i.ToResourceLfTagsOutputWithContext(context.Background())
}
func (i *ResourceLfTags) ToResourceLfTagsOutputWithContext(ctx context.Context) ResourceLfTagsOutput {
return pulumi.ToOutputWithContext(ctx, i).(ResourceLfTagsOutput)
}
// ResourceLfTagsArrayInput is an input type that accepts ResourceLfTagsArray and ResourceLfTagsArrayOutput values.
// You can construct a concrete instance of `ResourceLfTagsArrayInput` via:
//
// ResourceLfTagsArray{ ResourceLfTagsArgs{...} }
type ResourceLfTagsArrayInput interface {
pulumi.Input
ToResourceLfTagsArrayOutput() ResourceLfTagsArrayOutput
ToResourceLfTagsArrayOutputWithContext(context.Context) ResourceLfTagsArrayOutput
}
type ResourceLfTagsArray []ResourceLfTagsInput
func (ResourceLfTagsArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ResourceLfTags)(nil)).Elem()
}
func (i ResourceLfTagsArray) ToResourceLfTagsArrayOutput() ResourceLfTagsArrayOutput {
return i.ToResourceLfTagsArrayOutputWithContext(context.Background())
}
func (i ResourceLfTagsArray) ToResourceLfTagsArrayOutputWithContext(ctx context.Context) ResourceLfTagsArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ResourceLfTagsArrayOutput)
}
// ResourceLfTagsMapInput is an input type that accepts ResourceLfTagsMap and ResourceLfTagsMapOutput values.
// You can construct a concrete instance of `ResourceLfTagsMapInput` via:
//
// ResourceLfTagsMap{ "key": ResourceLfTagsArgs{...} }
type ResourceLfTagsMapInput interface {
pulumi.Input
ToResourceLfTagsMapOutput() ResourceLfTagsMapOutput
ToResourceLfTagsMapOutputWithContext(context.Context) ResourceLfTagsMapOutput
}
type ResourceLfTagsMap map[string]ResourceLfTagsInput
func (ResourceLfTagsMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ResourceLfTags)(nil)).Elem()
}
func (i ResourceLfTagsMap) ToResourceLfTagsMapOutput() ResourceLfTagsMapOutput {
return i.ToResourceLfTagsMapOutputWithContext(context.Background())
}
func (i ResourceLfTagsMap) ToResourceLfTagsMapOutputWithContext(ctx context.Context) ResourceLfTagsMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ResourceLfTagsMapOutput)
}
type ResourceLfTagsOutput struct{ *pulumi.OutputState }
func (ResourceLfTagsOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ResourceLfTags)(nil)).Elem()
}
func (o ResourceLfTagsOutput) ToResourceLfTagsOutput() ResourceLfTagsOutput {
return o
}
func (o ResourceLfTagsOutput) ToResourceLfTagsOutputWithContext(ctx context.Context) ResourceLfTagsOutput {
return o
}
// Identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your Lake Formation environment.
func (o ResourceLfTagsOutput) CatalogId() pulumi.StringOutput {
return o.ApplyT(func(v *ResourceLfTags) pulumi.StringOutput { return v.CatalogId }).(pulumi.StringOutput)
}
// Configuration block for a database resource. See below.
func (o ResourceLfTagsOutput) Database() ResourceLfTagsDatabaseOutput {
return o.ApplyT(func(v *ResourceLfTags) ResourceLfTagsDatabaseOutput { return v.Database }).(ResourceLfTagsDatabaseOutput)
}
// Set of LF-tags to attach to the resource. See below.
//
// Exactly one of the following is required:
func (o ResourceLfTagsOutput) LfTags() ResourceLfTagsLfTagArrayOutput {
return o.ApplyT(func(v *ResourceLfTags) ResourceLfTagsLfTagArrayOutput { return v.LfTags }).(ResourceLfTagsLfTagArrayOutput)
}
// Configuration block for a table resource. See below.
func (o ResourceLfTagsOutput) Table() ResourceLfTagsTableOutput {
return o.ApplyT(func(v *ResourceLfTags) ResourceLfTagsTableOutput { return v.Table }).(ResourceLfTagsTableOutput)
}
// Configuration block for a table with columns resource. See below.
//
// The following arguments are optional:
func (o ResourceLfTagsOutput) TableWithColumns() ResourceLfTagsTableWithColumnsOutput {
return o.ApplyT(func(v *ResourceLfTags) ResourceLfTagsTableWithColumnsOutput { return v.TableWithColumns }).(ResourceLfTagsTableWithColumnsOutput)
}
type ResourceLfTagsArrayOutput struct{ *pulumi.OutputState }
func (ResourceLfTagsArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ResourceLfTags)(nil)).Elem()
}
func (o ResourceLfTagsArrayOutput) ToResourceLfTagsArrayOutput() ResourceLfTagsArrayOutput {
return o
}
func (o ResourceLfTagsArrayOutput) ToResourceLfTagsArrayOutputWithContext(ctx context.Context) ResourceLfTagsArrayOutput {
return o
}
func (o ResourceLfTagsArrayOutput) Index(i pulumi.IntInput) ResourceLfTagsOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ResourceLfTags {
return vs[0].([]*ResourceLfTags)[vs[1].(int)]
}).(ResourceLfTagsOutput)
}
type ResourceLfTagsMapOutput struct{ *pulumi.OutputState }
func (ResourceLfTagsMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ResourceLfTags)(nil)).Elem()
}
func (o ResourceLfTagsMapOutput) ToResourceLfTagsMapOutput() ResourceLfTagsMapOutput {
return o
}
func (o ResourceLfTagsMapOutput) ToResourceLfTagsMapOutputWithContext(ctx context.Context) ResourceLfTagsMapOutput {
return o
}
func (o ResourceLfTagsMapOutput) MapIndex(k pulumi.StringInput) ResourceLfTagsOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ResourceLfTags {
return vs[0].(map[string]*ResourceLfTags)[vs[1].(string)]
}).(ResourceLfTagsOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ResourceLfTagsInput)(nil)).Elem(), &ResourceLfTags{})
pulumi.RegisterInputType(reflect.TypeOf((*ResourceLfTagsArrayInput)(nil)).Elem(), ResourceLfTagsArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ResourceLfTagsMapInput)(nil)).Elem(), ResourceLfTagsMap{})
pulumi.RegisterOutputType(ResourceLfTagsOutput{})
pulumi.RegisterOutputType(ResourceLfTagsArrayOutput{})
pulumi.RegisterOutputType(ResourceLfTagsMapOutput{})
}