github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/rum/appMonitor.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 rum 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 CloudWatch RUM App 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/rum" 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 := rum.NewAppMonitor(ctx, "example", &rum.AppMonitorArgs{ 33 // Name: pulumi.String("example"), 34 // Domain: pulumi.String("localhost"), 35 // }) 36 // if err != nil { 37 // return err 38 // } 39 // return nil 40 // }) 41 // } 42 // 43 // ``` 44 // <!--End PulumiCodeChooser --> 45 // 46 // ## Import 47 // 48 // Using `pulumi import`, import Cloudwatch RUM App Monitor using the `name`. For example: 49 // 50 // ```sh 51 // $ pulumi import aws:rum/appMonitor:AppMonitor example example 52 // ``` 53 type AppMonitor struct { 54 pulumi.CustomResourceState 55 56 // configuration data for the app monitor. See appMonitorConfiguration below. 57 AppMonitorConfiguration AppMonitorAppMonitorConfigurationOutput `pulumi:"appMonitorConfiguration"` 58 // The unique ID of the app monitor. Useful for JS templates. 59 AppMonitorId pulumi.StringOutput `pulumi:"appMonitorId"` 60 // The Amazon Resource Name (ARN) specifying the app monitor. 61 Arn pulumi.StringOutput `pulumi:"arn"` 62 // Specifies whether this app monitor allows the web client to define and send custom events. If you omit this parameter, custom events are `DISABLED`. See customEvents below. 63 CustomEvents AppMonitorCustomEventsOutput `pulumi:"customEvents"` 64 // Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges. Default value is `false`. 65 CwLogEnabled pulumi.BoolPtrOutput `pulumi:"cwLogEnabled"` 66 // The name of the log group where the copies are stored. 67 CwLogGroup pulumi.StringOutput `pulumi:"cwLogGroup"` 68 // The top-level internet domain name for which your application has administrative authority. 69 Domain pulumi.StringOutput `pulumi:"domain"` 70 // The name of the log stream. 71 Name pulumi.StringOutput `pulumi:"name"` 72 // A 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. 73 Tags pulumi.StringMapOutput `pulumi:"tags"` 74 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 75 // 76 // Deprecated: Please use `tags` instead. 77 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 78 } 79 80 // NewAppMonitor registers a new resource with the given unique name, arguments, and options. 81 func NewAppMonitor(ctx *pulumi.Context, 82 name string, args *AppMonitorArgs, opts ...pulumi.ResourceOption) (*AppMonitor, error) { 83 if args == nil { 84 return nil, errors.New("missing one or more required arguments") 85 } 86 87 if args.Domain == nil { 88 return nil, errors.New("invalid value for required argument 'Domain'") 89 } 90 opts = internal.PkgResourceDefaultOpts(opts) 91 var resource AppMonitor 92 err := ctx.RegisterResource("aws:rum/appMonitor:AppMonitor", name, args, &resource, opts...) 93 if err != nil { 94 return nil, err 95 } 96 return &resource, nil 97 } 98 99 // GetAppMonitor gets an existing AppMonitor resource's state with the given name, ID, and optional 100 // state properties that are used to uniquely qualify the lookup (nil if not required). 101 func GetAppMonitor(ctx *pulumi.Context, 102 name string, id pulumi.IDInput, state *AppMonitorState, opts ...pulumi.ResourceOption) (*AppMonitor, error) { 103 var resource AppMonitor 104 err := ctx.ReadResource("aws:rum/appMonitor:AppMonitor", name, id, state, &resource, opts...) 105 if err != nil { 106 return nil, err 107 } 108 return &resource, nil 109 } 110 111 // Input properties used for looking up and filtering AppMonitor resources. 112 type appMonitorState struct { 113 // configuration data for the app monitor. See appMonitorConfiguration below. 114 AppMonitorConfiguration *AppMonitorAppMonitorConfiguration `pulumi:"appMonitorConfiguration"` 115 // The unique ID of the app monitor. Useful for JS templates. 116 AppMonitorId *string `pulumi:"appMonitorId"` 117 // The Amazon Resource Name (ARN) specifying the app monitor. 118 Arn *string `pulumi:"arn"` 119 // Specifies whether this app monitor allows the web client to define and send custom events. If you omit this parameter, custom events are `DISABLED`. See customEvents below. 120 CustomEvents *AppMonitorCustomEvents `pulumi:"customEvents"` 121 // Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges. Default value is `false`. 122 CwLogEnabled *bool `pulumi:"cwLogEnabled"` 123 // The name of the log group where the copies are stored. 124 CwLogGroup *string `pulumi:"cwLogGroup"` 125 // The top-level internet domain name for which your application has administrative authority. 126 Domain *string `pulumi:"domain"` 127 // The name of the log stream. 128 Name *string `pulumi:"name"` 129 // A 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. 130 Tags map[string]string `pulumi:"tags"` 131 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 132 // 133 // Deprecated: Please use `tags` instead. 134 TagsAll map[string]string `pulumi:"tagsAll"` 135 } 136 137 type AppMonitorState struct { 138 // configuration data for the app monitor. See appMonitorConfiguration below. 139 AppMonitorConfiguration AppMonitorAppMonitorConfigurationPtrInput 140 // The unique ID of the app monitor. Useful for JS templates. 141 AppMonitorId pulumi.StringPtrInput 142 // The Amazon Resource Name (ARN) specifying the app monitor. 143 Arn pulumi.StringPtrInput 144 // Specifies whether this app monitor allows the web client to define and send custom events. If you omit this parameter, custom events are `DISABLED`. See customEvents below. 145 CustomEvents AppMonitorCustomEventsPtrInput 146 // Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges. Default value is `false`. 147 CwLogEnabled pulumi.BoolPtrInput 148 // The name of the log group where the copies are stored. 149 CwLogGroup pulumi.StringPtrInput 150 // The top-level internet domain name for which your application has administrative authority. 151 Domain pulumi.StringPtrInput 152 // The name of the log stream. 153 Name pulumi.StringPtrInput 154 // A 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. 155 Tags pulumi.StringMapInput 156 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 157 // 158 // Deprecated: Please use `tags` instead. 159 TagsAll pulumi.StringMapInput 160 } 161 162 func (AppMonitorState) ElementType() reflect.Type { 163 return reflect.TypeOf((*appMonitorState)(nil)).Elem() 164 } 165 166 type appMonitorArgs struct { 167 // configuration data for the app monitor. See appMonitorConfiguration below. 168 AppMonitorConfiguration *AppMonitorAppMonitorConfiguration `pulumi:"appMonitorConfiguration"` 169 // Specifies whether this app monitor allows the web client to define and send custom events. If you omit this parameter, custom events are `DISABLED`. See customEvents below. 170 CustomEvents *AppMonitorCustomEvents `pulumi:"customEvents"` 171 // Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges. Default value is `false`. 172 CwLogEnabled *bool `pulumi:"cwLogEnabled"` 173 // The top-level internet domain name for which your application has administrative authority. 174 Domain string `pulumi:"domain"` 175 // The name of the log stream. 176 Name *string `pulumi:"name"` 177 // A 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. 178 Tags map[string]string `pulumi:"tags"` 179 } 180 181 // The set of arguments for constructing a AppMonitor resource. 182 type AppMonitorArgs struct { 183 // configuration data for the app monitor. See appMonitorConfiguration below. 184 AppMonitorConfiguration AppMonitorAppMonitorConfigurationPtrInput 185 // Specifies whether this app monitor allows the web client to define and send custom events. If you omit this parameter, custom events are `DISABLED`. See customEvents below. 186 CustomEvents AppMonitorCustomEventsPtrInput 187 // Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges. Default value is `false`. 188 CwLogEnabled pulumi.BoolPtrInput 189 // The top-level internet domain name for which your application has administrative authority. 190 Domain pulumi.StringInput 191 // The name of the log stream. 192 Name pulumi.StringPtrInput 193 // A 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. 194 Tags pulumi.StringMapInput 195 } 196 197 func (AppMonitorArgs) ElementType() reflect.Type { 198 return reflect.TypeOf((*appMonitorArgs)(nil)).Elem() 199 } 200 201 type AppMonitorInput interface { 202 pulumi.Input 203 204 ToAppMonitorOutput() AppMonitorOutput 205 ToAppMonitorOutputWithContext(ctx context.Context) AppMonitorOutput 206 } 207 208 func (*AppMonitor) ElementType() reflect.Type { 209 return reflect.TypeOf((**AppMonitor)(nil)).Elem() 210 } 211 212 func (i *AppMonitor) ToAppMonitorOutput() AppMonitorOutput { 213 return i.ToAppMonitorOutputWithContext(context.Background()) 214 } 215 216 func (i *AppMonitor) ToAppMonitorOutputWithContext(ctx context.Context) AppMonitorOutput { 217 return pulumi.ToOutputWithContext(ctx, i).(AppMonitorOutput) 218 } 219 220 // AppMonitorArrayInput is an input type that accepts AppMonitorArray and AppMonitorArrayOutput values. 221 // You can construct a concrete instance of `AppMonitorArrayInput` via: 222 // 223 // AppMonitorArray{ AppMonitorArgs{...} } 224 type AppMonitorArrayInput interface { 225 pulumi.Input 226 227 ToAppMonitorArrayOutput() AppMonitorArrayOutput 228 ToAppMonitorArrayOutputWithContext(context.Context) AppMonitorArrayOutput 229 } 230 231 type AppMonitorArray []AppMonitorInput 232 233 func (AppMonitorArray) ElementType() reflect.Type { 234 return reflect.TypeOf((*[]*AppMonitor)(nil)).Elem() 235 } 236 237 func (i AppMonitorArray) ToAppMonitorArrayOutput() AppMonitorArrayOutput { 238 return i.ToAppMonitorArrayOutputWithContext(context.Background()) 239 } 240 241 func (i AppMonitorArray) ToAppMonitorArrayOutputWithContext(ctx context.Context) AppMonitorArrayOutput { 242 return pulumi.ToOutputWithContext(ctx, i).(AppMonitorArrayOutput) 243 } 244 245 // AppMonitorMapInput is an input type that accepts AppMonitorMap and AppMonitorMapOutput values. 246 // You can construct a concrete instance of `AppMonitorMapInput` via: 247 // 248 // AppMonitorMap{ "key": AppMonitorArgs{...} } 249 type AppMonitorMapInput interface { 250 pulumi.Input 251 252 ToAppMonitorMapOutput() AppMonitorMapOutput 253 ToAppMonitorMapOutputWithContext(context.Context) AppMonitorMapOutput 254 } 255 256 type AppMonitorMap map[string]AppMonitorInput 257 258 func (AppMonitorMap) ElementType() reflect.Type { 259 return reflect.TypeOf((*map[string]*AppMonitor)(nil)).Elem() 260 } 261 262 func (i AppMonitorMap) ToAppMonitorMapOutput() AppMonitorMapOutput { 263 return i.ToAppMonitorMapOutputWithContext(context.Background()) 264 } 265 266 func (i AppMonitorMap) ToAppMonitorMapOutputWithContext(ctx context.Context) AppMonitorMapOutput { 267 return pulumi.ToOutputWithContext(ctx, i).(AppMonitorMapOutput) 268 } 269 270 type AppMonitorOutput struct{ *pulumi.OutputState } 271 272 func (AppMonitorOutput) ElementType() reflect.Type { 273 return reflect.TypeOf((**AppMonitor)(nil)).Elem() 274 } 275 276 func (o AppMonitorOutput) ToAppMonitorOutput() AppMonitorOutput { 277 return o 278 } 279 280 func (o AppMonitorOutput) ToAppMonitorOutputWithContext(ctx context.Context) AppMonitorOutput { 281 return o 282 } 283 284 // configuration data for the app monitor. See appMonitorConfiguration below. 285 func (o AppMonitorOutput) AppMonitorConfiguration() AppMonitorAppMonitorConfigurationOutput { 286 return o.ApplyT(func(v *AppMonitor) AppMonitorAppMonitorConfigurationOutput { return v.AppMonitorConfiguration }).(AppMonitorAppMonitorConfigurationOutput) 287 } 288 289 // The unique ID of the app monitor. Useful for JS templates. 290 func (o AppMonitorOutput) AppMonitorId() pulumi.StringOutput { 291 return o.ApplyT(func(v *AppMonitor) pulumi.StringOutput { return v.AppMonitorId }).(pulumi.StringOutput) 292 } 293 294 // The Amazon Resource Name (ARN) specifying the app monitor. 295 func (o AppMonitorOutput) Arn() pulumi.StringOutput { 296 return o.ApplyT(func(v *AppMonitor) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 297 } 298 299 // Specifies whether this app monitor allows the web client to define and send custom events. If you omit this parameter, custom events are `DISABLED`. See customEvents below. 300 func (o AppMonitorOutput) CustomEvents() AppMonitorCustomEventsOutput { 301 return o.ApplyT(func(v *AppMonitor) AppMonitorCustomEventsOutput { return v.CustomEvents }).(AppMonitorCustomEventsOutput) 302 } 303 304 // Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges. Default value is `false`. 305 func (o AppMonitorOutput) CwLogEnabled() pulumi.BoolPtrOutput { 306 return o.ApplyT(func(v *AppMonitor) pulumi.BoolPtrOutput { return v.CwLogEnabled }).(pulumi.BoolPtrOutput) 307 } 308 309 // The name of the log group where the copies are stored. 310 func (o AppMonitorOutput) CwLogGroup() pulumi.StringOutput { 311 return o.ApplyT(func(v *AppMonitor) pulumi.StringOutput { return v.CwLogGroup }).(pulumi.StringOutput) 312 } 313 314 // The top-level internet domain name for which your application has administrative authority. 315 func (o AppMonitorOutput) Domain() pulumi.StringOutput { 316 return o.ApplyT(func(v *AppMonitor) pulumi.StringOutput { return v.Domain }).(pulumi.StringOutput) 317 } 318 319 // The name of the log stream. 320 func (o AppMonitorOutput) Name() pulumi.StringOutput { 321 return o.ApplyT(func(v *AppMonitor) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 322 } 323 324 // A 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. 325 func (o AppMonitorOutput) Tags() pulumi.StringMapOutput { 326 return o.ApplyT(func(v *AppMonitor) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 327 } 328 329 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 330 // 331 // Deprecated: Please use `tags` instead. 332 func (o AppMonitorOutput) TagsAll() pulumi.StringMapOutput { 333 return o.ApplyT(func(v *AppMonitor) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 334 } 335 336 type AppMonitorArrayOutput struct{ *pulumi.OutputState } 337 338 func (AppMonitorArrayOutput) ElementType() reflect.Type { 339 return reflect.TypeOf((*[]*AppMonitor)(nil)).Elem() 340 } 341 342 func (o AppMonitorArrayOutput) ToAppMonitorArrayOutput() AppMonitorArrayOutput { 343 return o 344 } 345 346 func (o AppMonitorArrayOutput) ToAppMonitorArrayOutputWithContext(ctx context.Context) AppMonitorArrayOutput { 347 return o 348 } 349 350 func (o AppMonitorArrayOutput) Index(i pulumi.IntInput) AppMonitorOutput { 351 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AppMonitor { 352 return vs[0].([]*AppMonitor)[vs[1].(int)] 353 }).(AppMonitorOutput) 354 } 355 356 type AppMonitorMapOutput struct{ *pulumi.OutputState } 357 358 func (AppMonitorMapOutput) ElementType() reflect.Type { 359 return reflect.TypeOf((*map[string]*AppMonitor)(nil)).Elem() 360 } 361 362 func (o AppMonitorMapOutput) ToAppMonitorMapOutput() AppMonitorMapOutput { 363 return o 364 } 365 366 func (o AppMonitorMapOutput) ToAppMonitorMapOutputWithContext(ctx context.Context) AppMonitorMapOutput { 367 return o 368 } 369 370 func (o AppMonitorMapOutput) MapIndex(k pulumi.StringInput) AppMonitorOutput { 371 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AppMonitor { 372 return vs[0].(map[string]*AppMonitor)[vs[1].(string)] 373 }).(AppMonitorOutput) 374 } 375 376 func init() { 377 pulumi.RegisterInputType(reflect.TypeOf((*AppMonitorInput)(nil)).Elem(), &AppMonitor{}) 378 pulumi.RegisterInputType(reflect.TypeOf((*AppMonitorArrayInput)(nil)).Elem(), AppMonitorArray{}) 379 pulumi.RegisterInputType(reflect.TypeOf((*AppMonitorMapInput)(nil)).Elem(), AppMonitorMap{}) 380 pulumi.RegisterOutputType(AppMonitorOutput{}) 381 pulumi.RegisterOutputType(AppMonitorArrayOutput{}) 382 pulumi.RegisterOutputType(AppMonitorMapOutput{}) 383 }