github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cloudwatch/internetMonitor.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package cloudwatch 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Provides a Internet Monitor Monitor resource. 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudwatch" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // _, err := cloudwatch.NewInternetMonitor(ctx, "example", &cloudwatch.InternetMonitorArgs{ 33 // MonitorName: pulumi.String("exmple"), 34 // }) 35 // if err != nil { 36 // return err 37 // } 38 // return nil 39 // }) 40 // } 41 // 42 // ``` 43 // <!--End PulumiCodeChooser --> 44 // 45 // ## Import 46 // 47 // Using `pulumi import`, import Internet Monitor Monitors using the `monitor_name`. For example: 48 // 49 // ```sh 50 // $ pulumi import aws:cloudwatch/internetMonitor:InternetMonitor some some-monitor 51 // ``` 52 type InternetMonitor struct { 53 pulumi.CustomResourceState 54 55 // ARN of the Monitor. 56 Arn pulumi.StringOutput `pulumi:"arn"` 57 // Health event thresholds. A health event threshold percentage, for performance and availability, determines when Internet Monitor creates a health event when there's an internet issue that affects your application end users. See Health Events Config below. 58 HealthEventsConfig InternetMonitorHealthEventsConfigPtrOutput `pulumi:"healthEventsConfig"` 59 // Publish internet measurements for Internet Monitor to an Amazon S3 bucket in addition to CloudWatch Logs. 60 InternetMeasurementsLogDelivery InternetMonitorInternetMeasurementsLogDeliveryPtrOutput `pulumi:"internetMeasurementsLogDelivery"` 61 // 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. 62 MaxCityNetworksToMonitor pulumi.IntPtrOutput `pulumi:"maxCityNetworksToMonitor"` 63 // The name of the monitor. 64 // 65 // The following arguments are optional: 66 MonitorName pulumi.StringOutput `pulumi:"monitorName"` 67 // The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs). 68 Resources pulumi.StringArrayOutput `pulumi:"resources"` 69 // The status for a monitor. The accepted values for Status with the UpdateMonitor API call are the following: `ACTIVE` and `INACTIVE`. 70 Status pulumi.StringPtrOutput `pulumi:"status"` 71 // 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. 72 Tags pulumi.StringMapOutput `pulumi:"tags"` 73 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 74 // 75 // Deprecated: Please use `tags` instead. 76 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 77 // The percentage of the internet-facing traffic for your application that you want to monitor with this monitor. 78 TrafficPercentageToMonitor pulumi.IntPtrOutput `pulumi:"trafficPercentageToMonitor"` 79 } 80 81 // NewInternetMonitor registers a new resource with the given unique name, arguments, and options. 82 func NewInternetMonitor(ctx *pulumi.Context, 83 name string, args *InternetMonitorArgs, opts ...pulumi.ResourceOption) (*InternetMonitor, error) { 84 if args == nil { 85 return nil, errors.New("missing one or more required arguments") 86 } 87 88 if args.MonitorName == nil { 89 return nil, errors.New("invalid value for required argument 'MonitorName'") 90 } 91 opts = internal.PkgResourceDefaultOpts(opts) 92 var resource InternetMonitor 93 err := ctx.RegisterResource("aws:cloudwatch/internetMonitor:InternetMonitor", name, args, &resource, opts...) 94 if err != nil { 95 return nil, err 96 } 97 return &resource, nil 98 } 99 100 // GetInternetMonitor gets an existing InternetMonitor resource's state with the given name, ID, and optional 101 // state properties that are used to uniquely qualify the lookup (nil if not required). 102 func GetInternetMonitor(ctx *pulumi.Context, 103 name string, id pulumi.IDInput, state *InternetMonitorState, opts ...pulumi.ResourceOption) (*InternetMonitor, error) { 104 var resource InternetMonitor 105 err := ctx.ReadResource("aws:cloudwatch/internetMonitor:InternetMonitor", name, id, state, &resource, opts...) 106 if err != nil { 107 return nil, err 108 } 109 return &resource, nil 110 } 111 112 // Input properties used for looking up and filtering InternetMonitor resources. 113 type internetMonitorState struct { 114 // ARN of the Monitor. 115 Arn *string `pulumi:"arn"` 116 // Health event thresholds. A health event threshold percentage, for performance and availability, determines when Internet Monitor creates a health event when there's an internet issue that affects your application end users. See Health Events Config below. 117 HealthEventsConfig *InternetMonitorHealthEventsConfig `pulumi:"healthEventsConfig"` 118 // Publish internet measurements for Internet Monitor to an Amazon S3 bucket in addition to CloudWatch Logs. 119 InternetMeasurementsLogDelivery *InternetMonitorInternetMeasurementsLogDelivery `pulumi:"internetMeasurementsLogDelivery"` 120 // 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. 121 MaxCityNetworksToMonitor *int `pulumi:"maxCityNetworksToMonitor"` 122 // The name of the monitor. 123 // 124 // The following arguments are optional: 125 MonitorName *string `pulumi:"monitorName"` 126 // The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs). 127 Resources []string `pulumi:"resources"` 128 // The status for a monitor. The accepted values for Status with the UpdateMonitor API call are the following: `ACTIVE` and `INACTIVE`. 129 Status *string `pulumi:"status"` 130 // 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. 131 Tags map[string]string `pulumi:"tags"` 132 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 133 // 134 // Deprecated: Please use `tags` instead. 135 TagsAll map[string]string `pulumi:"tagsAll"` 136 // The percentage of the internet-facing traffic for your application that you want to monitor with this monitor. 137 TrafficPercentageToMonitor *int `pulumi:"trafficPercentageToMonitor"` 138 } 139 140 type InternetMonitorState struct { 141 // ARN of the Monitor. 142 Arn pulumi.StringPtrInput 143 // Health event thresholds. A health event threshold percentage, for performance and availability, determines when Internet Monitor creates a health event when there's an internet issue that affects your application end users. See Health Events Config below. 144 HealthEventsConfig InternetMonitorHealthEventsConfigPtrInput 145 // Publish internet measurements for Internet Monitor to an Amazon S3 bucket in addition to CloudWatch Logs. 146 InternetMeasurementsLogDelivery InternetMonitorInternetMeasurementsLogDeliveryPtrInput 147 // 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. 148 MaxCityNetworksToMonitor pulumi.IntPtrInput 149 // The name of the monitor. 150 // 151 // The following arguments are optional: 152 MonitorName pulumi.StringPtrInput 153 // The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs). 154 Resources pulumi.StringArrayInput 155 // The status for a monitor. The accepted values for Status with the UpdateMonitor API call are the following: `ACTIVE` and `INACTIVE`. 156 Status pulumi.StringPtrInput 157 // 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. 158 Tags pulumi.StringMapInput 159 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 160 // 161 // Deprecated: Please use `tags` instead. 162 TagsAll pulumi.StringMapInput 163 // The percentage of the internet-facing traffic for your application that you want to monitor with this monitor. 164 TrafficPercentageToMonitor pulumi.IntPtrInput 165 } 166 167 func (InternetMonitorState) ElementType() reflect.Type { 168 return reflect.TypeOf((*internetMonitorState)(nil)).Elem() 169 } 170 171 type internetMonitorArgs struct { 172 // Health event thresholds. A health event threshold percentage, for performance and availability, determines when Internet Monitor creates a health event when there's an internet issue that affects your application end users. See Health Events Config below. 173 HealthEventsConfig *InternetMonitorHealthEventsConfig `pulumi:"healthEventsConfig"` 174 // Publish internet measurements for Internet Monitor to an Amazon S3 bucket in addition to CloudWatch Logs. 175 InternetMeasurementsLogDelivery *InternetMonitorInternetMeasurementsLogDelivery `pulumi:"internetMeasurementsLogDelivery"` 176 // 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. 177 MaxCityNetworksToMonitor *int `pulumi:"maxCityNetworksToMonitor"` 178 // The name of the monitor. 179 // 180 // The following arguments are optional: 181 MonitorName string `pulumi:"monitorName"` 182 // The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs). 183 Resources []string `pulumi:"resources"` 184 // The status for a monitor. The accepted values for Status with the UpdateMonitor API call are the following: `ACTIVE` and `INACTIVE`. 185 Status *string `pulumi:"status"` 186 // 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. 187 Tags map[string]string `pulumi:"tags"` 188 // The percentage of the internet-facing traffic for your application that you want to monitor with this monitor. 189 TrafficPercentageToMonitor *int `pulumi:"trafficPercentageToMonitor"` 190 } 191 192 // The set of arguments for constructing a InternetMonitor resource. 193 type InternetMonitorArgs struct { 194 // Health event thresholds. A health event threshold percentage, for performance and availability, determines when Internet Monitor creates a health event when there's an internet issue that affects your application end users. See Health Events Config below. 195 HealthEventsConfig InternetMonitorHealthEventsConfigPtrInput 196 // Publish internet measurements for Internet Monitor to an Amazon S3 bucket in addition to CloudWatch Logs. 197 InternetMeasurementsLogDelivery InternetMonitorInternetMeasurementsLogDeliveryPtrInput 198 // 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. 199 MaxCityNetworksToMonitor pulumi.IntPtrInput 200 // The name of the monitor. 201 // 202 // The following arguments are optional: 203 MonitorName pulumi.StringInput 204 // The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs). 205 Resources pulumi.StringArrayInput 206 // The status for a monitor. The accepted values for Status with the UpdateMonitor API call are the following: `ACTIVE` and `INACTIVE`. 207 Status pulumi.StringPtrInput 208 // 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. 209 Tags pulumi.StringMapInput 210 // The percentage of the internet-facing traffic for your application that you want to monitor with this monitor. 211 TrafficPercentageToMonitor pulumi.IntPtrInput 212 } 213 214 func (InternetMonitorArgs) ElementType() reflect.Type { 215 return reflect.TypeOf((*internetMonitorArgs)(nil)).Elem() 216 } 217 218 type InternetMonitorInput interface { 219 pulumi.Input 220 221 ToInternetMonitorOutput() InternetMonitorOutput 222 ToInternetMonitorOutputWithContext(ctx context.Context) InternetMonitorOutput 223 } 224 225 func (*InternetMonitor) ElementType() reflect.Type { 226 return reflect.TypeOf((**InternetMonitor)(nil)).Elem() 227 } 228 229 func (i *InternetMonitor) ToInternetMonitorOutput() InternetMonitorOutput { 230 return i.ToInternetMonitorOutputWithContext(context.Background()) 231 } 232 233 func (i *InternetMonitor) ToInternetMonitorOutputWithContext(ctx context.Context) InternetMonitorOutput { 234 return pulumi.ToOutputWithContext(ctx, i).(InternetMonitorOutput) 235 } 236 237 // InternetMonitorArrayInput is an input type that accepts InternetMonitorArray and InternetMonitorArrayOutput values. 238 // You can construct a concrete instance of `InternetMonitorArrayInput` via: 239 // 240 // InternetMonitorArray{ InternetMonitorArgs{...} } 241 type InternetMonitorArrayInput interface { 242 pulumi.Input 243 244 ToInternetMonitorArrayOutput() InternetMonitorArrayOutput 245 ToInternetMonitorArrayOutputWithContext(context.Context) InternetMonitorArrayOutput 246 } 247 248 type InternetMonitorArray []InternetMonitorInput 249 250 func (InternetMonitorArray) ElementType() reflect.Type { 251 return reflect.TypeOf((*[]*InternetMonitor)(nil)).Elem() 252 } 253 254 func (i InternetMonitorArray) ToInternetMonitorArrayOutput() InternetMonitorArrayOutput { 255 return i.ToInternetMonitorArrayOutputWithContext(context.Background()) 256 } 257 258 func (i InternetMonitorArray) ToInternetMonitorArrayOutputWithContext(ctx context.Context) InternetMonitorArrayOutput { 259 return pulumi.ToOutputWithContext(ctx, i).(InternetMonitorArrayOutput) 260 } 261 262 // InternetMonitorMapInput is an input type that accepts InternetMonitorMap and InternetMonitorMapOutput values. 263 // You can construct a concrete instance of `InternetMonitorMapInput` via: 264 // 265 // InternetMonitorMap{ "key": InternetMonitorArgs{...} } 266 type InternetMonitorMapInput interface { 267 pulumi.Input 268 269 ToInternetMonitorMapOutput() InternetMonitorMapOutput 270 ToInternetMonitorMapOutputWithContext(context.Context) InternetMonitorMapOutput 271 } 272 273 type InternetMonitorMap map[string]InternetMonitorInput 274 275 func (InternetMonitorMap) ElementType() reflect.Type { 276 return reflect.TypeOf((*map[string]*InternetMonitor)(nil)).Elem() 277 } 278 279 func (i InternetMonitorMap) ToInternetMonitorMapOutput() InternetMonitorMapOutput { 280 return i.ToInternetMonitorMapOutputWithContext(context.Background()) 281 } 282 283 func (i InternetMonitorMap) ToInternetMonitorMapOutputWithContext(ctx context.Context) InternetMonitorMapOutput { 284 return pulumi.ToOutputWithContext(ctx, i).(InternetMonitorMapOutput) 285 } 286 287 type InternetMonitorOutput struct{ *pulumi.OutputState } 288 289 func (InternetMonitorOutput) ElementType() reflect.Type { 290 return reflect.TypeOf((**InternetMonitor)(nil)).Elem() 291 } 292 293 func (o InternetMonitorOutput) ToInternetMonitorOutput() InternetMonitorOutput { 294 return o 295 } 296 297 func (o InternetMonitorOutput) ToInternetMonitorOutputWithContext(ctx context.Context) InternetMonitorOutput { 298 return o 299 } 300 301 // ARN of the Monitor. 302 func (o InternetMonitorOutput) Arn() pulumi.StringOutput { 303 return o.ApplyT(func(v *InternetMonitor) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 304 } 305 306 // Health event thresholds. A health event threshold percentage, for performance and availability, determines when Internet Monitor creates a health event when there's an internet issue that affects your application end users. See Health Events Config below. 307 func (o InternetMonitorOutput) HealthEventsConfig() InternetMonitorHealthEventsConfigPtrOutput { 308 return o.ApplyT(func(v *InternetMonitor) InternetMonitorHealthEventsConfigPtrOutput { return v.HealthEventsConfig }).(InternetMonitorHealthEventsConfigPtrOutput) 309 } 310 311 // Publish internet measurements for Internet Monitor to an Amazon S3 bucket in addition to CloudWatch Logs. 312 func (o InternetMonitorOutput) InternetMeasurementsLogDelivery() InternetMonitorInternetMeasurementsLogDeliveryPtrOutput { 313 return o.ApplyT(func(v *InternetMonitor) InternetMonitorInternetMeasurementsLogDeliveryPtrOutput { 314 return v.InternetMeasurementsLogDelivery 315 }).(InternetMonitorInternetMeasurementsLogDeliveryPtrOutput) 316 } 317 318 // 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. 319 func (o InternetMonitorOutput) MaxCityNetworksToMonitor() pulumi.IntPtrOutput { 320 return o.ApplyT(func(v *InternetMonitor) pulumi.IntPtrOutput { return v.MaxCityNetworksToMonitor }).(pulumi.IntPtrOutput) 321 } 322 323 // The name of the monitor. 324 // 325 // The following arguments are optional: 326 func (o InternetMonitorOutput) MonitorName() pulumi.StringOutput { 327 return o.ApplyT(func(v *InternetMonitor) pulumi.StringOutput { return v.MonitorName }).(pulumi.StringOutput) 328 } 329 330 // The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs). 331 func (o InternetMonitorOutput) Resources() pulumi.StringArrayOutput { 332 return o.ApplyT(func(v *InternetMonitor) pulumi.StringArrayOutput { return v.Resources }).(pulumi.StringArrayOutput) 333 } 334 335 // The status for a monitor. The accepted values for Status with the UpdateMonitor API call are the following: `ACTIVE` and `INACTIVE`. 336 func (o InternetMonitorOutput) Status() pulumi.StringPtrOutput { 337 return o.ApplyT(func(v *InternetMonitor) pulumi.StringPtrOutput { return v.Status }).(pulumi.StringPtrOutput) 338 } 339 340 // 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. 341 func (o InternetMonitorOutput) Tags() pulumi.StringMapOutput { 342 return o.ApplyT(func(v *InternetMonitor) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 343 } 344 345 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 346 // 347 // Deprecated: Please use `tags` instead. 348 func (o InternetMonitorOutput) TagsAll() pulumi.StringMapOutput { 349 return o.ApplyT(func(v *InternetMonitor) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 350 } 351 352 // The percentage of the internet-facing traffic for your application that you want to monitor with this monitor. 353 func (o InternetMonitorOutput) TrafficPercentageToMonitor() pulumi.IntPtrOutput { 354 return o.ApplyT(func(v *InternetMonitor) pulumi.IntPtrOutput { return v.TrafficPercentageToMonitor }).(pulumi.IntPtrOutput) 355 } 356 357 type InternetMonitorArrayOutput struct{ *pulumi.OutputState } 358 359 func (InternetMonitorArrayOutput) ElementType() reflect.Type { 360 return reflect.TypeOf((*[]*InternetMonitor)(nil)).Elem() 361 } 362 363 func (o InternetMonitorArrayOutput) ToInternetMonitorArrayOutput() InternetMonitorArrayOutput { 364 return o 365 } 366 367 func (o InternetMonitorArrayOutput) ToInternetMonitorArrayOutputWithContext(ctx context.Context) InternetMonitorArrayOutput { 368 return o 369 } 370 371 func (o InternetMonitorArrayOutput) Index(i pulumi.IntInput) InternetMonitorOutput { 372 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *InternetMonitor { 373 return vs[0].([]*InternetMonitor)[vs[1].(int)] 374 }).(InternetMonitorOutput) 375 } 376 377 type InternetMonitorMapOutput struct{ *pulumi.OutputState } 378 379 func (InternetMonitorMapOutput) ElementType() reflect.Type { 380 return reflect.TypeOf((*map[string]*InternetMonitor)(nil)).Elem() 381 } 382 383 func (o InternetMonitorMapOutput) ToInternetMonitorMapOutput() InternetMonitorMapOutput { 384 return o 385 } 386 387 func (o InternetMonitorMapOutput) ToInternetMonitorMapOutputWithContext(ctx context.Context) InternetMonitorMapOutput { 388 return o 389 } 390 391 func (o InternetMonitorMapOutput) MapIndex(k pulumi.StringInput) InternetMonitorOutput { 392 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *InternetMonitor { 393 return vs[0].(map[string]*InternetMonitor)[vs[1].(string)] 394 }).(InternetMonitorOutput) 395 } 396 397 func init() { 398 pulumi.RegisterInputType(reflect.TypeOf((*InternetMonitorInput)(nil)).Elem(), &InternetMonitor{}) 399 pulumi.RegisterInputType(reflect.TypeOf((*InternetMonitorArrayInput)(nil)).Elem(), InternetMonitorArray{}) 400 pulumi.RegisterInputType(reflect.TypeOf((*InternetMonitorMapInput)(nil)).Elem(), InternetMonitorMap{}) 401 pulumi.RegisterOutputType(InternetMonitorOutput{}) 402 pulumi.RegisterOutputType(InternetMonitorArrayOutput{}) 403 pulumi.RegisterOutputType(InternetMonitorMapOutput{}) 404 }