/
internetMonitor.go
379 lines (324 loc) · 18 KB
/
internetMonitor.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
// 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 cloudwatch
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Internet Monitor Monitor resource.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/cloudwatch"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := cloudwatch.NewInternetMonitor(ctx, "example", &cloudwatch.InternetMonitorArgs{
// MonitorName: pulumi.String("exmple"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Internet Monitor Monitors can be imported using the `monitor_name`, e.g.,
//
// ```sh
//
// $ pulumi import aws:cloudwatch/internetMonitor:InternetMonitor some some-monitor
//
// ```
type InternetMonitor struct {
pulumi.CustomResourceState
// ARN of the Monitor.
Arn pulumi.StringOutput `pulumi:"arn"`
// Publish internet measurements for Internet Monitor to an Amazon S3 bucket in addition to CloudWatch Logs.
InternetMeasurementsLogDelivery InternetMonitorInternetMeasurementsLogDeliveryPtrOutput `pulumi:"internetMeasurementsLogDelivery"`
// The maximum number of city-networks to monitor for your resources. A city-network is the location (city) where clients access your application resources from and the network or ASN, such as an internet service provider (ISP), that clients access the resources through. This limit helps control billing costs.
MaxCityNetworksToMonitor pulumi.IntPtrOutput `pulumi:"maxCityNetworksToMonitor"`
// The name of the monitor.
//
// The following arguments are optional:
MonitorName pulumi.StringOutput `pulumi:"monitorName"`
// The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs).
Resources pulumi.StringArrayOutput `pulumi:"resources"`
// The status for a monitor. The accepted values for Status with the UpdateMonitor API call are the following: `ACTIVE` and `INACTIVE`.
Status pulumi.StringPtrOutput `pulumi:"status"`
// Map of tags to assign to the resource. 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"`
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
// The percentage of the internet-facing traffic for your application that you want to monitor with this monitor.
TrafficPercentageToMonitor pulumi.IntPtrOutput `pulumi:"trafficPercentageToMonitor"`
}
// NewInternetMonitor registers a new resource with the given unique name, arguments, and options.
func NewInternetMonitor(ctx *pulumi.Context,
name string, args *InternetMonitorArgs, opts ...pulumi.ResourceOption) (*InternetMonitor, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.MonitorName == nil {
return nil, errors.New("invalid value for required argument 'MonitorName'")
}
var resource InternetMonitor
err := ctx.RegisterResource("aws:cloudwatch/internetMonitor:InternetMonitor", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetInternetMonitor gets an existing InternetMonitor 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 GetInternetMonitor(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *InternetMonitorState, opts ...pulumi.ResourceOption) (*InternetMonitor, error) {
var resource InternetMonitor
err := ctx.ReadResource("aws:cloudwatch/internetMonitor:InternetMonitor", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering InternetMonitor resources.
type internetMonitorState struct {
// ARN of the Monitor.
Arn *string `pulumi:"arn"`
// Publish internet measurements for Internet Monitor to an Amazon S3 bucket in addition to CloudWatch Logs.
InternetMeasurementsLogDelivery *InternetMonitorInternetMeasurementsLogDelivery `pulumi:"internetMeasurementsLogDelivery"`
// The maximum number of city-networks to monitor for your resources. A city-network is the location (city) where clients access your application resources from and the network or ASN, such as an internet service provider (ISP), that clients access the resources through. This limit helps control billing costs.
MaxCityNetworksToMonitor *int `pulumi:"maxCityNetworksToMonitor"`
// The name of the monitor.
//
// The following arguments are optional:
MonitorName *string `pulumi:"monitorName"`
// The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs).
Resources []string `pulumi:"resources"`
// The status for a monitor. The accepted values for Status with the UpdateMonitor API call are the following: `ACTIVE` and `INACTIVE`.
Status *string `pulumi:"status"`
// Map of tags to assign to the resource. 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"`
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll map[string]string `pulumi:"tagsAll"`
// The percentage of the internet-facing traffic for your application that you want to monitor with this monitor.
TrafficPercentageToMonitor *int `pulumi:"trafficPercentageToMonitor"`
}
type InternetMonitorState struct {
// ARN of the Monitor.
Arn pulumi.StringPtrInput
// Publish internet measurements for Internet Monitor to an Amazon S3 bucket in addition to CloudWatch Logs.
InternetMeasurementsLogDelivery InternetMonitorInternetMeasurementsLogDeliveryPtrInput
// The maximum number of city-networks to monitor for your resources. A city-network is the location (city) where clients access your application resources from and the network or ASN, such as an internet service provider (ISP), that clients access the resources through. This limit helps control billing costs.
MaxCityNetworksToMonitor pulumi.IntPtrInput
// The name of the monitor.
//
// The following arguments are optional:
MonitorName pulumi.StringPtrInput
// The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs).
Resources pulumi.StringArrayInput
// The status for a monitor. The accepted values for Status with the UpdateMonitor API call are the following: `ACTIVE` and `INACTIVE`.
Status pulumi.StringPtrInput
// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll pulumi.StringMapInput
// The percentage of the internet-facing traffic for your application that you want to monitor with this monitor.
TrafficPercentageToMonitor pulumi.IntPtrInput
}
func (InternetMonitorState) ElementType() reflect.Type {
return reflect.TypeOf((*internetMonitorState)(nil)).Elem()
}
type internetMonitorArgs struct {
// Publish internet measurements for Internet Monitor to an Amazon S3 bucket in addition to CloudWatch Logs.
InternetMeasurementsLogDelivery *InternetMonitorInternetMeasurementsLogDelivery `pulumi:"internetMeasurementsLogDelivery"`
// The maximum number of city-networks to monitor for your resources. A city-network is the location (city) where clients access your application resources from and the network or ASN, such as an internet service provider (ISP), that clients access the resources through. This limit helps control billing costs.
MaxCityNetworksToMonitor *int `pulumi:"maxCityNetworksToMonitor"`
// The name of the monitor.
//
// The following arguments are optional:
MonitorName string `pulumi:"monitorName"`
// The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs).
Resources []string `pulumi:"resources"`
// The status for a monitor. The accepted values for Status with the UpdateMonitor API call are the following: `ACTIVE` and `INACTIVE`.
Status *string `pulumi:"status"`
// Map of tags to assign to the resource. 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 percentage of the internet-facing traffic for your application that you want to monitor with this monitor.
TrafficPercentageToMonitor *int `pulumi:"trafficPercentageToMonitor"`
}
// The set of arguments for constructing a InternetMonitor resource.
type InternetMonitorArgs struct {
// Publish internet measurements for Internet Monitor to an Amazon S3 bucket in addition to CloudWatch Logs.
InternetMeasurementsLogDelivery InternetMonitorInternetMeasurementsLogDeliveryPtrInput
// The maximum number of city-networks to monitor for your resources. A city-network is the location (city) where clients access your application resources from and the network or ASN, such as an internet service provider (ISP), that clients access the resources through. This limit helps control billing costs.
MaxCityNetworksToMonitor pulumi.IntPtrInput
// The name of the monitor.
//
// The following arguments are optional:
MonitorName pulumi.StringInput
// The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs).
Resources pulumi.StringArrayInput
// The status for a monitor. The accepted values for Status with the UpdateMonitor API call are the following: `ACTIVE` and `INACTIVE`.
Status pulumi.StringPtrInput
// Map of tags to assign to the resource. 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 percentage of the internet-facing traffic for your application that you want to monitor with this monitor.
TrafficPercentageToMonitor pulumi.IntPtrInput
}
func (InternetMonitorArgs) ElementType() reflect.Type {
return reflect.TypeOf((*internetMonitorArgs)(nil)).Elem()
}
type InternetMonitorInput interface {
pulumi.Input
ToInternetMonitorOutput() InternetMonitorOutput
ToInternetMonitorOutputWithContext(ctx context.Context) InternetMonitorOutput
}
func (*InternetMonitor) ElementType() reflect.Type {
return reflect.TypeOf((**InternetMonitor)(nil)).Elem()
}
func (i *InternetMonitor) ToInternetMonitorOutput() InternetMonitorOutput {
return i.ToInternetMonitorOutputWithContext(context.Background())
}
func (i *InternetMonitor) ToInternetMonitorOutputWithContext(ctx context.Context) InternetMonitorOutput {
return pulumi.ToOutputWithContext(ctx, i).(InternetMonitorOutput)
}
// InternetMonitorArrayInput is an input type that accepts InternetMonitorArray and InternetMonitorArrayOutput values.
// You can construct a concrete instance of `InternetMonitorArrayInput` via:
//
// InternetMonitorArray{ InternetMonitorArgs{...} }
type InternetMonitorArrayInput interface {
pulumi.Input
ToInternetMonitorArrayOutput() InternetMonitorArrayOutput
ToInternetMonitorArrayOutputWithContext(context.Context) InternetMonitorArrayOutput
}
type InternetMonitorArray []InternetMonitorInput
func (InternetMonitorArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*InternetMonitor)(nil)).Elem()
}
func (i InternetMonitorArray) ToInternetMonitorArrayOutput() InternetMonitorArrayOutput {
return i.ToInternetMonitorArrayOutputWithContext(context.Background())
}
func (i InternetMonitorArray) ToInternetMonitorArrayOutputWithContext(ctx context.Context) InternetMonitorArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(InternetMonitorArrayOutput)
}
// InternetMonitorMapInput is an input type that accepts InternetMonitorMap and InternetMonitorMapOutput values.
// You can construct a concrete instance of `InternetMonitorMapInput` via:
//
// InternetMonitorMap{ "key": InternetMonitorArgs{...} }
type InternetMonitorMapInput interface {
pulumi.Input
ToInternetMonitorMapOutput() InternetMonitorMapOutput
ToInternetMonitorMapOutputWithContext(context.Context) InternetMonitorMapOutput
}
type InternetMonitorMap map[string]InternetMonitorInput
func (InternetMonitorMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*InternetMonitor)(nil)).Elem()
}
func (i InternetMonitorMap) ToInternetMonitorMapOutput() InternetMonitorMapOutput {
return i.ToInternetMonitorMapOutputWithContext(context.Background())
}
func (i InternetMonitorMap) ToInternetMonitorMapOutputWithContext(ctx context.Context) InternetMonitorMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(InternetMonitorMapOutput)
}
type InternetMonitorOutput struct{ *pulumi.OutputState }
func (InternetMonitorOutput) ElementType() reflect.Type {
return reflect.TypeOf((**InternetMonitor)(nil)).Elem()
}
func (o InternetMonitorOutput) ToInternetMonitorOutput() InternetMonitorOutput {
return o
}
func (o InternetMonitorOutput) ToInternetMonitorOutputWithContext(ctx context.Context) InternetMonitorOutput {
return o
}
// ARN of the Monitor.
func (o InternetMonitorOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *InternetMonitor) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// Publish internet measurements for Internet Monitor to an Amazon S3 bucket in addition to CloudWatch Logs.
func (o InternetMonitorOutput) InternetMeasurementsLogDelivery() InternetMonitorInternetMeasurementsLogDeliveryPtrOutput {
return o.ApplyT(func(v *InternetMonitor) InternetMonitorInternetMeasurementsLogDeliveryPtrOutput {
return v.InternetMeasurementsLogDelivery
}).(InternetMonitorInternetMeasurementsLogDeliveryPtrOutput)
}
// The maximum number of city-networks to monitor for your resources. A city-network is the location (city) where clients access your application resources from and the network or ASN, such as an internet service provider (ISP), that clients access the resources through. This limit helps control billing costs.
func (o InternetMonitorOutput) MaxCityNetworksToMonitor() pulumi.IntPtrOutput {
return o.ApplyT(func(v *InternetMonitor) pulumi.IntPtrOutput { return v.MaxCityNetworksToMonitor }).(pulumi.IntPtrOutput)
}
// The name of the monitor.
//
// The following arguments are optional:
func (o InternetMonitorOutput) MonitorName() pulumi.StringOutput {
return o.ApplyT(func(v *InternetMonitor) pulumi.StringOutput { return v.MonitorName }).(pulumi.StringOutput)
}
// The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs).
func (o InternetMonitorOutput) Resources() pulumi.StringArrayOutput {
return o.ApplyT(func(v *InternetMonitor) pulumi.StringArrayOutput { return v.Resources }).(pulumi.StringArrayOutput)
}
// The status for a monitor. The accepted values for Status with the UpdateMonitor API call are the following: `ACTIVE` and `INACTIVE`.
func (o InternetMonitorOutput) Status() pulumi.StringPtrOutput {
return o.ApplyT(func(v *InternetMonitor) pulumi.StringPtrOutput { return v.Status }).(pulumi.StringPtrOutput)
}
// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
func (o InternetMonitorOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *InternetMonitor) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
func (o InternetMonitorOutput) TagsAll() pulumi.StringMapOutput {
return o.ApplyT(func(v *InternetMonitor) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
}
// The percentage of the internet-facing traffic for your application that you want to monitor with this monitor.
func (o InternetMonitorOutput) TrafficPercentageToMonitor() pulumi.IntPtrOutput {
return o.ApplyT(func(v *InternetMonitor) pulumi.IntPtrOutput { return v.TrafficPercentageToMonitor }).(pulumi.IntPtrOutput)
}
type InternetMonitorArrayOutput struct{ *pulumi.OutputState }
func (InternetMonitorArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*InternetMonitor)(nil)).Elem()
}
func (o InternetMonitorArrayOutput) ToInternetMonitorArrayOutput() InternetMonitorArrayOutput {
return o
}
func (o InternetMonitorArrayOutput) ToInternetMonitorArrayOutputWithContext(ctx context.Context) InternetMonitorArrayOutput {
return o
}
func (o InternetMonitorArrayOutput) Index(i pulumi.IntInput) InternetMonitorOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *InternetMonitor {
return vs[0].([]*InternetMonitor)[vs[1].(int)]
}).(InternetMonitorOutput)
}
type InternetMonitorMapOutput struct{ *pulumi.OutputState }
func (InternetMonitorMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*InternetMonitor)(nil)).Elem()
}
func (o InternetMonitorMapOutput) ToInternetMonitorMapOutput() InternetMonitorMapOutput {
return o
}
func (o InternetMonitorMapOutput) ToInternetMonitorMapOutputWithContext(ctx context.Context) InternetMonitorMapOutput {
return o
}
func (o InternetMonitorMapOutput) MapIndex(k pulumi.StringInput) InternetMonitorOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *InternetMonitor {
return vs[0].(map[string]*InternetMonitor)[vs[1].(string)]
}).(InternetMonitorOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*InternetMonitorInput)(nil)).Elem(), &InternetMonitor{})
pulumi.RegisterInputType(reflect.TypeOf((*InternetMonitorArrayInput)(nil)).Elem(), InternetMonitorArray{})
pulumi.RegisterInputType(reflect.TypeOf((*InternetMonitorMapInput)(nil)).Elem(), InternetMonitorMap{})
pulumi.RegisterOutputType(InternetMonitorOutput{})
pulumi.RegisterOutputType(InternetMonitorArrayOutput{})
pulumi.RegisterOutputType(InternetMonitorMapOutput{})
}