/
linkedServiceCosmosDb.go
393 lines (333 loc) · 18.9 KB
/
linkedServiceCosmosDb.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
// *** 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 datafactory
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Manages a Linked Service (connection) between a SFTP Server and Azure Data Factory.
//
// ## Import
//
// Data Factory Linked Service's can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:datafactory/linkedServiceCosmosDb:LinkedServiceCosmosDb example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.DataFactory/factories/example/linkedservices/example
// ```
type LinkedServiceCosmosDb struct {
pulumi.CustomResourceState
// The endpoint of the Azure CosmosDB account. Required if `connectionString` is unspecified.
AccountEndpoint pulumi.StringPtrOutput `pulumi:"accountEndpoint"`
// The account key of the Azure Cosmos DB account. Required if `connectionString` is unspecified.
AccountKey pulumi.StringPtrOutput `pulumi:"accountKey"`
// A map of additional properties to associate with the Data Factory Linked Service.
AdditionalProperties pulumi.StringMapOutput `pulumi:"additionalProperties"`
// List of tags that can be used for describing the Data Factory Linked Service.
Annotations pulumi.StringArrayOutput `pulumi:"annotations"`
// The connection string. Required if `accountEndpoint`, `accountKey`, and `database` are unspecified.
ConnectionString pulumi.StringPtrOutput `pulumi:"connectionString"`
// The Data Factory name in which to associate the Linked Service with. Changing this forces a new resource.
DataFactoryName pulumi.StringOutput `pulumi:"dataFactoryName"`
// The name of the database. Required if `connectionString` is unspecified.
Database pulumi.StringPtrOutput `pulumi:"database"`
// The description for the Data Factory Linked Service.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The integration runtime reference to associate with the Data Factory Linked Service.
IntegrationRuntimeName pulumi.StringPtrOutput `pulumi:"integrationRuntimeName"`
// Specifies the name of the Data Factory Linked Service. Changing this forces a new resource to be created. Must be unique within a data
// factory. See the [Microsoft documentation](https://docs.microsoft.com/en-us/azure/data-factory/naming-rules) for all restrictions.
Name pulumi.StringOutput `pulumi:"name"`
// A map of parameters to associate with the Data Factory Linked Service.
Parameters pulumi.StringMapOutput `pulumi:"parameters"`
// The name of the resource group in which to create the Data Factory Linked Service. Changing this forces a new resource
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
}
// NewLinkedServiceCosmosDb registers a new resource with the given unique name, arguments, and options.
func NewLinkedServiceCosmosDb(ctx *pulumi.Context,
name string, args *LinkedServiceCosmosDbArgs, opts ...pulumi.ResourceOption) (*LinkedServiceCosmosDb, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DataFactoryName == nil {
return nil, errors.New("invalid value for required argument 'DataFactoryName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
var resource LinkedServiceCosmosDb
err := ctx.RegisterResource("azure:datafactory/linkedServiceCosmosDb:LinkedServiceCosmosDb", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetLinkedServiceCosmosDb gets an existing LinkedServiceCosmosDb 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 GetLinkedServiceCosmosDb(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *LinkedServiceCosmosDbState, opts ...pulumi.ResourceOption) (*LinkedServiceCosmosDb, error) {
var resource LinkedServiceCosmosDb
err := ctx.ReadResource("azure:datafactory/linkedServiceCosmosDb:LinkedServiceCosmosDb", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering LinkedServiceCosmosDb resources.
type linkedServiceCosmosDbState struct {
// The endpoint of the Azure CosmosDB account. Required if `connectionString` is unspecified.
AccountEndpoint *string `pulumi:"accountEndpoint"`
// The account key of the Azure Cosmos DB account. Required if `connectionString` is unspecified.
AccountKey *string `pulumi:"accountKey"`
// A map of additional properties to associate with the Data Factory Linked Service.
AdditionalProperties map[string]string `pulumi:"additionalProperties"`
// List of tags that can be used for describing the Data Factory Linked Service.
Annotations []string `pulumi:"annotations"`
// The connection string. Required if `accountEndpoint`, `accountKey`, and `database` are unspecified.
ConnectionString *string `pulumi:"connectionString"`
// The Data Factory name in which to associate the Linked Service with. Changing this forces a new resource.
DataFactoryName *string `pulumi:"dataFactoryName"`
// The name of the database. Required if `connectionString` is unspecified.
Database *string `pulumi:"database"`
// The description for the Data Factory Linked Service.
Description *string `pulumi:"description"`
// The integration runtime reference to associate with the Data Factory Linked Service.
IntegrationRuntimeName *string `pulumi:"integrationRuntimeName"`
// Specifies the name of the Data Factory Linked Service. Changing this forces a new resource to be created. Must be unique within a data
// factory. See the [Microsoft documentation](https://docs.microsoft.com/en-us/azure/data-factory/naming-rules) for all restrictions.
Name *string `pulumi:"name"`
// A map of parameters to associate with the Data Factory Linked Service.
Parameters map[string]string `pulumi:"parameters"`
// The name of the resource group in which to create the Data Factory Linked Service. Changing this forces a new resource
ResourceGroupName *string `pulumi:"resourceGroupName"`
}
type LinkedServiceCosmosDbState struct {
// The endpoint of the Azure CosmosDB account. Required if `connectionString` is unspecified.
AccountEndpoint pulumi.StringPtrInput
// The account key of the Azure Cosmos DB account. Required if `connectionString` is unspecified.
AccountKey pulumi.StringPtrInput
// A map of additional properties to associate with the Data Factory Linked Service.
AdditionalProperties pulumi.StringMapInput
// List of tags that can be used for describing the Data Factory Linked Service.
Annotations pulumi.StringArrayInput
// The connection string. Required if `accountEndpoint`, `accountKey`, and `database` are unspecified.
ConnectionString pulumi.StringPtrInput
// The Data Factory name in which to associate the Linked Service with. Changing this forces a new resource.
DataFactoryName pulumi.StringPtrInput
// The name of the database. Required if `connectionString` is unspecified.
Database pulumi.StringPtrInput
// The description for the Data Factory Linked Service.
Description pulumi.StringPtrInput
// The integration runtime reference to associate with the Data Factory Linked Service.
IntegrationRuntimeName pulumi.StringPtrInput
// Specifies the name of the Data Factory Linked Service. Changing this forces a new resource to be created. Must be unique within a data
// factory. See the [Microsoft documentation](https://docs.microsoft.com/en-us/azure/data-factory/naming-rules) for all restrictions.
Name pulumi.StringPtrInput
// A map of parameters to associate with the Data Factory Linked Service.
Parameters pulumi.StringMapInput
// The name of the resource group in which to create the Data Factory Linked Service. Changing this forces a new resource
ResourceGroupName pulumi.StringPtrInput
}
func (LinkedServiceCosmosDbState) ElementType() reflect.Type {
return reflect.TypeOf((*linkedServiceCosmosDbState)(nil)).Elem()
}
type linkedServiceCosmosDbArgs struct {
// The endpoint of the Azure CosmosDB account. Required if `connectionString` is unspecified.
AccountEndpoint *string `pulumi:"accountEndpoint"`
// The account key of the Azure Cosmos DB account. Required if `connectionString` is unspecified.
AccountKey *string `pulumi:"accountKey"`
// A map of additional properties to associate with the Data Factory Linked Service.
AdditionalProperties map[string]string `pulumi:"additionalProperties"`
// List of tags that can be used for describing the Data Factory Linked Service.
Annotations []string `pulumi:"annotations"`
// The connection string. Required if `accountEndpoint`, `accountKey`, and `database` are unspecified.
ConnectionString *string `pulumi:"connectionString"`
// The Data Factory name in which to associate the Linked Service with. Changing this forces a new resource.
DataFactoryName string `pulumi:"dataFactoryName"`
// The name of the database. Required if `connectionString` is unspecified.
Database *string `pulumi:"database"`
// The description for the Data Factory Linked Service.
Description *string `pulumi:"description"`
// The integration runtime reference to associate with the Data Factory Linked Service.
IntegrationRuntimeName *string `pulumi:"integrationRuntimeName"`
// Specifies the name of the Data Factory Linked Service. Changing this forces a new resource to be created. Must be unique within a data
// factory. See the [Microsoft documentation](https://docs.microsoft.com/en-us/azure/data-factory/naming-rules) for all restrictions.
Name *string `pulumi:"name"`
// A map of parameters to associate with the Data Factory Linked Service.
Parameters map[string]string `pulumi:"parameters"`
// The name of the resource group in which to create the Data Factory Linked Service. Changing this forces a new resource
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// The set of arguments for constructing a LinkedServiceCosmosDb resource.
type LinkedServiceCosmosDbArgs struct {
// The endpoint of the Azure CosmosDB account. Required if `connectionString` is unspecified.
AccountEndpoint pulumi.StringPtrInput
// The account key of the Azure Cosmos DB account. Required if `connectionString` is unspecified.
AccountKey pulumi.StringPtrInput
// A map of additional properties to associate with the Data Factory Linked Service.
AdditionalProperties pulumi.StringMapInput
// List of tags that can be used for describing the Data Factory Linked Service.
Annotations pulumi.StringArrayInput
// The connection string. Required if `accountEndpoint`, `accountKey`, and `database` are unspecified.
ConnectionString pulumi.StringPtrInput
// The Data Factory name in which to associate the Linked Service with. Changing this forces a new resource.
DataFactoryName pulumi.StringInput
// The name of the database. Required if `connectionString` is unspecified.
Database pulumi.StringPtrInput
// The description for the Data Factory Linked Service.
Description pulumi.StringPtrInput
// The integration runtime reference to associate with the Data Factory Linked Service.
IntegrationRuntimeName pulumi.StringPtrInput
// Specifies the name of the Data Factory Linked Service. Changing this forces a new resource to be created. Must be unique within a data
// factory. See the [Microsoft documentation](https://docs.microsoft.com/en-us/azure/data-factory/naming-rules) for all restrictions.
Name pulumi.StringPtrInput
// A map of parameters to associate with the Data Factory Linked Service.
Parameters pulumi.StringMapInput
// The name of the resource group in which to create the Data Factory Linked Service. Changing this forces a new resource
ResourceGroupName pulumi.StringInput
}
func (LinkedServiceCosmosDbArgs) ElementType() reflect.Type {
return reflect.TypeOf((*linkedServiceCosmosDbArgs)(nil)).Elem()
}
type LinkedServiceCosmosDbInput interface {
pulumi.Input
ToLinkedServiceCosmosDbOutput() LinkedServiceCosmosDbOutput
ToLinkedServiceCosmosDbOutputWithContext(ctx context.Context) LinkedServiceCosmosDbOutput
}
func (*LinkedServiceCosmosDb) ElementType() reflect.Type {
return reflect.TypeOf((*LinkedServiceCosmosDb)(nil))
}
func (i *LinkedServiceCosmosDb) ToLinkedServiceCosmosDbOutput() LinkedServiceCosmosDbOutput {
return i.ToLinkedServiceCosmosDbOutputWithContext(context.Background())
}
func (i *LinkedServiceCosmosDb) ToLinkedServiceCosmosDbOutputWithContext(ctx context.Context) LinkedServiceCosmosDbOutput {
return pulumi.ToOutputWithContext(ctx, i).(LinkedServiceCosmosDbOutput)
}
func (i *LinkedServiceCosmosDb) ToLinkedServiceCosmosDbPtrOutput() LinkedServiceCosmosDbPtrOutput {
return i.ToLinkedServiceCosmosDbPtrOutputWithContext(context.Background())
}
func (i *LinkedServiceCosmosDb) ToLinkedServiceCosmosDbPtrOutputWithContext(ctx context.Context) LinkedServiceCosmosDbPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(LinkedServiceCosmosDbPtrOutput)
}
type LinkedServiceCosmosDbPtrInput interface {
pulumi.Input
ToLinkedServiceCosmosDbPtrOutput() LinkedServiceCosmosDbPtrOutput
ToLinkedServiceCosmosDbPtrOutputWithContext(ctx context.Context) LinkedServiceCosmosDbPtrOutput
}
type linkedServiceCosmosDbPtrType LinkedServiceCosmosDbArgs
func (*linkedServiceCosmosDbPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**LinkedServiceCosmosDb)(nil))
}
func (i *linkedServiceCosmosDbPtrType) ToLinkedServiceCosmosDbPtrOutput() LinkedServiceCosmosDbPtrOutput {
return i.ToLinkedServiceCosmosDbPtrOutputWithContext(context.Background())
}
func (i *linkedServiceCosmosDbPtrType) ToLinkedServiceCosmosDbPtrOutputWithContext(ctx context.Context) LinkedServiceCosmosDbPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(LinkedServiceCosmosDbPtrOutput)
}
// LinkedServiceCosmosDbArrayInput is an input type that accepts LinkedServiceCosmosDbArray and LinkedServiceCosmosDbArrayOutput values.
// You can construct a concrete instance of `LinkedServiceCosmosDbArrayInput` via:
//
// LinkedServiceCosmosDbArray{ LinkedServiceCosmosDbArgs{...} }
type LinkedServiceCosmosDbArrayInput interface {
pulumi.Input
ToLinkedServiceCosmosDbArrayOutput() LinkedServiceCosmosDbArrayOutput
ToLinkedServiceCosmosDbArrayOutputWithContext(context.Context) LinkedServiceCosmosDbArrayOutput
}
type LinkedServiceCosmosDbArray []LinkedServiceCosmosDbInput
func (LinkedServiceCosmosDbArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*LinkedServiceCosmosDb)(nil))
}
func (i LinkedServiceCosmosDbArray) ToLinkedServiceCosmosDbArrayOutput() LinkedServiceCosmosDbArrayOutput {
return i.ToLinkedServiceCosmosDbArrayOutputWithContext(context.Background())
}
func (i LinkedServiceCosmosDbArray) ToLinkedServiceCosmosDbArrayOutputWithContext(ctx context.Context) LinkedServiceCosmosDbArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(LinkedServiceCosmosDbArrayOutput)
}
// LinkedServiceCosmosDbMapInput is an input type that accepts LinkedServiceCosmosDbMap and LinkedServiceCosmosDbMapOutput values.
// You can construct a concrete instance of `LinkedServiceCosmosDbMapInput` via:
//
// LinkedServiceCosmosDbMap{ "key": LinkedServiceCosmosDbArgs{...} }
type LinkedServiceCosmosDbMapInput interface {
pulumi.Input
ToLinkedServiceCosmosDbMapOutput() LinkedServiceCosmosDbMapOutput
ToLinkedServiceCosmosDbMapOutputWithContext(context.Context) LinkedServiceCosmosDbMapOutput
}
type LinkedServiceCosmosDbMap map[string]LinkedServiceCosmosDbInput
func (LinkedServiceCosmosDbMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*LinkedServiceCosmosDb)(nil))
}
func (i LinkedServiceCosmosDbMap) ToLinkedServiceCosmosDbMapOutput() LinkedServiceCosmosDbMapOutput {
return i.ToLinkedServiceCosmosDbMapOutputWithContext(context.Background())
}
func (i LinkedServiceCosmosDbMap) ToLinkedServiceCosmosDbMapOutputWithContext(ctx context.Context) LinkedServiceCosmosDbMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(LinkedServiceCosmosDbMapOutput)
}
type LinkedServiceCosmosDbOutput struct {
*pulumi.OutputState
}
func (LinkedServiceCosmosDbOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LinkedServiceCosmosDb)(nil))
}
func (o LinkedServiceCosmosDbOutput) ToLinkedServiceCosmosDbOutput() LinkedServiceCosmosDbOutput {
return o
}
func (o LinkedServiceCosmosDbOutput) ToLinkedServiceCosmosDbOutputWithContext(ctx context.Context) LinkedServiceCosmosDbOutput {
return o
}
func (o LinkedServiceCosmosDbOutput) ToLinkedServiceCosmosDbPtrOutput() LinkedServiceCosmosDbPtrOutput {
return o.ToLinkedServiceCosmosDbPtrOutputWithContext(context.Background())
}
func (o LinkedServiceCosmosDbOutput) ToLinkedServiceCosmosDbPtrOutputWithContext(ctx context.Context) LinkedServiceCosmosDbPtrOutput {
return o.ApplyT(func(v LinkedServiceCosmosDb) *LinkedServiceCosmosDb {
return &v
}).(LinkedServiceCosmosDbPtrOutput)
}
type LinkedServiceCosmosDbPtrOutput struct {
*pulumi.OutputState
}
func (LinkedServiceCosmosDbPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**LinkedServiceCosmosDb)(nil))
}
func (o LinkedServiceCosmosDbPtrOutput) ToLinkedServiceCosmosDbPtrOutput() LinkedServiceCosmosDbPtrOutput {
return o
}
func (o LinkedServiceCosmosDbPtrOutput) ToLinkedServiceCosmosDbPtrOutputWithContext(ctx context.Context) LinkedServiceCosmosDbPtrOutput {
return o
}
type LinkedServiceCosmosDbArrayOutput struct{ *pulumi.OutputState }
func (LinkedServiceCosmosDbArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]LinkedServiceCosmosDb)(nil))
}
func (o LinkedServiceCosmosDbArrayOutput) ToLinkedServiceCosmosDbArrayOutput() LinkedServiceCosmosDbArrayOutput {
return o
}
func (o LinkedServiceCosmosDbArrayOutput) ToLinkedServiceCosmosDbArrayOutputWithContext(ctx context.Context) LinkedServiceCosmosDbArrayOutput {
return o
}
func (o LinkedServiceCosmosDbArrayOutput) Index(i pulumi.IntInput) LinkedServiceCosmosDbOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) LinkedServiceCosmosDb {
return vs[0].([]LinkedServiceCosmosDb)[vs[1].(int)]
}).(LinkedServiceCosmosDbOutput)
}
type LinkedServiceCosmosDbMapOutput struct{ *pulumi.OutputState }
func (LinkedServiceCosmosDbMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]LinkedServiceCosmosDb)(nil))
}
func (o LinkedServiceCosmosDbMapOutput) ToLinkedServiceCosmosDbMapOutput() LinkedServiceCosmosDbMapOutput {
return o
}
func (o LinkedServiceCosmosDbMapOutput) ToLinkedServiceCosmosDbMapOutputWithContext(ctx context.Context) LinkedServiceCosmosDbMapOutput {
return o
}
func (o LinkedServiceCosmosDbMapOutput) MapIndex(k pulumi.StringInput) LinkedServiceCosmosDbOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) LinkedServiceCosmosDb {
return vs[0].(map[string]LinkedServiceCosmosDb)[vs[1].(string)]
}).(LinkedServiceCosmosDbOutput)
}
func init() {
pulumi.RegisterOutputType(LinkedServiceCosmosDbOutput{})
pulumi.RegisterOutputType(LinkedServiceCosmosDbPtrOutput{})
pulumi.RegisterOutputType(LinkedServiceCosmosDbArrayOutput{})
pulumi.RegisterOutputType(LinkedServiceCosmosDbMapOutput{})
}