/
catalogDatabase.go
295 lines (249 loc) · 11.2 KB
/
catalogDatabase.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package glue
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// 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
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/glue"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := glue.NewCatalogDatabase(ctx, "awsGlueCatalogDatabase", &glue.CatalogDatabaseArgs{
// Name: pulumi.String("MyCatalogDatabase"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Glue Catalog Databases can be imported using the `catalog_id:name`. If you have not set a Catalog ID specify the AWS Account ID that the database is in, e.g.,
//
// ```sh
// $ pulumi import aws:glue/catalogDatabase:CatalogDatabase database 123456789012:my_database
// ```
type CatalogDatabase struct {
pulumi.CustomResourceState
// ARN of the Glue Catalog Database.
Arn pulumi.StringOutput `pulumi:"arn"`
// ID of the Data Catalog in which the database resides.
CatalogId pulumi.StringOutput `pulumi:"catalogId"`
// Description of the database.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Location of the database (for example, an HDFS path).
LocationUri pulumi.StringOutput `pulumi:"locationUri"`
// Name of the database. The acceptable characters are lowercase letters, numbers, and the underscore character.
Name pulumi.StringOutput `pulumi:"name"`
// List of key-value pairs that define parameters and properties of the database.
Parameters pulumi.StringMapOutput `pulumi:"parameters"`
// Configuration block for a target database for resource linking. See `targetDatabase` below.
TargetDatabase CatalogDatabaseTargetDatabasePtrOutput `pulumi:"targetDatabase"`
}
// NewCatalogDatabase registers a new resource with the given unique name, arguments, and options.
func NewCatalogDatabase(ctx *pulumi.Context,
name string, args *CatalogDatabaseArgs, opts ...pulumi.ResourceOption) (*CatalogDatabase, error) {
if args == nil {
args = &CatalogDatabaseArgs{}
}
var resource CatalogDatabase
err := ctx.RegisterResource("aws:glue/catalogDatabase:CatalogDatabase", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCatalogDatabase gets an existing CatalogDatabase 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 GetCatalogDatabase(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CatalogDatabaseState, opts ...pulumi.ResourceOption) (*CatalogDatabase, error) {
var resource CatalogDatabase
err := ctx.ReadResource("aws:glue/catalogDatabase:CatalogDatabase", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering CatalogDatabase resources.
type catalogDatabaseState struct {
// ARN of the Glue Catalog Database.
Arn *string `pulumi:"arn"`
// ID of the Data Catalog in which the database resides.
CatalogId *string `pulumi:"catalogId"`
// Description of the database.
Description *string `pulumi:"description"`
// Location of the database (for example, an HDFS path).
LocationUri *string `pulumi:"locationUri"`
// Name of the database. The acceptable characters are lowercase letters, numbers, and the underscore character.
Name *string `pulumi:"name"`
// List of key-value pairs that define parameters and properties of the database.
Parameters map[string]string `pulumi:"parameters"`
// Configuration block for a target database for resource linking. See `targetDatabase` below.
TargetDatabase *CatalogDatabaseTargetDatabase `pulumi:"targetDatabase"`
}
type CatalogDatabaseState struct {
// ARN of the Glue Catalog Database.
Arn pulumi.StringPtrInput
// ID of the Data Catalog in which the database resides.
CatalogId pulumi.StringPtrInput
// Description of the database.
Description pulumi.StringPtrInput
// Location of the database (for example, an HDFS path).
LocationUri pulumi.StringPtrInput
// Name of the database. The acceptable characters are lowercase letters, numbers, and the underscore character.
Name pulumi.StringPtrInput
// List of key-value pairs that define parameters and properties of the database.
Parameters pulumi.StringMapInput
// Configuration block for a target database for resource linking. See `targetDatabase` below.
TargetDatabase CatalogDatabaseTargetDatabasePtrInput
}
func (CatalogDatabaseState) ElementType() reflect.Type {
return reflect.TypeOf((*catalogDatabaseState)(nil)).Elem()
}
type catalogDatabaseArgs struct {
// ID of the Data Catalog in which the database resides.
CatalogId *string `pulumi:"catalogId"`
// Description of the database.
Description *string `pulumi:"description"`
// Location of the database (for example, an HDFS path).
LocationUri *string `pulumi:"locationUri"`
// Name of the database. The acceptable characters are lowercase letters, numbers, and the underscore character.
Name *string `pulumi:"name"`
// List of key-value pairs that define parameters and properties of the database.
Parameters map[string]string `pulumi:"parameters"`
// Configuration block for a target database for resource linking. See `targetDatabase` below.
TargetDatabase *CatalogDatabaseTargetDatabase `pulumi:"targetDatabase"`
}
// The set of arguments for constructing a CatalogDatabase resource.
type CatalogDatabaseArgs struct {
// ID of the Data Catalog in which the database resides.
CatalogId pulumi.StringPtrInput
// Description of the database.
Description pulumi.StringPtrInput
// Location of the database (for example, an HDFS path).
LocationUri pulumi.StringPtrInput
// Name of the database. The acceptable characters are lowercase letters, numbers, and the underscore character.
Name pulumi.StringPtrInput
// List of key-value pairs that define parameters and properties of the database.
Parameters pulumi.StringMapInput
// Configuration block for a target database for resource linking. See `targetDatabase` below.
TargetDatabase CatalogDatabaseTargetDatabasePtrInput
}
func (CatalogDatabaseArgs) ElementType() reflect.Type {
return reflect.TypeOf((*catalogDatabaseArgs)(nil)).Elem()
}
type CatalogDatabaseInput interface {
pulumi.Input
ToCatalogDatabaseOutput() CatalogDatabaseOutput
ToCatalogDatabaseOutputWithContext(ctx context.Context) CatalogDatabaseOutput
}
func (*CatalogDatabase) ElementType() reflect.Type {
return reflect.TypeOf((**CatalogDatabase)(nil)).Elem()
}
func (i *CatalogDatabase) ToCatalogDatabaseOutput() CatalogDatabaseOutput {
return i.ToCatalogDatabaseOutputWithContext(context.Background())
}
func (i *CatalogDatabase) ToCatalogDatabaseOutputWithContext(ctx context.Context) CatalogDatabaseOutput {
return pulumi.ToOutputWithContext(ctx, i).(CatalogDatabaseOutput)
}
// CatalogDatabaseArrayInput is an input type that accepts CatalogDatabaseArray and CatalogDatabaseArrayOutput values.
// You can construct a concrete instance of `CatalogDatabaseArrayInput` via:
//
// CatalogDatabaseArray{ CatalogDatabaseArgs{...} }
type CatalogDatabaseArrayInput interface {
pulumi.Input
ToCatalogDatabaseArrayOutput() CatalogDatabaseArrayOutput
ToCatalogDatabaseArrayOutputWithContext(context.Context) CatalogDatabaseArrayOutput
}
type CatalogDatabaseArray []CatalogDatabaseInput
func (CatalogDatabaseArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CatalogDatabase)(nil)).Elem()
}
func (i CatalogDatabaseArray) ToCatalogDatabaseArrayOutput() CatalogDatabaseArrayOutput {
return i.ToCatalogDatabaseArrayOutputWithContext(context.Background())
}
func (i CatalogDatabaseArray) ToCatalogDatabaseArrayOutputWithContext(ctx context.Context) CatalogDatabaseArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(CatalogDatabaseArrayOutput)
}
// CatalogDatabaseMapInput is an input type that accepts CatalogDatabaseMap and CatalogDatabaseMapOutput values.
// You can construct a concrete instance of `CatalogDatabaseMapInput` via:
//
// CatalogDatabaseMap{ "key": CatalogDatabaseArgs{...} }
type CatalogDatabaseMapInput interface {
pulumi.Input
ToCatalogDatabaseMapOutput() CatalogDatabaseMapOutput
ToCatalogDatabaseMapOutputWithContext(context.Context) CatalogDatabaseMapOutput
}
type CatalogDatabaseMap map[string]CatalogDatabaseInput
func (CatalogDatabaseMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CatalogDatabase)(nil)).Elem()
}
func (i CatalogDatabaseMap) ToCatalogDatabaseMapOutput() CatalogDatabaseMapOutput {
return i.ToCatalogDatabaseMapOutputWithContext(context.Background())
}
func (i CatalogDatabaseMap) ToCatalogDatabaseMapOutputWithContext(ctx context.Context) CatalogDatabaseMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(CatalogDatabaseMapOutput)
}
type CatalogDatabaseOutput struct{ *pulumi.OutputState }
func (CatalogDatabaseOutput) ElementType() reflect.Type {
return reflect.TypeOf((**CatalogDatabase)(nil)).Elem()
}
func (o CatalogDatabaseOutput) ToCatalogDatabaseOutput() CatalogDatabaseOutput {
return o
}
func (o CatalogDatabaseOutput) ToCatalogDatabaseOutputWithContext(ctx context.Context) CatalogDatabaseOutput {
return o
}
type CatalogDatabaseArrayOutput struct{ *pulumi.OutputState }
func (CatalogDatabaseArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CatalogDatabase)(nil)).Elem()
}
func (o CatalogDatabaseArrayOutput) ToCatalogDatabaseArrayOutput() CatalogDatabaseArrayOutput {
return o
}
func (o CatalogDatabaseArrayOutput) ToCatalogDatabaseArrayOutputWithContext(ctx context.Context) CatalogDatabaseArrayOutput {
return o
}
func (o CatalogDatabaseArrayOutput) Index(i pulumi.IntInput) CatalogDatabaseOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CatalogDatabase {
return vs[0].([]*CatalogDatabase)[vs[1].(int)]
}).(CatalogDatabaseOutput)
}
type CatalogDatabaseMapOutput struct{ *pulumi.OutputState }
func (CatalogDatabaseMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CatalogDatabase)(nil)).Elem()
}
func (o CatalogDatabaseMapOutput) ToCatalogDatabaseMapOutput() CatalogDatabaseMapOutput {
return o
}
func (o CatalogDatabaseMapOutput) ToCatalogDatabaseMapOutputWithContext(ctx context.Context) CatalogDatabaseMapOutput {
return o
}
func (o CatalogDatabaseMapOutput) MapIndex(k pulumi.StringInput) CatalogDatabaseOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CatalogDatabase {
return vs[0].(map[string]*CatalogDatabase)[vs[1].(string)]
}).(CatalogDatabaseOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CatalogDatabaseInput)(nil)).Elem(), &CatalogDatabase{})
pulumi.RegisterInputType(reflect.TypeOf((*CatalogDatabaseArrayInput)(nil)).Elem(), CatalogDatabaseArray{})
pulumi.RegisterInputType(reflect.TypeOf((*CatalogDatabaseMapInput)(nil)).Elem(), CatalogDatabaseMap{})
pulumi.RegisterOutputType(CatalogDatabaseOutput{})
pulumi.RegisterOutputType(CatalogDatabaseArrayOutput{})
pulumi.RegisterOutputType(CatalogDatabaseMapOutput{})
}