github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/costexplorer/anomalySubscription.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 costexplorer 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 CE Anomaly Subscription. 16 // 17 // ## Example Usage 18 // 19 // ### Basic Example 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/costexplorer" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // test, err := costexplorer.NewAnomalyMonitor(ctx, "test", &costexplorer.AnomalyMonitorArgs{ 35 // Name: pulumi.String("AWSServiceMonitor"), 36 // MonitorType: pulumi.String("DIMENSIONAL"), 37 // MonitorDimension: pulumi.String("SERVICE"), 38 // }) 39 // if err != nil { 40 // return err 41 // } 42 // _, err = costexplorer.NewAnomalySubscription(ctx, "test", &costexplorer.AnomalySubscriptionArgs{ 43 // Name: pulumi.String("DAILYSUBSCRIPTION"), 44 // Frequency: pulumi.String("DAILY"), 45 // MonitorArnLists: pulumi.StringArray{ 46 // test.Arn, 47 // }, 48 // Subscribers: costexplorer.AnomalySubscriptionSubscriberArray{ 49 // &costexplorer.AnomalySubscriptionSubscriberArgs{ 50 // Type: pulumi.String("EMAIL"), 51 // Address: pulumi.String("abc@example.com"), 52 // }, 53 // }, 54 // ThresholdExpression: &costexplorer.AnomalySubscriptionThresholdExpressionArgs{ 55 // Dimension: &costexplorer.AnomalySubscriptionThresholdExpressionDimensionArgs{ 56 // Key: pulumi.String("ANOMALY_TOTAL_IMPACT_ABSOLUTE"), 57 // MatchOptions: pulumi.StringArray{ 58 // pulumi.String("GREATER_THAN_OR_EQUAL"), 59 // }, 60 // Values: pulumi.StringArray{ 61 // pulumi.String("100"), 62 // }, 63 // }, 64 // }, 65 // }) 66 // if err != nil { 67 // return err 68 // } 69 // return nil 70 // }) 71 // } 72 // 73 // ``` 74 // <!--End PulumiCodeChooser --> 75 // 76 // ### Threshold Expression Example 77 // 78 // ### Using a Percentage Threshold 79 // 80 // <!--Start PulumiCodeChooser --> 81 // ```go 82 // package main 83 // 84 // import ( 85 // 86 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/costexplorer" 87 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 88 // 89 // ) 90 // 91 // func main() { 92 // pulumi.Run(func(ctx *pulumi.Context) error { 93 // _, err := costexplorer.NewAnomalySubscription(ctx, "test", &costexplorer.AnomalySubscriptionArgs{ 94 // Name: pulumi.String("AWSServiceMonitor"), 95 // Frequency: pulumi.String("DAILY"), 96 // MonitorArnLists: pulumi.StringArray{ 97 // testAwsCeAnomalyMonitor.Arn, 98 // }, 99 // Subscribers: costexplorer.AnomalySubscriptionSubscriberArray{ 100 // &costexplorer.AnomalySubscriptionSubscriberArgs{ 101 // Type: pulumi.String("EMAIL"), 102 // Address: pulumi.String("abc@example.com"), 103 // }, 104 // }, 105 // ThresholdExpression: &costexplorer.AnomalySubscriptionThresholdExpressionArgs{ 106 // Dimension: &costexplorer.AnomalySubscriptionThresholdExpressionDimensionArgs{ 107 // Key: pulumi.String("ANOMALY_TOTAL_IMPACT_PERCENTAGE"), 108 // MatchOptions: pulumi.StringArray{ 109 // pulumi.String("GREATER_THAN_OR_EQUAL"), 110 // }, 111 // Values: pulumi.StringArray{ 112 // pulumi.String("100"), 113 // }, 114 // }, 115 // }, 116 // }) 117 // if err != nil { 118 // return err 119 // } 120 // return nil 121 // }) 122 // } 123 // 124 // ``` 125 // <!--End PulumiCodeChooser --> 126 // 127 // ### Using an `and` Expression 128 // 129 // <!--Start PulumiCodeChooser --> 130 // ```go 131 // package main 132 // 133 // import ( 134 // 135 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/costexplorer" 136 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 137 // 138 // ) 139 // 140 // func main() { 141 // pulumi.Run(func(ctx *pulumi.Context) error { 142 // _, err := costexplorer.NewAnomalySubscription(ctx, "test", &costexplorer.AnomalySubscriptionArgs{ 143 // Name: pulumi.String("AWSServiceMonitor"), 144 // Frequency: pulumi.String("DAILY"), 145 // MonitorArnLists: pulumi.StringArray{ 146 // testAwsCeAnomalyMonitor.Arn, 147 // }, 148 // Subscribers: costexplorer.AnomalySubscriptionSubscriberArray{ 149 // &costexplorer.AnomalySubscriptionSubscriberArgs{ 150 // Type: pulumi.String("EMAIL"), 151 // Address: pulumi.String("abc@example.com"), 152 // }, 153 // }, 154 // ThresholdExpression: &costexplorer.AnomalySubscriptionThresholdExpressionArgs{ 155 // Ands: costexplorer.AnomalySubscriptionThresholdExpressionAndArray{ 156 // &costexplorer.AnomalySubscriptionThresholdExpressionAndArgs{ 157 // Dimension: &costexplorer.AnomalySubscriptionThresholdExpressionAndDimensionArgs{ 158 // Key: pulumi.String("ANOMALY_TOTAL_IMPACT_ABSOLUTE"), 159 // MatchOptions: pulumi.StringArray{ 160 // pulumi.String("GREATER_THAN_OR_EQUAL"), 161 // }, 162 // Values: pulumi.StringArray{ 163 // pulumi.String("100"), 164 // }, 165 // }, 166 // }, 167 // &costexplorer.AnomalySubscriptionThresholdExpressionAndArgs{ 168 // Dimension: &costexplorer.AnomalySubscriptionThresholdExpressionAndDimensionArgs{ 169 // Key: pulumi.String("ANOMALY_TOTAL_IMPACT_PERCENTAGE"), 170 // MatchOptions: pulumi.StringArray{ 171 // pulumi.String("GREATER_THAN_OR_EQUAL"), 172 // }, 173 // Values: pulumi.StringArray{ 174 // pulumi.String("50"), 175 // }, 176 // }, 177 // }, 178 // }, 179 // }, 180 // }) 181 // if err != nil { 182 // return err 183 // } 184 // return nil 185 // }) 186 // } 187 // 188 // ``` 189 // <!--End PulumiCodeChooser --> 190 // 191 // ### SNS Example 192 // 193 // <!--Start PulumiCodeChooser --> 194 // ```go 195 // package main 196 // 197 // import ( 198 // 199 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/costexplorer" 200 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam" 201 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sns" 202 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 203 // 204 // ) 205 // func main() { 206 // pulumi.Run(func(ctx *pulumi.Context) error { 207 // costAnomalyUpdates, err := sns.NewTopic(ctx, "cost_anomaly_updates", &sns.TopicArgs{ 208 // Name: pulumi.String("CostAnomalyUpdates"), 209 // }) 210 // if err != nil { 211 // return err 212 // } 213 // snsTopicPolicy := pulumi.All(costAnomalyUpdates.Arn,costAnomalyUpdates.Arn).ApplyT(func(_args []interface{}) (iam.GetPolicyDocumentResult, error) { 214 // costAnomalyUpdatesArn := _args[0].(string) 215 // costAnomalyUpdatesArn1 := _args[1].(string) 216 // return iam.GetPolicyDocumentOutput(ctx, iam.GetPolicyDocumentOutputArgs{ 217 // PolicyId: "__default_policy_ID", 218 // Statements: []iam.GetPolicyDocumentStatement{ 219 // { 220 // Sid: "AWSAnomalyDetectionSNSPublishingPermissions", 221 // Actions: []string{ 222 // "SNS:Publish", 223 // }, 224 // Effect: "Allow", 225 // Principals: []iam.GetPolicyDocumentStatementPrincipal{ 226 // { 227 // Type: "Service", 228 // Identifiers: []string{ 229 // "costalerts.amazonaws.com", 230 // }, 231 // }, 232 // }, 233 // Resources: interface{}{ 234 // costAnomalyUpdatesArn, 235 // }, 236 // }, 237 // { 238 // Sid: "__default_statement_ID", 239 // Actions: []string{ 240 // "SNS:Subscribe", 241 // "SNS:SetTopicAttributes", 242 // "SNS:RemovePermission", 243 // "SNS:Receive", 244 // "SNS:Publish", 245 // "SNS:ListSubscriptionsByTopic", 246 // "SNS:GetTopicAttributes", 247 // "SNS:DeleteTopic", 248 // "SNS:AddPermission", 249 // }, 250 // Conditions: []iam.GetPolicyDocumentStatementCondition{ 251 // { 252 // Test: "StringEquals", 253 // Variable: "AWS:SourceOwner", 254 // Values: interface{}{ 255 // accountId, 256 // }, 257 // }, 258 // }, 259 // Effect: "Allow", 260 // Principals: []iam.GetPolicyDocumentStatementPrincipal{ 261 // { 262 // Type: "AWS", 263 // Identifiers: []string{ 264 // "*", 265 // }, 266 // }, 267 // }, 268 // Resources: interface{}{ 269 // costAnomalyUpdatesArn1, 270 // }, 271 // }, 272 // }, 273 // }, nil), nil 274 // }).(iam.GetPolicyDocumentResultOutput) 275 // _, err = sns.NewTopicPolicy(ctx, "default", &sns.TopicPolicyArgs{ 276 // Arn: costAnomalyUpdates.Arn, 277 // Policy: snsTopicPolicy.ApplyT(func(snsTopicPolicy iam.GetPolicyDocumentResult) (*string, error) { 278 // return &snsTopicPolicy.Json, nil 279 // }).(pulumi.StringPtrOutput), 280 // }) 281 // if err != nil { 282 // return err 283 // } 284 // anomalyMonitor, err := costexplorer.NewAnomalyMonitor(ctx, "anomaly_monitor", &costexplorer.AnomalyMonitorArgs{ 285 // Name: pulumi.String("AWSServiceMonitor"), 286 // MonitorType: pulumi.String("DIMENSIONAL"), 287 // MonitorDimension: pulumi.String("SERVICE"), 288 // }) 289 // if err != nil { 290 // return err 291 // } 292 // _, err = costexplorer.NewAnomalySubscription(ctx, "realtime_subscription", &costexplorer.AnomalySubscriptionArgs{ 293 // Name: pulumi.String("RealtimeAnomalySubscription"), 294 // Frequency: pulumi.String("IMMEDIATE"), 295 // MonitorArnLists: pulumi.StringArray{ 296 // anomalyMonitor.Arn, 297 // }, 298 // Subscribers: costexplorer.AnomalySubscriptionSubscriberArray{ 299 // &costexplorer.AnomalySubscriptionSubscriberArgs{ 300 // Type: pulumi.String("SNS"), 301 // Address: costAnomalyUpdates.Arn, 302 // }, 303 // }, 304 // }, pulumi.DependsOn([]pulumi.Resource{ 305 // _default, 306 // })) 307 // if err != nil { 308 // return err 309 // } 310 // return nil 311 // }) 312 // } 313 // ``` 314 // <!--End PulumiCodeChooser --> 315 // 316 // ## Import 317 // 318 // Using `pulumi import`, import `aws_ce_anomaly_subscription` using the `id`. For example: 319 // 320 // ```sh 321 // $ pulumi import aws:costexplorer/anomalySubscription:AnomalySubscription example AnomalySubscriptionARN 322 // ``` 323 type AnomalySubscription struct { 324 pulumi.CustomResourceState 325 326 // The unique identifier for the AWS account in which the anomaly subscription ought to be created. 327 AccountId pulumi.StringOutput `pulumi:"accountId"` 328 // ARN of the anomaly subscription. 329 Arn pulumi.StringOutput `pulumi:"arn"` 330 // The frequency that anomaly reports are sent. Valid Values: `DAILY` | `IMMEDIATE` | `WEEKLY`. 331 Frequency pulumi.StringOutput `pulumi:"frequency"` 332 // A list of cost anomaly monitors. 333 MonitorArnLists pulumi.StringArrayOutput `pulumi:"monitorArnLists"` 334 // The name for the subscription. 335 Name pulumi.StringOutput `pulumi:"name"` 336 // A subscriber configuration. Multiple subscribers can be defined. 337 Subscribers AnomalySubscriptionSubscriberArrayOutput `pulumi:"subscribers"` 338 // 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. 339 Tags pulumi.StringMapOutput `pulumi:"tags"` 340 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 341 // 342 // Deprecated: Please use `tags` instead. 343 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 344 // An Expression object used to specify the anomalies that you want to generate alerts for. See Threshold Expression. 345 ThresholdExpression AnomalySubscriptionThresholdExpressionOutput `pulumi:"thresholdExpression"` 346 } 347 348 // NewAnomalySubscription registers a new resource with the given unique name, arguments, and options. 349 func NewAnomalySubscription(ctx *pulumi.Context, 350 name string, args *AnomalySubscriptionArgs, opts ...pulumi.ResourceOption) (*AnomalySubscription, error) { 351 if args == nil { 352 return nil, errors.New("missing one or more required arguments") 353 } 354 355 if args.Frequency == nil { 356 return nil, errors.New("invalid value for required argument 'Frequency'") 357 } 358 if args.MonitorArnLists == nil { 359 return nil, errors.New("invalid value for required argument 'MonitorArnLists'") 360 } 361 if args.Subscribers == nil { 362 return nil, errors.New("invalid value for required argument 'Subscribers'") 363 } 364 opts = internal.PkgResourceDefaultOpts(opts) 365 var resource AnomalySubscription 366 err := ctx.RegisterResource("aws:costexplorer/anomalySubscription:AnomalySubscription", name, args, &resource, opts...) 367 if err != nil { 368 return nil, err 369 } 370 return &resource, nil 371 } 372 373 // GetAnomalySubscription gets an existing AnomalySubscription resource's state with the given name, ID, and optional 374 // state properties that are used to uniquely qualify the lookup (nil if not required). 375 func GetAnomalySubscription(ctx *pulumi.Context, 376 name string, id pulumi.IDInput, state *AnomalySubscriptionState, opts ...pulumi.ResourceOption) (*AnomalySubscription, error) { 377 var resource AnomalySubscription 378 err := ctx.ReadResource("aws:costexplorer/anomalySubscription:AnomalySubscription", name, id, state, &resource, opts...) 379 if err != nil { 380 return nil, err 381 } 382 return &resource, nil 383 } 384 385 // Input properties used for looking up and filtering AnomalySubscription resources. 386 type anomalySubscriptionState struct { 387 // The unique identifier for the AWS account in which the anomaly subscription ought to be created. 388 AccountId *string `pulumi:"accountId"` 389 // ARN of the anomaly subscription. 390 Arn *string `pulumi:"arn"` 391 // The frequency that anomaly reports are sent. Valid Values: `DAILY` | `IMMEDIATE` | `WEEKLY`. 392 Frequency *string `pulumi:"frequency"` 393 // A list of cost anomaly monitors. 394 MonitorArnLists []string `pulumi:"monitorArnLists"` 395 // The name for the subscription. 396 Name *string `pulumi:"name"` 397 // A subscriber configuration. Multiple subscribers can be defined. 398 Subscribers []AnomalySubscriptionSubscriber `pulumi:"subscribers"` 399 // 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. 400 Tags map[string]string `pulumi:"tags"` 401 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 402 // 403 // Deprecated: Please use `tags` instead. 404 TagsAll map[string]string `pulumi:"tagsAll"` 405 // An Expression object used to specify the anomalies that you want to generate alerts for. See Threshold Expression. 406 ThresholdExpression *AnomalySubscriptionThresholdExpression `pulumi:"thresholdExpression"` 407 } 408 409 type AnomalySubscriptionState struct { 410 // The unique identifier for the AWS account in which the anomaly subscription ought to be created. 411 AccountId pulumi.StringPtrInput 412 // ARN of the anomaly subscription. 413 Arn pulumi.StringPtrInput 414 // The frequency that anomaly reports are sent. Valid Values: `DAILY` | `IMMEDIATE` | `WEEKLY`. 415 Frequency pulumi.StringPtrInput 416 // A list of cost anomaly monitors. 417 MonitorArnLists pulumi.StringArrayInput 418 // The name for the subscription. 419 Name pulumi.StringPtrInput 420 // A subscriber configuration. Multiple subscribers can be defined. 421 Subscribers AnomalySubscriptionSubscriberArrayInput 422 // 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. 423 Tags pulumi.StringMapInput 424 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 425 // 426 // Deprecated: Please use `tags` instead. 427 TagsAll pulumi.StringMapInput 428 // An Expression object used to specify the anomalies that you want to generate alerts for. See Threshold Expression. 429 ThresholdExpression AnomalySubscriptionThresholdExpressionPtrInput 430 } 431 432 func (AnomalySubscriptionState) ElementType() reflect.Type { 433 return reflect.TypeOf((*anomalySubscriptionState)(nil)).Elem() 434 } 435 436 type anomalySubscriptionArgs struct { 437 // The unique identifier for the AWS account in which the anomaly subscription ought to be created. 438 AccountId *string `pulumi:"accountId"` 439 // The frequency that anomaly reports are sent. Valid Values: `DAILY` | `IMMEDIATE` | `WEEKLY`. 440 Frequency string `pulumi:"frequency"` 441 // A list of cost anomaly monitors. 442 MonitorArnLists []string `pulumi:"monitorArnLists"` 443 // The name for the subscription. 444 Name *string `pulumi:"name"` 445 // A subscriber configuration. Multiple subscribers can be defined. 446 Subscribers []AnomalySubscriptionSubscriber `pulumi:"subscribers"` 447 // 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. 448 Tags map[string]string `pulumi:"tags"` 449 // An Expression object used to specify the anomalies that you want to generate alerts for. See Threshold Expression. 450 ThresholdExpression *AnomalySubscriptionThresholdExpression `pulumi:"thresholdExpression"` 451 } 452 453 // The set of arguments for constructing a AnomalySubscription resource. 454 type AnomalySubscriptionArgs struct { 455 // The unique identifier for the AWS account in which the anomaly subscription ought to be created. 456 AccountId pulumi.StringPtrInput 457 // The frequency that anomaly reports are sent. Valid Values: `DAILY` | `IMMEDIATE` | `WEEKLY`. 458 Frequency pulumi.StringInput 459 // A list of cost anomaly monitors. 460 MonitorArnLists pulumi.StringArrayInput 461 // The name for the subscription. 462 Name pulumi.StringPtrInput 463 // A subscriber configuration. Multiple subscribers can be defined. 464 Subscribers AnomalySubscriptionSubscriberArrayInput 465 // 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. 466 Tags pulumi.StringMapInput 467 // An Expression object used to specify the anomalies that you want to generate alerts for. See Threshold Expression. 468 ThresholdExpression AnomalySubscriptionThresholdExpressionPtrInput 469 } 470 471 func (AnomalySubscriptionArgs) ElementType() reflect.Type { 472 return reflect.TypeOf((*anomalySubscriptionArgs)(nil)).Elem() 473 } 474 475 type AnomalySubscriptionInput interface { 476 pulumi.Input 477 478 ToAnomalySubscriptionOutput() AnomalySubscriptionOutput 479 ToAnomalySubscriptionOutputWithContext(ctx context.Context) AnomalySubscriptionOutput 480 } 481 482 func (*AnomalySubscription) ElementType() reflect.Type { 483 return reflect.TypeOf((**AnomalySubscription)(nil)).Elem() 484 } 485 486 func (i *AnomalySubscription) ToAnomalySubscriptionOutput() AnomalySubscriptionOutput { 487 return i.ToAnomalySubscriptionOutputWithContext(context.Background()) 488 } 489 490 func (i *AnomalySubscription) ToAnomalySubscriptionOutputWithContext(ctx context.Context) AnomalySubscriptionOutput { 491 return pulumi.ToOutputWithContext(ctx, i).(AnomalySubscriptionOutput) 492 } 493 494 // AnomalySubscriptionArrayInput is an input type that accepts AnomalySubscriptionArray and AnomalySubscriptionArrayOutput values. 495 // You can construct a concrete instance of `AnomalySubscriptionArrayInput` via: 496 // 497 // AnomalySubscriptionArray{ AnomalySubscriptionArgs{...} } 498 type AnomalySubscriptionArrayInput interface { 499 pulumi.Input 500 501 ToAnomalySubscriptionArrayOutput() AnomalySubscriptionArrayOutput 502 ToAnomalySubscriptionArrayOutputWithContext(context.Context) AnomalySubscriptionArrayOutput 503 } 504 505 type AnomalySubscriptionArray []AnomalySubscriptionInput 506 507 func (AnomalySubscriptionArray) ElementType() reflect.Type { 508 return reflect.TypeOf((*[]*AnomalySubscription)(nil)).Elem() 509 } 510 511 func (i AnomalySubscriptionArray) ToAnomalySubscriptionArrayOutput() AnomalySubscriptionArrayOutput { 512 return i.ToAnomalySubscriptionArrayOutputWithContext(context.Background()) 513 } 514 515 func (i AnomalySubscriptionArray) ToAnomalySubscriptionArrayOutputWithContext(ctx context.Context) AnomalySubscriptionArrayOutput { 516 return pulumi.ToOutputWithContext(ctx, i).(AnomalySubscriptionArrayOutput) 517 } 518 519 // AnomalySubscriptionMapInput is an input type that accepts AnomalySubscriptionMap and AnomalySubscriptionMapOutput values. 520 // You can construct a concrete instance of `AnomalySubscriptionMapInput` via: 521 // 522 // AnomalySubscriptionMap{ "key": AnomalySubscriptionArgs{...} } 523 type AnomalySubscriptionMapInput interface { 524 pulumi.Input 525 526 ToAnomalySubscriptionMapOutput() AnomalySubscriptionMapOutput 527 ToAnomalySubscriptionMapOutputWithContext(context.Context) AnomalySubscriptionMapOutput 528 } 529 530 type AnomalySubscriptionMap map[string]AnomalySubscriptionInput 531 532 func (AnomalySubscriptionMap) ElementType() reflect.Type { 533 return reflect.TypeOf((*map[string]*AnomalySubscription)(nil)).Elem() 534 } 535 536 func (i AnomalySubscriptionMap) ToAnomalySubscriptionMapOutput() AnomalySubscriptionMapOutput { 537 return i.ToAnomalySubscriptionMapOutputWithContext(context.Background()) 538 } 539 540 func (i AnomalySubscriptionMap) ToAnomalySubscriptionMapOutputWithContext(ctx context.Context) AnomalySubscriptionMapOutput { 541 return pulumi.ToOutputWithContext(ctx, i).(AnomalySubscriptionMapOutput) 542 } 543 544 type AnomalySubscriptionOutput struct{ *pulumi.OutputState } 545 546 func (AnomalySubscriptionOutput) ElementType() reflect.Type { 547 return reflect.TypeOf((**AnomalySubscription)(nil)).Elem() 548 } 549 550 func (o AnomalySubscriptionOutput) ToAnomalySubscriptionOutput() AnomalySubscriptionOutput { 551 return o 552 } 553 554 func (o AnomalySubscriptionOutput) ToAnomalySubscriptionOutputWithContext(ctx context.Context) AnomalySubscriptionOutput { 555 return o 556 } 557 558 // The unique identifier for the AWS account in which the anomaly subscription ought to be created. 559 func (o AnomalySubscriptionOutput) AccountId() pulumi.StringOutput { 560 return o.ApplyT(func(v *AnomalySubscription) pulumi.StringOutput { return v.AccountId }).(pulumi.StringOutput) 561 } 562 563 // ARN of the anomaly subscription. 564 func (o AnomalySubscriptionOutput) Arn() pulumi.StringOutput { 565 return o.ApplyT(func(v *AnomalySubscription) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 566 } 567 568 // The frequency that anomaly reports are sent. Valid Values: `DAILY` | `IMMEDIATE` | `WEEKLY`. 569 func (o AnomalySubscriptionOutput) Frequency() pulumi.StringOutput { 570 return o.ApplyT(func(v *AnomalySubscription) pulumi.StringOutput { return v.Frequency }).(pulumi.StringOutput) 571 } 572 573 // A list of cost anomaly monitors. 574 func (o AnomalySubscriptionOutput) MonitorArnLists() pulumi.StringArrayOutput { 575 return o.ApplyT(func(v *AnomalySubscription) pulumi.StringArrayOutput { return v.MonitorArnLists }).(pulumi.StringArrayOutput) 576 } 577 578 // The name for the subscription. 579 func (o AnomalySubscriptionOutput) Name() pulumi.StringOutput { 580 return o.ApplyT(func(v *AnomalySubscription) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 581 } 582 583 // A subscriber configuration. Multiple subscribers can be defined. 584 func (o AnomalySubscriptionOutput) Subscribers() AnomalySubscriptionSubscriberArrayOutput { 585 return o.ApplyT(func(v *AnomalySubscription) AnomalySubscriptionSubscriberArrayOutput { return v.Subscribers }).(AnomalySubscriptionSubscriberArrayOutput) 586 } 587 588 // 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. 589 func (o AnomalySubscriptionOutput) Tags() pulumi.StringMapOutput { 590 return o.ApplyT(func(v *AnomalySubscription) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 591 } 592 593 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 594 // 595 // Deprecated: Please use `tags` instead. 596 func (o AnomalySubscriptionOutput) TagsAll() pulumi.StringMapOutput { 597 return o.ApplyT(func(v *AnomalySubscription) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 598 } 599 600 // An Expression object used to specify the anomalies that you want to generate alerts for. See Threshold Expression. 601 func (o AnomalySubscriptionOutput) ThresholdExpression() AnomalySubscriptionThresholdExpressionOutput { 602 return o.ApplyT(func(v *AnomalySubscription) AnomalySubscriptionThresholdExpressionOutput { 603 return v.ThresholdExpression 604 }).(AnomalySubscriptionThresholdExpressionOutput) 605 } 606 607 type AnomalySubscriptionArrayOutput struct{ *pulumi.OutputState } 608 609 func (AnomalySubscriptionArrayOutput) ElementType() reflect.Type { 610 return reflect.TypeOf((*[]*AnomalySubscription)(nil)).Elem() 611 } 612 613 func (o AnomalySubscriptionArrayOutput) ToAnomalySubscriptionArrayOutput() AnomalySubscriptionArrayOutput { 614 return o 615 } 616 617 func (o AnomalySubscriptionArrayOutput) ToAnomalySubscriptionArrayOutputWithContext(ctx context.Context) AnomalySubscriptionArrayOutput { 618 return o 619 } 620 621 func (o AnomalySubscriptionArrayOutput) Index(i pulumi.IntInput) AnomalySubscriptionOutput { 622 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AnomalySubscription { 623 return vs[0].([]*AnomalySubscription)[vs[1].(int)] 624 }).(AnomalySubscriptionOutput) 625 } 626 627 type AnomalySubscriptionMapOutput struct{ *pulumi.OutputState } 628 629 func (AnomalySubscriptionMapOutput) ElementType() reflect.Type { 630 return reflect.TypeOf((*map[string]*AnomalySubscription)(nil)).Elem() 631 } 632 633 func (o AnomalySubscriptionMapOutput) ToAnomalySubscriptionMapOutput() AnomalySubscriptionMapOutput { 634 return o 635 } 636 637 func (o AnomalySubscriptionMapOutput) ToAnomalySubscriptionMapOutputWithContext(ctx context.Context) AnomalySubscriptionMapOutput { 638 return o 639 } 640 641 func (o AnomalySubscriptionMapOutput) MapIndex(k pulumi.StringInput) AnomalySubscriptionOutput { 642 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AnomalySubscription { 643 return vs[0].(map[string]*AnomalySubscription)[vs[1].(string)] 644 }).(AnomalySubscriptionOutput) 645 } 646 647 func init() { 648 pulumi.RegisterInputType(reflect.TypeOf((*AnomalySubscriptionInput)(nil)).Elem(), &AnomalySubscription{}) 649 pulumi.RegisterInputType(reflect.TypeOf((*AnomalySubscriptionArrayInput)(nil)).Elem(), AnomalySubscriptionArray{}) 650 pulumi.RegisterInputType(reflect.TypeOf((*AnomalySubscriptionMapInput)(nil)).Elem(), AnomalySubscriptionMap{}) 651 pulumi.RegisterOutputType(AnomalySubscriptionOutput{}) 652 pulumi.RegisterOutputType(AnomalySubscriptionArrayOutput{}) 653 pulumi.RegisterOutputType(AnomalySubscriptionMapOutput{}) 654 }