generated from pulumi/pulumi-tf-provider-boilerplate
/
cloudIntegrationEc2.go
382 lines (328 loc) · 15.5 KB
/
cloudIntegrationEc2.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
// 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 wavefront
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Wavefront Cloud Integration for EC2. This allows EC2 cloud integrations to be created,
// updated, and deleted.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-wavefront/sdk/go/wavefront"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// extId, err := wavefront.NewCloudIntegrationAwsExternalId(ctx, "extId", nil)
// if err != nil {
// return err
// }
// _, err = wavefront.NewCloudIntegrationEc2(ctx, "ec2", &wavefront.CloudIntegrationEc2Args{
// RoleArn: pulumi.String("arn:aws::1234567:role/example-arn"),
// ExternalId: extId.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// EC2 Cloud Integrations can be imported by using the `id`, e.g.
//
// ```sh
//
// $ pulumi import wavefront:index/cloudIntegrationEc2:CloudIntegrationEc2 ec2 a411c16b-3cf7-4f03-bf11-8ca05aab898d
//
// ```
type CloudIntegrationEc2 struct {
pulumi.CustomResourceState
// A list of point tag key-values to add to every point ingested using this integration.
AdditionalTags pulumi.StringMapOutput `pulumi:"additionalTags"`
// The Role ARN that the customer has created in AWS IAM to allow access to Wavefront.
ExternalId pulumi.StringOutput `pulumi:"externalId"`
// Forces this resource to save, even if errors are present.
ForceSave pulumi.BoolPtrOutput `pulumi:"forceSave"`
// A list of AWS instance tags to use as the `source` name
// in a series. Default is `["hostname", "host", "name"]`. If no tag in the list is found, the series source
// is set to the instance id.
HostnameTags pulumi.StringArrayOutput `pulumi:"hostnameTags"`
// The human-readable name of this integration.
Name pulumi.StringOutput `pulumi:"name"`
// The external ID corresponding to the Role ARN.
RoleArn pulumi.StringOutput `pulumi:"roleArn"`
// A value denoting which cloud service this service integrates with.
Service pulumi.StringOutput `pulumi:"service"`
// How often, in minutes, to refresh the service.
ServiceRefreshRateInMinutes pulumi.IntPtrOutput `pulumi:"serviceRefreshRateInMinutes"`
}
// NewCloudIntegrationEc2 registers a new resource with the given unique name, arguments, and options.
func NewCloudIntegrationEc2(ctx *pulumi.Context,
name string, args *CloudIntegrationEc2Args, opts ...pulumi.ResourceOption) (*CloudIntegrationEc2, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ExternalId == nil {
return nil, errors.New("invalid value for required argument 'ExternalId'")
}
if args.RoleArn == nil {
return nil, errors.New("invalid value for required argument 'RoleArn'")
}
if args.Service == nil {
return nil, errors.New("invalid value for required argument 'Service'")
}
var resource CloudIntegrationEc2
err := ctx.RegisterResource("wavefront:index/cloudIntegrationEc2:CloudIntegrationEc2", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCloudIntegrationEc2 gets an existing CloudIntegrationEc2 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 GetCloudIntegrationEc2(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CloudIntegrationEc2State, opts ...pulumi.ResourceOption) (*CloudIntegrationEc2, error) {
var resource CloudIntegrationEc2
err := ctx.ReadResource("wavefront:index/cloudIntegrationEc2:CloudIntegrationEc2", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering CloudIntegrationEc2 resources.
type cloudIntegrationEc2State struct {
// A list of point tag key-values to add to every point ingested using this integration.
AdditionalTags map[string]string `pulumi:"additionalTags"`
// The Role ARN that the customer has created in AWS IAM to allow access to Wavefront.
ExternalId *string `pulumi:"externalId"`
// Forces this resource to save, even if errors are present.
ForceSave *bool `pulumi:"forceSave"`
// A list of AWS instance tags to use as the `source` name
// in a series. Default is `["hostname", "host", "name"]`. If no tag in the list is found, the series source
// is set to the instance id.
HostnameTags []string `pulumi:"hostnameTags"`
// The human-readable name of this integration.
Name *string `pulumi:"name"`
// The external ID corresponding to the Role ARN.
RoleArn *string `pulumi:"roleArn"`
// A value denoting which cloud service this service integrates with.
Service *string `pulumi:"service"`
// How often, in minutes, to refresh the service.
ServiceRefreshRateInMinutes *int `pulumi:"serviceRefreshRateInMinutes"`
}
type CloudIntegrationEc2State struct {
// A list of point tag key-values to add to every point ingested using this integration.
AdditionalTags pulumi.StringMapInput
// The Role ARN that the customer has created in AWS IAM to allow access to Wavefront.
ExternalId pulumi.StringPtrInput
// Forces this resource to save, even if errors are present.
ForceSave pulumi.BoolPtrInput
// A list of AWS instance tags to use as the `source` name
// in a series. Default is `["hostname", "host", "name"]`. If no tag in the list is found, the series source
// is set to the instance id.
HostnameTags pulumi.StringArrayInput
// The human-readable name of this integration.
Name pulumi.StringPtrInput
// The external ID corresponding to the Role ARN.
RoleArn pulumi.StringPtrInput
// A value denoting which cloud service this service integrates with.
Service pulumi.StringPtrInput
// How often, in minutes, to refresh the service.
ServiceRefreshRateInMinutes pulumi.IntPtrInput
}
func (CloudIntegrationEc2State) ElementType() reflect.Type {
return reflect.TypeOf((*cloudIntegrationEc2State)(nil)).Elem()
}
type cloudIntegrationEc2Args struct {
// A list of point tag key-values to add to every point ingested using this integration.
AdditionalTags map[string]string `pulumi:"additionalTags"`
// The Role ARN that the customer has created in AWS IAM to allow access to Wavefront.
ExternalId string `pulumi:"externalId"`
// Forces this resource to save, even if errors are present.
ForceSave *bool `pulumi:"forceSave"`
// A list of AWS instance tags to use as the `source` name
// in a series. Default is `["hostname", "host", "name"]`. If no tag in the list is found, the series source
// is set to the instance id.
HostnameTags []string `pulumi:"hostnameTags"`
// The human-readable name of this integration.
Name *string `pulumi:"name"`
// The external ID corresponding to the Role ARN.
RoleArn string `pulumi:"roleArn"`
// A value denoting which cloud service this service integrates with.
Service string `pulumi:"service"`
// How often, in minutes, to refresh the service.
ServiceRefreshRateInMinutes *int `pulumi:"serviceRefreshRateInMinutes"`
}
// The set of arguments for constructing a CloudIntegrationEc2 resource.
type CloudIntegrationEc2Args struct {
// A list of point tag key-values to add to every point ingested using this integration.
AdditionalTags pulumi.StringMapInput
// The Role ARN that the customer has created in AWS IAM to allow access to Wavefront.
ExternalId pulumi.StringInput
// Forces this resource to save, even if errors are present.
ForceSave pulumi.BoolPtrInput
// A list of AWS instance tags to use as the `source` name
// in a series. Default is `["hostname", "host", "name"]`. If no tag in the list is found, the series source
// is set to the instance id.
HostnameTags pulumi.StringArrayInput
// The human-readable name of this integration.
Name pulumi.StringPtrInput
// The external ID corresponding to the Role ARN.
RoleArn pulumi.StringInput
// A value denoting which cloud service this service integrates with.
Service pulumi.StringInput
// How often, in minutes, to refresh the service.
ServiceRefreshRateInMinutes pulumi.IntPtrInput
}
func (CloudIntegrationEc2Args) ElementType() reflect.Type {
return reflect.TypeOf((*cloudIntegrationEc2Args)(nil)).Elem()
}
type CloudIntegrationEc2Input interface {
pulumi.Input
ToCloudIntegrationEc2Output() CloudIntegrationEc2Output
ToCloudIntegrationEc2OutputWithContext(ctx context.Context) CloudIntegrationEc2Output
}
func (*CloudIntegrationEc2) ElementType() reflect.Type {
return reflect.TypeOf((**CloudIntegrationEc2)(nil)).Elem()
}
func (i *CloudIntegrationEc2) ToCloudIntegrationEc2Output() CloudIntegrationEc2Output {
return i.ToCloudIntegrationEc2OutputWithContext(context.Background())
}
func (i *CloudIntegrationEc2) ToCloudIntegrationEc2OutputWithContext(ctx context.Context) CloudIntegrationEc2Output {
return pulumi.ToOutputWithContext(ctx, i).(CloudIntegrationEc2Output)
}
// CloudIntegrationEc2ArrayInput is an input type that accepts CloudIntegrationEc2Array and CloudIntegrationEc2ArrayOutput values.
// You can construct a concrete instance of `CloudIntegrationEc2ArrayInput` via:
//
// CloudIntegrationEc2Array{ CloudIntegrationEc2Args{...} }
type CloudIntegrationEc2ArrayInput interface {
pulumi.Input
ToCloudIntegrationEc2ArrayOutput() CloudIntegrationEc2ArrayOutput
ToCloudIntegrationEc2ArrayOutputWithContext(context.Context) CloudIntegrationEc2ArrayOutput
}
type CloudIntegrationEc2Array []CloudIntegrationEc2Input
func (CloudIntegrationEc2Array) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CloudIntegrationEc2)(nil)).Elem()
}
func (i CloudIntegrationEc2Array) ToCloudIntegrationEc2ArrayOutput() CloudIntegrationEc2ArrayOutput {
return i.ToCloudIntegrationEc2ArrayOutputWithContext(context.Background())
}
func (i CloudIntegrationEc2Array) ToCloudIntegrationEc2ArrayOutputWithContext(ctx context.Context) CloudIntegrationEc2ArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(CloudIntegrationEc2ArrayOutput)
}
// CloudIntegrationEc2MapInput is an input type that accepts CloudIntegrationEc2Map and CloudIntegrationEc2MapOutput values.
// You can construct a concrete instance of `CloudIntegrationEc2MapInput` via:
//
// CloudIntegrationEc2Map{ "key": CloudIntegrationEc2Args{...} }
type CloudIntegrationEc2MapInput interface {
pulumi.Input
ToCloudIntegrationEc2MapOutput() CloudIntegrationEc2MapOutput
ToCloudIntegrationEc2MapOutputWithContext(context.Context) CloudIntegrationEc2MapOutput
}
type CloudIntegrationEc2Map map[string]CloudIntegrationEc2Input
func (CloudIntegrationEc2Map) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CloudIntegrationEc2)(nil)).Elem()
}
func (i CloudIntegrationEc2Map) ToCloudIntegrationEc2MapOutput() CloudIntegrationEc2MapOutput {
return i.ToCloudIntegrationEc2MapOutputWithContext(context.Background())
}
func (i CloudIntegrationEc2Map) ToCloudIntegrationEc2MapOutputWithContext(ctx context.Context) CloudIntegrationEc2MapOutput {
return pulumi.ToOutputWithContext(ctx, i).(CloudIntegrationEc2MapOutput)
}
type CloudIntegrationEc2Output struct{ *pulumi.OutputState }
func (CloudIntegrationEc2Output) ElementType() reflect.Type {
return reflect.TypeOf((**CloudIntegrationEc2)(nil)).Elem()
}
func (o CloudIntegrationEc2Output) ToCloudIntegrationEc2Output() CloudIntegrationEc2Output {
return o
}
func (o CloudIntegrationEc2Output) ToCloudIntegrationEc2OutputWithContext(ctx context.Context) CloudIntegrationEc2Output {
return o
}
// A list of point tag key-values to add to every point ingested using this integration.
func (o CloudIntegrationEc2Output) AdditionalTags() pulumi.StringMapOutput {
return o.ApplyT(func(v *CloudIntegrationEc2) pulumi.StringMapOutput { return v.AdditionalTags }).(pulumi.StringMapOutput)
}
// The Role ARN that the customer has created in AWS IAM to allow access to Wavefront.
func (o CloudIntegrationEc2Output) ExternalId() pulumi.StringOutput {
return o.ApplyT(func(v *CloudIntegrationEc2) pulumi.StringOutput { return v.ExternalId }).(pulumi.StringOutput)
}
// Forces this resource to save, even if errors are present.
func (o CloudIntegrationEc2Output) ForceSave() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *CloudIntegrationEc2) pulumi.BoolPtrOutput { return v.ForceSave }).(pulumi.BoolPtrOutput)
}
// A list of AWS instance tags to use as the `source` name
// in a series. Default is `["hostname", "host", "name"]`. If no tag in the list is found, the series source
// is set to the instance id.
func (o CloudIntegrationEc2Output) HostnameTags() pulumi.StringArrayOutput {
return o.ApplyT(func(v *CloudIntegrationEc2) pulumi.StringArrayOutput { return v.HostnameTags }).(pulumi.StringArrayOutput)
}
// The human-readable name of this integration.
func (o CloudIntegrationEc2Output) Name() pulumi.StringOutput {
return o.ApplyT(func(v *CloudIntegrationEc2) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The external ID corresponding to the Role ARN.
func (o CloudIntegrationEc2Output) RoleArn() pulumi.StringOutput {
return o.ApplyT(func(v *CloudIntegrationEc2) pulumi.StringOutput { return v.RoleArn }).(pulumi.StringOutput)
}
// A value denoting which cloud service this service integrates with.
func (o CloudIntegrationEc2Output) Service() pulumi.StringOutput {
return o.ApplyT(func(v *CloudIntegrationEc2) pulumi.StringOutput { return v.Service }).(pulumi.StringOutput)
}
// How often, in minutes, to refresh the service.
func (o CloudIntegrationEc2Output) ServiceRefreshRateInMinutes() pulumi.IntPtrOutput {
return o.ApplyT(func(v *CloudIntegrationEc2) pulumi.IntPtrOutput { return v.ServiceRefreshRateInMinutes }).(pulumi.IntPtrOutput)
}
type CloudIntegrationEc2ArrayOutput struct{ *pulumi.OutputState }
func (CloudIntegrationEc2ArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CloudIntegrationEc2)(nil)).Elem()
}
func (o CloudIntegrationEc2ArrayOutput) ToCloudIntegrationEc2ArrayOutput() CloudIntegrationEc2ArrayOutput {
return o
}
func (o CloudIntegrationEc2ArrayOutput) ToCloudIntegrationEc2ArrayOutputWithContext(ctx context.Context) CloudIntegrationEc2ArrayOutput {
return o
}
func (o CloudIntegrationEc2ArrayOutput) Index(i pulumi.IntInput) CloudIntegrationEc2Output {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CloudIntegrationEc2 {
return vs[0].([]*CloudIntegrationEc2)[vs[1].(int)]
}).(CloudIntegrationEc2Output)
}
type CloudIntegrationEc2MapOutput struct{ *pulumi.OutputState }
func (CloudIntegrationEc2MapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CloudIntegrationEc2)(nil)).Elem()
}
func (o CloudIntegrationEc2MapOutput) ToCloudIntegrationEc2MapOutput() CloudIntegrationEc2MapOutput {
return o
}
func (o CloudIntegrationEc2MapOutput) ToCloudIntegrationEc2MapOutputWithContext(ctx context.Context) CloudIntegrationEc2MapOutput {
return o
}
func (o CloudIntegrationEc2MapOutput) MapIndex(k pulumi.StringInput) CloudIntegrationEc2Output {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CloudIntegrationEc2 {
return vs[0].(map[string]*CloudIntegrationEc2)[vs[1].(string)]
}).(CloudIntegrationEc2Output)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CloudIntegrationEc2Input)(nil)).Elem(), &CloudIntegrationEc2{})
pulumi.RegisterInputType(reflect.TypeOf((*CloudIntegrationEc2ArrayInput)(nil)).Elem(), CloudIntegrationEc2Array{})
pulumi.RegisterInputType(reflect.TypeOf((*CloudIntegrationEc2MapInput)(nil)).Elem(), CloudIntegrationEc2Map{})
pulumi.RegisterOutputType(CloudIntegrationEc2Output{})
pulumi.RegisterOutputType(CloudIntegrationEc2ArrayOutput{})
pulumi.RegisterOutputType(CloudIntegrationEc2MapOutput{})
}