generated from pulumi/pulumi-tf-provider-boilerplate
/
destination.go
402 lines (340 loc) · 18.4 KB
/
destination.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
// 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 fivetran
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
"github.com/ryan-pip/pulumi-fivetran/sdk/go/fivetran/internal"
)
// ## Import
//
// 1. To import an existing `fivetran_destination` resource into your Terraform state, you need to get **Destination Group ID** on the destination page in your Fivetran dashboard. To retrieve existing groups, use the [fivetran_groups data source](/docs/data-sources/groups). 2. Define an empty resource in your `.tf` configurationhcl resource "fivetran_destination" "my_imported_destination" { }
//
// ```sh
//
// $ pulumi import fivetran:index/destination:Destination
//
// Run the `terraform import` command with the following parameters
// ```
//
// ```sh
//
// $ pulumi import fivetran:index/destination:Destination my_imported_destination {your Destination Group ID}
//
// ```
//
// 4. Use the `terraform state show` command to get the values from the stateterraform state show 'fivetran_destination.my_imported_destination' 5. Copy the values and paste them to your `.tf` configuration. -> The `config` object in the state contains all properties defined in the schema. You need to remove properties from the `config` that are not related to destinations. See the [Fivetran REST API documentation](https://fivetran.com/docs/rest-api/destinations/config) for reference to find the properties you need to keep in the `config` section.
type Destination struct {
pulumi.CustomResourceState
Config DestinationConfigOutput `pulumi:"config"`
// The unique identifier for the Group within the Fivetran system.
GroupId pulumi.StringOutput `pulumi:"groupId"`
LastUpdated pulumi.StringOutput `pulumi:"lastUpdated"`
// Region of your AWS S3 bucket
Region pulumi.StringOutput `pulumi:"region"`
// Specifies whether the setup tests should be run automatically. The default value is TRUE.
RunSetupTests pulumi.BoolPtrOutput `pulumi:"runSetupTests"`
// The destination type name within the Fivetran system.
Service pulumi.StringOutput `pulumi:"service"`
// Destination setup status
SetupStatus pulumi.StringOutput `pulumi:"setupStatus"`
// Determines the time zone for the Fivetran sync schedule.
TimeZoneOffset pulumi.StringOutput `pulumi:"timeZoneOffset"`
// Specifies whether we should trust the certificate automatically. The default value is FALSE. If a certificate is not trusted automatically, it has to be approved with [Certificates Management API Approve a destination certificate](https://fivetran.com/docs/rest-api/certificates#approveadestinationcertificate).
TrustCertificates pulumi.BoolPtrOutput `pulumi:"trustCertificates"`
// Specifies whether we should trust the SSH fingerprint automatically. The default value is FALSE. If a fingerprint is not trusted automatically, it has to be approved with [Certificates Management API Approve a destination fingerprint](https://fivetran.com/docs/rest-api/certificates#approveadestinationfingerprint).
TrustFingerprints pulumi.BoolPtrOutput `pulumi:"trustFingerprints"`
}
// NewDestination registers a new resource with the given unique name, arguments, and options.
func NewDestination(ctx *pulumi.Context,
name string, args *DestinationArgs, opts ...pulumi.ResourceOption) (*Destination, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Config == nil {
return nil, errors.New("invalid value for required argument 'Config'")
}
if args.GroupId == nil {
return nil, errors.New("invalid value for required argument 'GroupId'")
}
if args.Region == nil {
return nil, errors.New("invalid value for required argument 'Region'")
}
if args.Service == nil {
return nil, errors.New("invalid value for required argument 'Service'")
}
if args.TimeZoneOffset == nil {
return nil, errors.New("invalid value for required argument 'TimeZoneOffset'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Destination
err := ctx.RegisterResource("fivetran:index/destination:Destination", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDestination gets an existing Destination 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 GetDestination(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DestinationState, opts ...pulumi.ResourceOption) (*Destination, error) {
var resource Destination
err := ctx.ReadResource("fivetran:index/destination:Destination", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Destination resources.
type destinationState struct {
Config *DestinationConfig `pulumi:"config"`
// The unique identifier for the Group within the Fivetran system.
GroupId *string `pulumi:"groupId"`
LastUpdated *string `pulumi:"lastUpdated"`
// Region of your AWS S3 bucket
Region *string `pulumi:"region"`
// Specifies whether the setup tests should be run automatically. The default value is TRUE.
RunSetupTests *bool `pulumi:"runSetupTests"`
// The destination type name within the Fivetran system.
Service *string `pulumi:"service"`
// Destination setup status
SetupStatus *string `pulumi:"setupStatus"`
// Determines the time zone for the Fivetran sync schedule.
TimeZoneOffset *string `pulumi:"timeZoneOffset"`
// Specifies whether we should trust the certificate automatically. The default value is FALSE. If a certificate is not trusted automatically, it has to be approved with [Certificates Management API Approve a destination certificate](https://fivetran.com/docs/rest-api/certificates#approveadestinationcertificate).
TrustCertificates *bool `pulumi:"trustCertificates"`
// Specifies whether we should trust the SSH fingerprint automatically. The default value is FALSE. If a fingerprint is not trusted automatically, it has to be approved with [Certificates Management API Approve a destination fingerprint](https://fivetran.com/docs/rest-api/certificates#approveadestinationfingerprint).
TrustFingerprints *bool `pulumi:"trustFingerprints"`
}
type DestinationState struct {
Config DestinationConfigPtrInput
// The unique identifier for the Group within the Fivetran system.
GroupId pulumi.StringPtrInput
LastUpdated pulumi.StringPtrInput
// Region of your AWS S3 bucket
Region pulumi.StringPtrInput
// Specifies whether the setup tests should be run automatically. The default value is TRUE.
RunSetupTests pulumi.BoolPtrInput
// The destination type name within the Fivetran system.
Service pulumi.StringPtrInput
// Destination setup status
SetupStatus pulumi.StringPtrInput
// Determines the time zone for the Fivetran sync schedule.
TimeZoneOffset pulumi.StringPtrInput
// Specifies whether we should trust the certificate automatically. The default value is FALSE. If a certificate is not trusted automatically, it has to be approved with [Certificates Management API Approve a destination certificate](https://fivetran.com/docs/rest-api/certificates#approveadestinationcertificate).
TrustCertificates pulumi.BoolPtrInput
// Specifies whether we should trust the SSH fingerprint automatically. The default value is FALSE. If a fingerprint is not trusted automatically, it has to be approved with [Certificates Management API Approve a destination fingerprint](https://fivetran.com/docs/rest-api/certificates#approveadestinationfingerprint).
TrustFingerprints pulumi.BoolPtrInput
}
func (DestinationState) ElementType() reflect.Type {
return reflect.TypeOf((*destinationState)(nil)).Elem()
}
type destinationArgs struct {
Config DestinationConfig `pulumi:"config"`
// The unique identifier for the Group within the Fivetran system.
GroupId string `pulumi:"groupId"`
// Region of your AWS S3 bucket
Region string `pulumi:"region"`
// Specifies whether the setup tests should be run automatically. The default value is TRUE.
RunSetupTests *bool `pulumi:"runSetupTests"`
// The destination type name within the Fivetran system.
Service string `pulumi:"service"`
// Determines the time zone for the Fivetran sync schedule.
TimeZoneOffset string `pulumi:"timeZoneOffset"`
// Specifies whether we should trust the certificate automatically. The default value is FALSE. If a certificate is not trusted automatically, it has to be approved with [Certificates Management API Approve a destination certificate](https://fivetran.com/docs/rest-api/certificates#approveadestinationcertificate).
TrustCertificates *bool `pulumi:"trustCertificates"`
// Specifies whether we should trust the SSH fingerprint automatically. The default value is FALSE. If a fingerprint is not trusted automatically, it has to be approved with [Certificates Management API Approve a destination fingerprint](https://fivetran.com/docs/rest-api/certificates#approveadestinationfingerprint).
TrustFingerprints *bool `pulumi:"trustFingerprints"`
}
// The set of arguments for constructing a Destination resource.
type DestinationArgs struct {
Config DestinationConfigInput
// The unique identifier for the Group within the Fivetran system.
GroupId pulumi.StringInput
// Region of your AWS S3 bucket
Region pulumi.StringInput
// Specifies whether the setup tests should be run automatically. The default value is TRUE.
RunSetupTests pulumi.BoolPtrInput
// The destination type name within the Fivetran system.
Service pulumi.StringInput
// Determines the time zone for the Fivetran sync schedule.
TimeZoneOffset pulumi.StringInput
// Specifies whether we should trust the certificate automatically. The default value is FALSE. If a certificate is not trusted automatically, it has to be approved with [Certificates Management API Approve a destination certificate](https://fivetran.com/docs/rest-api/certificates#approveadestinationcertificate).
TrustCertificates pulumi.BoolPtrInput
// Specifies whether we should trust the SSH fingerprint automatically. The default value is FALSE. If a fingerprint is not trusted automatically, it has to be approved with [Certificates Management API Approve a destination fingerprint](https://fivetran.com/docs/rest-api/certificates#approveadestinationfingerprint).
TrustFingerprints pulumi.BoolPtrInput
}
func (DestinationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*destinationArgs)(nil)).Elem()
}
type DestinationInput interface {
pulumi.Input
ToDestinationOutput() DestinationOutput
ToDestinationOutputWithContext(ctx context.Context) DestinationOutput
}
func (*Destination) ElementType() reflect.Type {
return reflect.TypeOf((**Destination)(nil)).Elem()
}
func (i *Destination) ToDestinationOutput() DestinationOutput {
return i.ToDestinationOutputWithContext(context.Background())
}
func (i *Destination) ToDestinationOutputWithContext(ctx context.Context) DestinationOutput {
return pulumi.ToOutputWithContext(ctx, i).(DestinationOutput)
}
func (i *Destination) ToOutput(ctx context.Context) pulumix.Output[*Destination] {
return pulumix.Output[*Destination]{
OutputState: i.ToDestinationOutputWithContext(ctx).OutputState,
}
}
// DestinationArrayInput is an input type that accepts DestinationArray and DestinationArrayOutput values.
// You can construct a concrete instance of `DestinationArrayInput` via:
//
// DestinationArray{ DestinationArgs{...} }
type DestinationArrayInput interface {
pulumi.Input
ToDestinationArrayOutput() DestinationArrayOutput
ToDestinationArrayOutputWithContext(context.Context) DestinationArrayOutput
}
type DestinationArray []DestinationInput
func (DestinationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Destination)(nil)).Elem()
}
func (i DestinationArray) ToDestinationArrayOutput() DestinationArrayOutput {
return i.ToDestinationArrayOutputWithContext(context.Background())
}
func (i DestinationArray) ToDestinationArrayOutputWithContext(ctx context.Context) DestinationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DestinationArrayOutput)
}
func (i DestinationArray) ToOutput(ctx context.Context) pulumix.Output[[]*Destination] {
return pulumix.Output[[]*Destination]{
OutputState: i.ToDestinationArrayOutputWithContext(ctx).OutputState,
}
}
// DestinationMapInput is an input type that accepts DestinationMap and DestinationMapOutput values.
// You can construct a concrete instance of `DestinationMapInput` via:
//
// DestinationMap{ "key": DestinationArgs{...} }
type DestinationMapInput interface {
pulumi.Input
ToDestinationMapOutput() DestinationMapOutput
ToDestinationMapOutputWithContext(context.Context) DestinationMapOutput
}
type DestinationMap map[string]DestinationInput
func (DestinationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Destination)(nil)).Elem()
}
func (i DestinationMap) ToDestinationMapOutput() DestinationMapOutput {
return i.ToDestinationMapOutputWithContext(context.Background())
}
func (i DestinationMap) ToDestinationMapOutputWithContext(ctx context.Context) DestinationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DestinationMapOutput)
}
func (i DestinationMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*Destination] {
return pulumix.Output[map[string]*Destination]{
OutputState: i.ToDestinationMapOutputWithContext(ctx).OutputState,
}
}
type DestinationOutput struct{ *pulumi.OutputState }
func (DestinationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Destination)(nil)).Elem()
}
func (o DestinationOutput) ToDestinationOutput() DestinationOutput {
return o
}
func (o DestinationOutput) ToDestinationOutputWithContext(ctx context.Context) DestinationOutput {
return o
}
func (o DestinationOutput) ToOutput(ctx context.Context) pulumix.Output[*Destination] {
return pulumix.Output[*Destination]{
OutputState: o.OutputState,
}
}
func (o DestinationOutput) Config() DestinationConfigOutput {
return o.ApplyT(func(v *Destination) DestinationConfigOutput { return v.Config }).(DestinationConfigOutput)
}
// The unique identifier for the Group within the Fivetran system.
func (o DestinationOutput) GroupId() pulumi.StringOutput {
return o.ApplyT(func(v *Destination) pulumi.StringOutput { return v.GroupId }).(pulumi.StringOutput)
}
func (o DestinationOutput) LastUpdated() pulumi.StringOutput {
return o.ApplyT(func(v *Destination) pulumi.StringOutput { return v.LastUpdated }).(pulumi.StringOutput)
}
// Region of your AWS S3 bucket
func (o DestinationOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v *Destination) pulumi.StringOutput { return v.Region }).(pulumi.StringOutput)
}
// Specifies whether the setup tests should be run automatically. The default value is TRUE.
func (o DestinationOutput) RunSetupTests() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Destination) pulumi.BoolPtrOutput { return v.RunSetupTests }).(pulumi.BoolPtrOutput)
}
// The destination type name within the Fivetran system.
func (o DestinationOutput) Service() pulumi.StringOutput {
return o.ApplyT(func(v *Destination) pulumi.StringOutput { return v.Service }).(pulumi.StringOutput)
}
// Destination setup status
func (o DestinationOutput) SetupStatus() pulumi.StringOutput {
return o.ApplyT(func(v *Destination) pulumi.StringOutput { return v.SetupStatus }).(pulumi.StringOutput)
}
// Determines the time zone for the Fivetran sync schedule.
func (o DestinationOutput) TimeZoneOffset() pulumi.StringOutput {
return o.ApplyT(func(v *Destination) pulumi.StringOutput { return v.TimeZoneOffset }).(pulumi.StringOutput)
}
// Specifies whether we should trust the certificate automatically. The default value is FALSE. If a certificate is not trusted automatically, it has to be approved with [Certificates Management API Approve a destination certificate](https://fivetran.com/docs/rest-api/certificates#approveadestinationcertificate).
func (o DestinationOutput) TrustCertificates() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Destination) pulumi.BoolPtrOutput { return v.TrustCertificates }).(pulumi.BoolPtrOutput)
}
// Specifies whether we should trust the SSH fingerprint automatically. The default value is FALSE. If a fingerprint is not trusted automatically, it has to be approved with [Certificates Management API Approve a destination fingerprint](https://fivetran.com/docs/rest-api/certificates#approveadestinationfingerprint).
func (o DestinationOutput) TrustFingerprints() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Destination) pulumi.BoolPtrOutput { return v.TrustFingerprints }).(pulumi.BoolPtrOutput)
}
type DestinationArrayOutput struct{ *pulumi.OutputState }
func (DestinationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Destination)(nil)).Elem()
}
func (o DestinationArrayOutput) ToDestinationArrayOutput() DestinationArrayOutput {
return o
}
func (o DestinationArrayOutput) ToDestinationArrayOutputWithContext(ctx context.Context) DestinationArrayOutput {
return o
}
func (o DestinationArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*Destination] {
return pulumix.Output[[]*Destination]{
OutputState: o.OutputState,
}
}
func (o DestinationArrayOutput) Index(i pulumi.IntInput) DestinationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Destination {
return vs[0].([]*Destination)[vs[1].(int)]
}).(DestinationOutput)
}
type DestinationMapOutput struct{ *pulumi.OutputState }
func (DestinationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Destination)(nil)).Elem()
}
func (o DestinationMapOutput) ToDestinationMapOutput() DestinationMapOutput {
return o
}
func (o DestinationMapOutput) ToDestinationMapOutputWithContext(ctx context.Context) DestinationMapOutput {
return o
}
func (o DestinationMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*Destination] {
return pulumix.Output[map[string]*Destination]{
OutputState: o.OutputState,
}
}
func (o DestinationMapOutput) MapIndex(k pulumi.StringInput) DestinationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Destination {
return vs[0].(map[string]*Destination)[vs[1].(string)]
}).(DestinationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DestinationInput)(nil)).Elem(), &Destination{})
pulumi.RegisterInputType(reflect.TypeOf((*DestinationArrayInput)(nil)).Elem(), DestinationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DestinationMapInput)(nil)).Elem(), DestinationMap{})
pulumi.RegisterOutputType(DestinationOutput{})
pulumi.RegisterOutputType(DestinationArrayOutput{})
pulumi.RegisterOutputType(DestinationMapOutput{})
}