Class CfnAnomalySubscription

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:55.883Z") @Stability(Stable) public class CfnAnomalySubscription extends CfnResource implements IInspectable
A CloudFormation AWS::CE::AnomalySubscription.

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();
 
  • 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 Construct scope, @NotNull String id, @NotNull CfnAnomalySubscriptionProps props)
      Create a new AWS::CE::AnomalySubscription.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      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.

      Notifications are sent either over email (for DAILY and WEEKLY frequencies) or SNS (for IMMEDIATE frequency). For more information, see Creating an Amazon SNS topic for anomaly notifications .

    • setFrequency

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

      Notifications are sent either over email (for DAILY and WEEKLY frequencies) or SNS (for IMMEDIATE frequency). For more information, see Creating an Amazon SNS topic for anomaly notifications .

    • 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()
      AWS::CE::AnomalySubscription.ResourceTags.
    • setResourceTags

      @Stability(Stable) public void setResourceTags(@Nullable IResolvable value)
      AWS::CE::AnomalySubscription.ResourceTags.
    • setResourceTags

      @Stability(Stable) public void setResourceTags(@Nullable List<Object> value)
      AWS::CE::AnomalySubscription.ResourceTags.
    • getThreshold

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

      An absolute dollar value that must be exceeded by the anomaly's total impact (see Impact for more details) for an anomaly notification to be generated.

      This field has been deprecated. To specify a threshold, use ThresholdExpression. Continued use of Threshold will be treated as shorthand syntax for a ThresholdExpression.

      One of Threshold or ThresholdExpression is required for AWS::CE::AnomalySubscription . You cannot specify both.

    • setThreshold

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

      An absolute dollar value that must be exceeded by the anomaly's total impact (see Impact for more details) for an anomaly notification to be generated.

      This field has been deprecated. To specify a threshold, use ThresholdExpression. Continued use of Threshold will be treated as shorthand syntax for a ThresholdExpression.

      One of Threshold or ThresholdExpression is required for AWS::CE::AnomalySubscription . You cannot specify both.

    • 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.

      One of Threshold or ThresholdExpression is required for AWS::CE::AnomalySubscription . You cannot specify both.

      For further information, see the Examples section of this page.

    • 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.

      One of Threshold or ThresholdExpression is required for AWS::CE::AnomalySubscription . You cannot specify both.

      For further information, see the Examples section of this page.