/
dataSource.go
448 lines (390 loc) · 21.6 KB
/
dataSource.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
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
// 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 quicksight
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Resource for managing QuickSight Data Source
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/quicksight"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := quicksight.NewDataSource(ctx, "default", &quicksight.DataSourceArgs{
// DataSourceId: pulumi.String("example-id"),
// Name: pulumi.String("My Cool Data in S3"),
// Parameters: &quicksight.DataSourceParametersArgs{
// S3: &quicksight.DataSourceParametersS3Args{
// ManifestFileLocation: &quicksight.DataSourceParametersS3ManifestFileLocationArgs{
// Bucket: pulumi.String("my-bucket"),
// Key: pulumi.String("path/to/manifest.json"),
// },
// },
// },
// Type: pulumi.String("S3"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Using `pulumi import`, import a QuickSight data source using the AWS account ID, and data source ID separated by a slash (`/`). For example:
//
// ```sh
// $ pulumi import aws:quicksight/dataSource:DataSource example 123456789123/my-data-source-id
// ```
type DataSource struct {
pulumi.CustomResourceState
// Amazon Resource Name (ARN) of the data source
Arn pulumi.StringOutput `pulumi:"arn"`
// The ID for the AWS account that the data source is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account.
AwsAccountId pulumi.StringOutput `pulumi:"awsAccountId"`
// The credentials Amazon QuickSight uses to connect to your underlying source. Currently, only credentials based on user name and password are supported. See Credentials below for more details.
Credentials DataSourceCredentialsPtrOutput `pulumi:"credentials"`
// An identifier for the data source.
DataSourceId pulumi.StringOutput `pulumi:"dataSourceId"`
// A name for the data source, maximum of 128 characters.
Name pulumi.StringOutput `pulumi:"name"`
// The parameters used to connect to this data source (exactly one).
Parameters DataSourceParametersOutput `pulumi:"parameters"`
// A set of resource permissions on the data source. Maximum of 64 items. See Permission below for more details.
Permissions DataSourcePermissionArrayOutput `pulumi:"permissions"`
// Secure Socket Layer (SSL) properties that apply when Amazon QuickSight connects to your underlying source. See SSL Properties below for more details.
SslProperties DataSourceSslPropertiesPtrOutput `pulumi:"sslProperties"`
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
// The type of the data source. See the [AWS Documentation](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_CreateDataSource.html#QS-CreateDataSource-request-Type) for the complete list of valid values.
//
// The following arguments are optional:
Type pulumi.StringOutput `pulumi:"type"`
// Use this parameter only when you want Amazon QuickSight to use a VPC connection when connecting to your underlying source. See VPC Connection Properties below for more details.
VpcConnectionProperties DataSourceVpcConnectionPropertiesPtrOutput `pulumi:"vpcConnectionProperties"`
}
// NewDataSource registers a new resource with the given unique name, arguments, and options.
func NewDataSource(ctx *pulumi.Context,
name string, args *DataSourceArgs, opts ...pulumi.ResourceOption) (*DataSource, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DataSourceId == nil {
return nil, errors.New("invalid value for required argument 'DataSourceId'")
}
if args.Parameters == nil {
return nil, errors.New("invalid value for required argument 'Parameters'")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource DataSource
err := ctx.RegisterResource("aws:quicksight/dataSource:DataSource", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDataSource gets an existing DataSource 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 GetDataSource(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DataSourceState, opts ...pulumi.ResourceOption) (*DataSource, error) {
var resource DataSource
err := ctx.ReadResource("aws:quicksight/dataSource:DataSource", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DataSource resources.
type dataSourceState struct {
// Amazon Resource Name (ARN) of the data source
Arn *string `pulumi:"arn"`
// The ID for the AWS account that the data source is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account.
AwsAccountId *string `pulumi:"awsAccountId"`
// The credentials Amazon QuickSight uses to connect to your underlying source. Currently, only credentials based on user name and password are supported. See Credentials below for more details.
Credentials *DataSourceCredentials `pulumi:"credentials"`
// An identifier for the data source.
DataSourceId *string `pulumi:"dataSourceId"`
// A name for the data source, maximum of 128 characters.
Name *string `pulumi:"name"`
// The parameters used to connect to this data source (exactly one).
Parameters *DataSourceParameters `pulumi:"parameters"`
// A set of resource permissions on the data source. Maximum of 64 items. See Permission below for more details.
Permissions []DataSourcePermission `pulumi:"permissions"`
// Secure Socket Layer (SSL) properties that apply when Amazon QuickSight connects to your underlying source. See SSL Properties below for more details.
SslProperties *DataSourceSslProperties `pulumi:"sslProperties"`
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll map[string]string `pulumi:"tagsAll"`
// The type of the data source. See the [AWS Documentation](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_CreateDataSource.html#QS-CreateDataSource-request-Type) for the complete list of valid values.
//
// The following arguments are optional:
Type *string `pulumi:"type"`
// Use this parameter only when you want Amazon QuickSight to use a VPC connection when connecting to your underlying source. See VPC Connection Properties below for more details.
VpcConnectionProperties *DataSourceVpcConnectionProperties `pulumi:"vpcConnectionProperties"`
}
type DataSourceState struct {
// Amazon Resource Name (ARN) of the data source
Arn pulumi.StringPtrInput
// The ID for the AWS account that the data source is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account.
AwsAccountId pulumi.StringPtrInput
// The credentials Amazon QuickSight uses to connect to your underlying source. Currently, only credentials based on user name and password are supported. See Credentials below for more details.
Credentials DataSourceCredentialsPtrInput
// An identifier for the data source.
DataSourceId pulumi.StringPtrInput
// A name for the data source, maximum of 128 characters.
Name pulumi.StringPtrInput
// The parameters used to connect to this data source (exactly one).
Parameters DataSourceParametersPtrInput
// A set of resource permissions on the data source. Maximum of 64 items. See Permission below for more details.
Permissions DataSourcePermissionArrayInput
// Secure Socket Layer (SSL) properties that apply when Amazon QuickSight connects to your underlying source. See SSL Properties below for more details.
SslProperties DataSourceSslPropertiesPtrInput
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll pulumi.StringMapInput
// The type of the data source. See the [AWS Documentation](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_CreateDataSource.html#QS-CreateDataSource-request-Type) for the complete list of valid values.
//
// The following arguments are optional:
Type pulumi.StringPtrInput
// Use this parameter only when you want Amazon QuickSight to use a VPC connection when connecting to your underlying source. See VPC Connection Properties below for more details.
VpcConnectionProperties DataSourceVpcConnectionPropertiesPtrInput
}
func (DataSourceState) ElementType() reflect.Type {
return reflect.TypeOf((*dataSourceState)(nil)).Elem()
}
type dataSourceArgs struct {
// The ID for the AWS account that the data source is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account.
AwsAccountId *string `pulumi:"awsAccountId"`
// The credentials Amazon QuickSight uses to connect to your underlying source. Currently, only credentials based on user name and password are supported. See Credentials below for more details.
Credentials *DataSourceCredentials `pulumi:"credentials"`
// An identifier for the data source.
DataSourceId string `pulumi:"dataSourceId"`
// A name for the data source, maximum of 128 characters.
Name *string `pulumi:"name"`
// The parameters used to connect to this data source (exactly one).
Parameters DataSourceParameters `pulumi:"parameters"`
// A set of resource permissions on the data source. Maximum of 64 items. See Permission below for more details.
Permissions []DataSourcePermission `pulumi:"permissions"`
// Secure Socket Layer (SSL) properties that apply when Amazon QuickSight connects to your underlying source. See SSL Properties below for more details.
SslProperties *DataSourceSslProperties `pulumi:"sslProperties"`
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// The type of the data source. See the [AWS Documentation](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_CreateDataSource.html#QS-CreateDataSource-request-Type) for the complete list of valid values.
//
// The following arguments are optional:
Type string `pulumi:"type"`
// Use this parameter only when you want Amazon QuickSight to use a VPC connection when connecting to your underlying source. See VPC Connection Properties below for more details.
VpcConnectionProperties *DataSourceVpcConnectionProperties `pulumi:"vpcConnectionProperties"`
}
// The set of arguments for constructing a DataSource resource.
type DataSourceArgs struct {
// The ID for the AWS account that the data source is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account.
AwsAccountId pulumi.StringPtrInput
// The credentials Amazon QuickSight uses to connect to your underlying source. Currently, only credentials based on user name and password are supported. See Credentials below for more details.
Credentials DataSourceCredentialsPtrInput
// An identifier for the data source.
DataSourceId pulumi.StringInput
// A name for the data source, maximum of 128 characters.
Name pulumi.StringPtrInput
// The parameters used to connect to this data source (exactly one).
Parameters DataSourceParametersInput
// A set of resource permissions on the data source. Maximum of 64 items. See Permission below for more details.
Permissions DataSourcePermissionArrayInput
// Secure Socket Layer (SSL) properties that apply when Amazon QuickSight connects to your underlying source. See SSL Properties below for more details.
SslProperties DataSourceSslPropertiesPtrInput
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// The type of the data source. See the [AWS Documentation](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_CreateDataSource.html#QS-CreateDataSource-request-Type) for the complete list of valid values.
//
// The following arguments are optional:
Type pulumi.StringInput
// Use this parameter only when you want Amazon QuickSight to use a VPC connection when connecting to your underlying source. See VPC Connection Properties below for more details.
VpcConnectionProperties DataSourceVpcConnectionPropertiesPtrInput
}
func (DataSourceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*dataSourceArgs)(nil)).Elem()
}
type DataSourceInput interface {
pulumi.Input
ToDataSourceOutput() DataSourceOutput
ToDataSourceOutputWithContext(ctx context.Context) DataSourceOutput
}
func (*DataSource) ElementType() reflect.Type {
return reflect.TypeOf((**DataSource)(nil)).Elem()
}
func (i *DataSource) ToDataSourceOutput() DataSourceOutput {
return i.ToDataSourceOutputWithContext(context.Background())
}
func (i *DataSource) ToDataSourceOutputWithContext(ctx context.Context) DataSourceOutput {
return pulumi.ToOutputWithContext(ctx, i).(DataSourceOutput)
}
// DataSourceArrayInput is an input type that accepts DataSourceArray and DataSourceArrayOutput values.
// You can construct a concrete instance of `DataSourceArrayInput` via:
//
// DataSourceArray{ DataSourceArgs{...} }
type DataSourceArrayInput interface {
pulumi.Input
ToDataSourceArrayOutput() DataSourceArrayOutput
ToDataSourceArrayOutputWithContext(context.Context) DataSourceArrayOutput
}
type DataSourceArray []DataSourceInput
func (DataSourceArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DataSource)(nil)).Elem()
}
func (i DataSourceArray) ToDataSourceArrayOutput() DataSourceArrayOutput {
return i.ToDataSourceArrayOutputWithContext(context.Background())
}
func (i DataSourceArray) ToDataSourceArrayOutputWithContext(ctx context.Context) DataSourceArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DataSourceArrayOutput)
}
// DataSourceMapInput is an input type that accepts DataSourceMap and DataSourceMapOutput values.
// You can construct a concrete instance of `DataSourceMapInput` via:
//
// DataSourceMap{ "key": DataSourceArgs{...} }
type DataSourceMapInput interface {
pulumi.Input
ToDataSourceMapOutput() DataSourceMapOutput
ToDataSourceMapOutputWithContext(context.Context) DataSourceMapOutput
}
type DataSourceMap map[string]DataSourceInput
func (DataSourceMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DataSource)(nil)).Elem()
}
func (i DataSourceMap) ToDataSourceMapOutput() DataSourceMapOutput {
return i.ToDataSourceMapOutputWithContext(context.Background())
}
func (i DataSourceMap) ToDataSourceMapOutputWithContext(ctx context.Context) DataSourceMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DataSourceMapOutput)
}
type DataSourceOutput struct{ *pulumi.OutputState }
func (DataSourceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DataSource)(nil)).Elem()
}
func (o DataSourceOutput) ToDataSourceOutput() DataSourceOutput {
return o
}
func (o DataSourceOutput) ToDataSourceOutputWithContext(ctx context.Context) DataSourceOutput {
return o
}
// Amazon Resource Name (ARN) of the data source
func (o DataSourceOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *DataSource) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// The ID for the AWS account that the data source is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account.
func (o DataSourceOutput) AwsAccountId() pulumi.StringOutput {
return o.ApplyT(func(v *DataSource) pulumi.StringOutput { return v.AwsAccountId }).(pulumi.StringOutput)
}
// The credentials Amazon QuickSight uses to connect to your underlying source. Currently, only credentials based on user name and password are supported. See Credentials below for more details.
func (o DataSourceOutput) Credentials() DataSourceCredentialsPtrOutput {
return o.ApplyT(func(v *DataSource) DataSourceCredentialsPtrOutput { return v.Credentials }).(DataSourceCredentialsPtrOutput)
}
// An identifier for the data source.
func (o DataSourceOutput) DataSourceId() pulumi.StringOutput {
return o.ApplyT(func(v *DataSource) pulumi.StringOutput { return v.DataSourceId }).(pulumi.StringOutput)
}
// A name for the data source, maximum of 128 characters.
func (o DataSourceOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *DataSource) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The parameters used to connect to this data source (exactly one).
func (o DataSourceOutput) Parameters() DataSourceParametersOutput {
return o.ApplyT(func(v *DataSource) DataSourceParametersOutput { return v.Parameters }).(DataSourceParametersOutput)
}
// A set of resource permissions on the data source. Maximum of 64 items. See Permission below for more details.
func (o DataSourceOutput) Permissions() DataSourcePermissionArrayOutput {
return o.ApplyT(func(v *DataSource) DataSourcePermissionArrayOutput { return v.Permissions }).(DataSourcePermissionArrayOutput)
}
// Secure Socket Layer (SSL) properties that apply when Amazon QuickSight connects to your underlying source. See SSL Properties below for more details.
func (o DataSourceOutput) SslProperties() DataSourceSslPropertiesPtrOutput {
return o.ApplyT(func(v *DataSource) DataSourceSslPropertiesPtrOutput { return v.SslProperties }).(DataSourceSslPropertiesPtrOutput)
}
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
func (o DataSourceOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *DataSource) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
func (o DataSourceOutput) TagsAll() pulumi.StringMapOutput {
return o.ApplyT(func(v *DataSource) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
}
// The type of the data source. See the [AWS Documentation](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_CreateDataSource.html#QS-CreateDataSource-request-Type) for the complete list of valid values.
//
// The following arguments are optional:
func (o DataSourceOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *DataSource) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
// Use this parameter only when you want Amazon QuickSight to use a VPC connection when connecting to your underlying source. See VPC Connection Properties below for more details.
func (o DataSourceOutput) VpcConnectionProperties() DataSourceVpcConnectionPropertiesPtrOutput {
return o.ApplyT(func(v *DataSource) DataSourceVpcConnectionPropertiesPtrOutput { return v.VpcConnectionProperties }).(DataSourceVpcConnectionPropertiesPtrOutput)
}
type DataSourceArrayOutput struct{ *pulumi.OutputState }
func (DataSourceArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DataSource)(nil)).Elem()
}
func (o DataSourceArrayOutput) ToDataSourceArrayOutput() DataSourceArrayOutput {
return o
}
func (o DataSourceArrayOutput) ToDataSourceArrayOutputWithContext(ctx context.Context) DataSourceArrayOutput {
return o
}
func (o DataSourceArrayOutput) Index(i pulumi.IntInput) DataSourceOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DataSource {
return vs[0].([]*DataSource)[vs[1].(int)]
}).(DataSourceOutput)
}
type DataSourceMapOutput struct{ *pulumi.OutputState }
func (DataSourceMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DataSource)(nil)).Elem()
}
func (o DataSourceMapOutput) ToDataSourceMapOutput() DataSourceMapOutput {
return o
}
func (o DataSourceMapOutput) ToDataSourceMapOutputWithContext(ctx context.Context) DataSourceMapOutput {
return o
}
func (o DataSourceMapOutput) MapIndex(k pulumi.StringInput) DataSourceOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DataSource {
return vs[0].(map[string]*DataSource)[vs[1].(string)]
}).(DataSourceOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DataSourceInput)(nil)).Elem(), &DataSource{})
pulumi.RegisterInputType(reflect.TypeOf((*DataSourceArrayInput)(nil)).Elem(), DataSourceArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DataSourceMapInput)(nil)).Elem(), DataSourceMap{})
pulumi.RegisterOutputType(DataSourceOutput{})
pulumi.RegisterOutputType(DataSourceArrayOutput{})
pulumi.RegisterOutputType(DataSourceMapOutput{})
}