Class CfnAnomalySubscription

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-06T23:25:05.242Z") @Stability(Stable) public class CfnAnomalySubscription extends CfnResource implements IInspectable
The AWS::CE::AnomalySubscription resource (also referred to as an alert subscription) is a Cost Explorer resource type that sends notifications about specific anomalies that meet an alerting criteria defined by you.

You can specify the frequency of the alerts and the subscribers to notify.

Anomaly subscriptions can be associated with one or more AWS::CE::AnomalyMonitor resources, and they only send notifications about anomalies detected by those associated monitors. You can also configure a threshold to further control which anomalies are included in the notifications.

Anomalies that don’t exceed the chosen threshold and therefore don’t trigger notifications from an anomaly subscription will still be available on the console and from the GetAnomalies API.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.ce.*;
 CfnAnomalySubscription cfnAnomalySubscription = CfnAnomalySubscription.Builder.create(this, "MyCfnAnomalySubscription")
         .frequency("frequency")
         .monitorArnList(List.of("monitorArnList"))
         .subscribers(List.of(SubscriberProperty.builder()
                 .address("address")
                 .type("type")
                 // the properties below are optional
                 .status("status")
                 .build()))
         .subscriptionName("subscriptionName")
         // the properties below are optional
         .resourceTags(List.of(ResourceTagProperty.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .threshold(123)
         .thresholdExpression("thresholdExpression")
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnAnomalySubscription

      protected CfnAnomalySubscription(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnAnomalySubscription

      protected CfnAnomalySubscription(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnAnomalySubscription

      @Stability(Stable) public CfnAnomalySubscription(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnAnomalySubscriptionProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrAccountId

      @Stability(Stable) @NotNull public String getAttrAccountId()
      Your unique account identifier.
    • getAttrSubscriptionArn

      @Stability(Stable) @NotNull public String getAttrSubscriptionArn()
      The AnomalySubscription Amazon Resource Name (ARN).
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getFrequency

      @Stability(Stable) @NotNull public String getFrequency()
      The frequency that anomaly notifications are sent.
    • setFrequency

      @Stability(Stable) public void setFrequency(@NotNull String value)
      The frequency that anomaly notifications are sent.
    • getMonitorArnList

      @Stability(Stable) @NotNull public List<String> getMonitorArnList()
      A list of cost anomaly monitors.
    • setMonitorArnList

      @Stability(Stable) public void setMonitorArnList(@NotNull List<String> value)
      A list of cost anomaly monitors.
    • getSubscribers

      @Stability(Stable) @NotNull public Object getSubscribers()
      A list of subscribers to notify.
    • setSubscribers

      @Stability(Stable) public void setSubscribers(@NotNull IResolvable value)
      A list of subscribers to notify.
    • setSubscribers

      @Stability(Stable) public void setSubscribers(@NotNull List<Object> value)
      A list of subscribers to notify.
    • getSubscriptionName

      @Stability(Stable) @NotNull public String getSubscriptionName()
      The name for the subscription.
    • setSubscriptionName

      @Stability(Stable) public void setSubscriptionName(@NotNull String value)
      The name for the subscription.
    • getResourceTags

      @Stability(Stable) @Nullable public Object getResourceTags()
      Tags to assign to subscription.
    • setResourceTags

      @Stability(Stable) public void setResourceTags(@Nullable IResolvable value)
      Tags to assign to subscription.
    • setResourceTags

      @Stability(Stable) public void setResourceTags(@Nullable List<Object> value)
      Tags to assign to subscription.
    • getThreshold

      @Stability(Stable) @Nullable public Number getThreshold()
      (deprecated).
    • setThreshold

      @Stability(Stable) public void setThreshold(@Nullable Number value)
      (deprecated).
    • getThresholdExpression

      @Stability(Stable) @Nullable public String getThresholdExpression()
      An Expression object in JSON string format used to specify the anomalies that you want to generate alerts for. This supports dimensions and nested expressions. The supported dimensions are ANOMALY_TOTAL_IMPACT_ABSOLUTE and ANOMALY_TOTAL_IMPACT_PERCENTAGE , corresponding to an anomaly’s TotalImpact and TotalImpactPercentage, respectively (see Impact for more details). The supported nested expression types are AND and OR . The match option GREATER_THAN_OR_EQUAL is required. Values must be numbers between 0 and 10,000,000,000 in string format.
    • setThresholdExpression

      @Stability(Stable) public void setThresholdExpression(@Nullable String value)
      An Expression object in JSON string format used to specify the anomalies that you want to generate alerts for. This supports dimensions and nested expressions. The supported dimensions are ANOMALY_TOTAL_IMPACT_ABSOLUTE and ANOMALY_TOTAL_IMPACT_PERCENTAGE , corresponding to an anomaly’s TotalImpact and TotalImpactPercentage, respectively (see Impact for more details). The supported nested expression types are AND and OR . The match option GREATER_THAN_OR_EQUAL is required. Values must be numbers between 0 and 10,000,000,000 in string format.