/
linkedServiceOdbc.go
408 lines (353 loc) · 19 KB
/
linkedServiceOdbc.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
// 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 datafactory
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Linked Service (connection) between a Database and Azure Data Factory through ODBC protocol.
//
// > **Note:** All arguments including the connectionString will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html).
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleFactory, err := datafactory.NewFactory(ctx, "example", &datafactory.FactoryArgs{
// Name: pulumi.String("example"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// })
// if err != nil {
// return err
// }
// _, err = datafactory.NewLinkedServiceOdbc(ctx, "anonymous", &datafactory.LinkedServiceOdbcArgs{
// Name: pulumi.String("anonymous"),
// DataFactoryId: exampleFactory.ID(),
// ConnectionString: pulumi.String("Driver={SQL Server};Server=test;Database=test;Uid=test;Pwd=test;"),
// })
// if err != nil {
// return err
// }
// _, err = datafactory.NewLinkedServiceOdbc(ctx, "basic_auth", &datafactory.LinkedServiceOdbcArgs{
// Name: pulumi.String("basic_auth"),
// DataFactoryId: exampleFactory.ID(),
// ConnectionString: pulumi.String("Driver={SQL Server};Server=test;Database=test;Uid=test;Pwd=test;"),
// BasicAuthentication: &datafactory.LinkedServiceOdbcBasicAuthenticationArgs{
// Username: pulumi.String("onrylmz"),
// Password: pulumi.String("Ch4ngeM3!"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Data Factory ODBC Linked Service's can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:datafactory/linkedServiceOdbc:LinkedServiceOdbc example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.DataFactory/factories/example/linkedservices/example
// ```
type LinkedServiceOdbc struct {
pulumi.CustomResourceState
// A map of additional properties to associate with the Data Factory Linked Service ODBC.
AdditionalProperties pulumi.StringMapOutput `pulumi:"additionalProperties"`
// List of tags that can be used for describing the Data Factory Linked Service ODBC.
Annotations pulumi.StringArrayOutput `pulumi:"annotations"`
// A `basicAuthentication` block as defined below.
BasicAuthentication LinkedServiceOdbcBasicAuthenticationPtrOutput `pulumi:"basicAuthentication"`
// The connection string in which to authenticate with ODBC.
ConnectionString pulumi.StringOutput `pulumi:"connectionString"`
// The Data Factory ID in which to associate the Linked Service with. Changing this forces a new resource.
DataFactoryId pulumi.StringOutput `pulumi:"dataFactoryId"`
// The description for the Data Factory Linked Service ODBC.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The integration runtime reference to associate with the Data Factory Linked Service ODBC.
IntegrationRuntimeName pulumi.StringPtrOutput `pulumi:"integrationRuntimeName"`
// Specifies the name of the Data Factory Linked Service ODBC. Changing this forces a new resource to be created. Must be unique within a data factory. See the [Microsoft documentation](https://docs.microsoft.com/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 ODBC.
Parameters pulumi.StringMapOutput `pulumi:"parameters"`
}
// NewLinkedServiceOdbc registers a new resource with the given unique name, arguments, and options.
func NewLinkedServiceOdbc(ctx *pulumi.Context,
name string, args *LinkedServiceOdbcArgs, opts ...pulumi.ResourceOption) (*LinkedServiceOdbc, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ConnectionString == nil {
return nil, errors.New("invalid value for required argument 'ConnectionString'")
}
if args.DataFactoryId == nil {
return nil, errors.New("invalid value for required argument 'DataFactoryId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource LinkedServiceOdbc
err := ctx.RegisterResource("azure:datafactory/linkedServiceOdbc:LinkedServiceOdbc", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetLinkedServiceOdbc gets an existing LinkedServiceOdbc 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 GetLinkedServiceOdbc(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *LinkedServiceOdbcState, opts ...pulumi.ResourceOption) (*LinkedServiceOdbc, error) {
var resource LinkedServiceOdbc
err := ctx.ReadResource("azure:datafactory/linkedServiceOdbc:LinkedServiceOdbc", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering LinkedServiceOdbc resources.
type linkedServiceOdbcState struct {
// A map of additional properties to associate with the Data Factory Linked Service ODBC.
AdditionalProperties map[string]string `pulumi:"additionalProperties"`
// List of tags that can be used for describing the Data Factory Linked Service ODBC.
Annotations []string `pulumi:"annotations"`
// A `basicAuthentication` block as defined below.
BasicAuthentication *LinkedServiceOdbcBasicAuthentication `pulumi:"basicAuthentication"`
// The connection string in which to authenticate with ODBC.
ConnectionString *string `pulumi:"connectionString"`
// The Data Factory ID in which to associate the Linked Service with. Changing this forces a new resource.
DataFactoryId *string `pulumi:"dataFactoryId"`
// The description for the Data Factory Linked Service ODBC.
Description *string `pulumi:"description"`
// The integration runtime reference to associate with the Data Factory Linked Service ODBC.
IntegrationRuntimeName *string `pulumi:"integrationRuntimeName"`
// Specifies the name of the Data Factory Linked Service ODBC. Changing this forces a new resource to be created. Must be unique within a data factory. See the [Microsoft documentation](https://docs.microsoft.com/azure/data-factory/naming-rules) for all restrictions.
Name *string `pulumi:"name"`
// A map of parameters to associate with the Data Factory Linked Service ODBC.
Parameters map[string]string `pulumi:"parameters"`
}
type LinkedServiceOdbcState struct {
// A map of additional properties to associate with the Data Factory Linked Service ODBC.
AdditionalProperties pulumi.StringMapInput
// List of tags that can be used for describing the Data Factory Linked Service ODBC.
Annotations pulumi.StringArrayInput
// A `basicAuthentication` block as defined below.
BasicAuthentication LinkedServiceOdbcBasicAuthenticationPtrInput
// The connection string in which to authenticate with ODBC.
ConnectionString pulumi.StringPtrInput
// The Data Factory ID in which to associate the Linked Service with. Changing this forces a new resource.
DataFactoryId pulumi.StringPtrInput
// The description for the Data Factory Linked Service ODBC.
Description pulumi.StringPtrInput
// The integration runtime reference to associate with the Data Factory Linked Service ODBC.
IntegrationRuntimeName pulumi.StringPtrInput
// Specifies the name of the Data Factory Linked Service ODBC. Changing this forces a new resource to be created. Must be unique within a data factory. See the [Microsoft documentation](https://docs.microsoft.com/azure/data-factory/naming-rules) for all restrictions.
Name pulumi.StringPtrInput
// A map of parameters to associate with the Data Factory Linked Service ODBC.
Parameters pulumi.StringMapInput
}
func (LinkedServiceOdbcState) ElementType() reflect.Type {
return reflect.TypeOf((*linkedServiceOdbcState)(nil)).Elem()
}
type linkedServiceOdbcArgs struct {
// A map of additional properties to associate with the Data Factory Linked Service ODBC.
AdditionalProperties map[string]string `pulumi:"additionalProperties"`
// List of tags that can be used for describing the Data Factory Linked Service ODBC.
Annotations []string `pulumi:"annotations"`
// A `basicAuthentication` block as defined below.
BasicAuthentication *LinkedServiceOdbcBasicAuthentication `pulumi:"basicAuthentication"`
// The connection string in which to authenticate with ODBC.
ConnectionString string `pulumi:"connectionString"`
// The Data Factory ID in which to associate the Linked Service with. Changing this forces a new resource.
DataFactoryId string `pulumi:"dataFactoryId"`
// The description for the Data Factory Linked Service ODBC.
Description *string `pulumi:"description"`
// The integration runtime reference to associate with the Data Factory Linked Service ODBC.
IntegrationRuntimeName *string `pulumi:"integrationRuntimeName"`
// Specifies the name of the Data Factory Linked Service ODBC. Changing this forces a new resource to be created. Must be unique within a data factory. See the [Microsoft documentation](https://docs.microsoft.com/azure/data-factory/naming-rules) for all restrictions.
Name *string `pulumi:"name"`
// A map of parameters to associate with the Data Factory Linked Service ODBC.
Parameters map[string]string `pulumi:"parameters"`
}
// The set of arguments for constructing a LinkedServiceOdbc resource.
type LinkedServiceOdbcArgs struct {
// A map of additional properties to associate with the Data Factory Linked Service ODBC.
AdditionalProperties pulumi.StringMapInput
// List of tags that can be used for describing the Data Factory Linked Service ODBC.
Annotations pulumi.StringArrayInput
// A `basicAuthentication` block as defined below.
BasicAuthentication LinkedServiceOdbcBasicAuthenticationPtrInput
// The connection string in which to authenticate with ODBC.
ConnectionString pulumi.StringInput
// The Data Factory ID in which to associate the Linked Service with. Changing this forces a new resource.
DataFactoryId pulumi.StringInput
// The description for the Data Factory Linked Service ODBC.
Description pulumi.StringPtrInput
// The integration runtime reference to associate with the Data Factory Linked Service ODBC.
IntegrationRuntimeName pulumi.StringPtrInput
// Specifies the name of the Data Factory Linked Service ODBC. Changing this forces a new resource to be created. Must be unique within a data factory. See the [Microsoft documentation](https://docs.microsoft.com/azure/data-factory/naming-rules) for all restrictions.
Name pulumi.StringPtrInput
// A map of parameters to associate with the Data Factory Linked Service ODBC.
Parameters pulumi.StringMapInput
}
func (LinkedServiceOdbcArgs) ElementType() reflect.Type {
return reflect.TypeOf((*linkedServiceOdbcArgs)(nil)).Elem()
}
type LinkedServiceOdbcInput interface {
pulumi.Input
ToLinkedServiceOdbcOutput() LinkedServiceOdbcOutput
ToLinkedServiceOdbcOutputWithContext(ctx context.Context) LinkedServiceOdbcOutput
}
func (*LinkedServiceOdbc) ElementType() reflect.Type {
return reflect.TypeOf((**LinkedServiceOdbc)(nil)).Elem()
}
func (i *LinkedServiceOdbc) ToLinkedServiceOdbcOutput() LinkedServiceOdbcOutput {
return i.ToLinkedServiceOdbcOutputWithContext(context.Background())
}
func (i *LinkedServiceOdbc) ToLinkedServiceOdbcOutputWithContext(ctx context.Context) LinkedServiceOdbcOutput {
return pulumi.ToOutputWithContext(ctx, i).(LinkedServiceOdbcOutput)
}
// LinkedServiceOdbcArrayInput is an input type that accepts LinkedServiceOdbcArray and LinkedServiceOdbcArrayOutput values.
// You can construct a concrete instance of `LinkedServiceOdbcArrayInput` via:
//
// LinkedServiceOdbcArray{ LinkedServiceOdbcArgs{...} }
type LinkedServiceOdbcArrayInput interface {
pulumi.Input
ToLinkedServiceOdbcArrayOutput() LinkedServiceOdbcArrayOutput
ToLinkedServiceOdbcArrayOutputWithContext(context.Context) LinkedServiceOdbcArrayOutput
}
type LinkedServiceOdbcArray []LinkedServiceOdbcInput
func (LinkedServiceOdbcArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*LinkedServiceOdbc)(nil)).Elem()
}
func (i LinkedServiceOdbcArray) ToLinkedServiceOdbcArrayOutput() LinkedServiceOdbcArrayOutput {
return i.ToLinkedServiceOdbcArrayOutputWithContext(context.Background())
}
func (i LinkedServiceOdbcArray) ToLinkedServiceOdbcArrayOutputWithContext(ctx context.Context) LinkedServiceOdbcArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(LinkedServiceOdbcArrayOutput)
}
// LinkedServiceOdbcMapInput is an input type that accepts LinkedServiceOdbcMap and LinkedServiceOdbcMapOutput values.
// You can construct a concrete instance of `LinkedServiceOdbcMapInput` via:
//
// LinkedServiceOdbcMap{ "key": LinkedServiceOdbcArgs{...} }
type LinkedServiceOdbcMapInput interface {
pulumi.Input
ToLinkedServiceOdbcMapOutput() LinkedServiceOdbcMapOutput
ToLinkedServiceOdbcMapOutputWithContext(context.Context) LinkedServiceOdbcMapOutput
}
type LinkedServiceOdbcMap map[string]LinkedServiceOdbcInput
func (LinkedServiceOdbcMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*LinkedServiceOdbc)(nil)).Elem()
}
func (i LinkedServiceOdbcMap) ToLinkedServiceOdbcMapOutput() LinkedServiceOdbcMapOutput {
return i.ToLinkedServiceOdbcMapOutputWithContext(context.Background())
}
func (i LinkedServiceOdbcMap) ToLinkedServiceOdbcMapOutputWithContext(ctx context.Context) LinkedServiceOdbcMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(LinkedServiceOdbcMapOutput)
}
type LinkedServiceOdbcOutput struct{ *pulumi.OutputState }
func (LinkedServiceOdbcOutput) ElementType() reflect.Type {
return reflect.TypeOf((**LinkedServiceOdbc)(nil)).Elem()
}
func (o LinkedServiceOdbcOutput) ToLinkedServiceOdbcOutput() LinkedServiceOdbcOutput {
return o
}
func (o LinkedServiceOdbcOutput) ToLinkedServiceOdbcOutputWithContext(ctx context.Context) LinkedServiceOdbcOutput {
return o
}
// A map of additional properties to associate with the Data Factory Linked Service ODBC.
func (o LinkedServiceOdbcOutput) AdditionalProperties() pulumi.StringMapOutput {
return o.ApplyT(func(v *LinkedServiceOdbc) pulumi.StringMapOutput { return v.AdditionalProperties }).(pulumi.StringMapOutput)
}
// List of tags that can be used for describing the Data Factory Linked Service ODBC.
func (o LinkedServiceOdbcOutput) Annotations() pulumi.StringArrayOutput {
return o.ApplyT(func(v *LinkedServiceOdbc) pulumi.StringArrayOutput { return v.Annotations }).(pulumi.StringArrayOutput)
}
// A `basicAuthentication` block as defined below.
func (o LinkedServiceOdbcOutput) BasicAuthentication() LinkedServiceOdbcBasicAuthenticationPtrOutput {
return o.ApplyT(func(v *LinkedServiceOdbc) LinkedServiceOdbcBasicAuthenticationPtrOutput { return v.BasicAuthentication }).(LinkedServiceOdbcBasicAuthenticationPtrOutput)
}
// The connection string in which to authenticate with ODBC.
func (o LinkedServiceOdbcOutput) ConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v *LinkedServiceOdbc) pulumi.StringOutput { return v.ConnectionString }).(pulumi.StringOutput)
}
// The Data Factory ID in which to associate the Linked Service with. Changing this forces a new resource.
func (o LinkedServiceOdbcOutput) DataFactoryId() pulumi.StringOutput {
return o.ApplyT(func(v *LinkedServiceOdbc) pulumi.StringOutput { return v.DataFactoryId }).(pulumi.StringOutput)
}
// The description for the Data Factory Linked Service ODBC.
func (o LinkedServiceOdbcOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *LinkedServiceOdbc) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The integration runtime reference to associate with the Data Factory Linked Service ODBC.
func (o LinkedServiceOdbcOutput) IntegrationRuntimeName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *LinkedServiceOdbc) pulumi.StringPtrOutput { return v.IntegrationRuntimeName }).(pulumi.StringPtrOutput)
}
// Specifies the name of the Data Factory Linked Service ODBC. Changing this forces a new resource to be created. Must be unique within a data factory. See the [Microsoft documentation](https://docs.microsoft.com/azure/data-factory/naming-rules) for all restrictions.
func (o LinkedServiceOdbcOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *LinkedServiceOdbc) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// A map of parameters to associate with the Data Factory Linked Service ODBC.
func (o LinkedServiceOdbcOutput) Parameters() pulumi.StringMapOutput {
return o.ApplyT(func(v *LinkedServiceOdbc) pulumi.StringMapOutput { return v.Parameters }).(pulumi.StringMapOutput)
}
type LinkedServiceOdbcArrayOutput struct{ *pulumi.OutputState }
func (LinkedServiceOdbcArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*LinkedServiceOdbc)(nil)).Elem()
}
func (o LinkedServiceOdbcArrayOutput) ToLinkedServiceOdbcArrayOutput() LinkedServiceOdbcArrayOutput {
return o
}
func (o LinkedServiceOdbcArrayOutput) ToLinkedServiceOdbcArrayOutputWithContext(ctx context.Context) LinkedServiceOdbcArrayOutput {
return o
}
func (o LinkedServiceOdbcArrayOutput) Index(i pulumi.IntInput) LinkedServiceOdbcOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *LinkedServiceOdbc {
return vs[0].([]*LinkedServiceOdbc)[vs[1].(int)]
}).(LinkedServiceOdbcOutput)
}
type LinkedServiceOdbcMapOutput struct{ *pulumi.OutputState }
func (LinkedServiceOdbcMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*LinkedServiceOdbc)(nil)).Elem()
}
func (o LinkedServiceOdbcMapOutput) ToLinkedServiceOdbcMapOutput() LinkedServiceOdbcMapOutput {
return o
}
func (o LinkedServiceOdbcMapOutput) ToLinkedServiceOdbcMapOutputWithContext(ctx context.Context) LinkedServiceOdbcMapOutput {
return o
}
func (o LinkedServiceOdbcMapOutput) MapIndex(k pulumi.StringInput) LinkedServiceOdbcOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *LinkedServiceOdbc {
return vs[0].(map[string]*LinkedServiceOdbc)[vs[1].(string)]
}).(LinkedServiceOdbcOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*LinkedServiceOdbcInput)(nil)).Elem(), &LinkedServiceOdbc{})
pulumi.RegisterInputType(reflect.TypeOf((*LinkedServiceOdbcArrayInput)(nil)).Elem(), LinkedServiceOdbcArray{})
pulumi.RegisterInputType(reflect.TypeOf((*LinkedServiceOdbcMapInput)(nil)).Elem(), LinkedServiceOdbcMap{})
pulumi.RegisterOutputType(LinkedServiceOdbcOutput{})
pulumi.RegisterOutputType(LinkedServiceOdbcArrayOutput{})
pulumi.RegisterOutputType(LinkedServiceOdbcMapOutput{})
}