Class CfnAnomalySubscription
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.ce.CfnAnomalySubscription
- All Implemented Interfaces:
IEnvironmentAware,IInspectable,ITaggableV2,IAnomalySubscriptionRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.118.0 (build 02eec31)",
date="2025-11-04T09:27:35.789Z")
@Stability(Stable)
public class CfnAnomalySubscription
extends CfnResource
implements IInspectable, IAnomalySubscriptionRef, ITaggableV2
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnAnomalySubscription.static interfaceThe tag structure that contains a tag key and value.static interfaceThe recipient ofAnomalySubscriptionnotifications.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.ce.IAnomalySubscriptionRef
IAnomalySubscriptionRef.Jsii$Default, IAnomalySubscriptionRef.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnAnomalySubscription(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnAnomalySubscription(software.amazon.jsii.JsiiObjectRef objRef) CfnAnomalySubscription(software.constructs.Construct scope, String id, CfnAnomalySubscriptionProps props) -
Method Summary
Modifier and TypeMethodDescriptionA reference to a AnomalySubscription resource.Your unique account identifier.TheAnomalySubscriptionAmazon Resource Name (ARN).Tag Manager which manages the tags for this resource.The frequency that anomaly notifications are sent.A list of cost anomaly monitors.Tags to assign to subscription.A list of subscribers to notify.The name for the subscription.(deprecated).An Expression object in JSON string format used to specify the anomalies that you want to generate alerts for.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetFrequency(String value) The frequency that anomaly notifications are sent.voidsetMonitorArnList(List<String> value) A list of cost anomaly monitors.voidTags to assign to subscription.voidsetSubscribers(List<Object> value) A list of subscribers to notify.voidsetSubscribers(IResolvable value) A list of subscribers to notify.voidsetSubscriptionName(String value) The name for the subscription.voidsetThreshold(Number value) (deprecated).voidsetThresholdExpression(String value) An Expression object in JSON string format used to specify the anomalies that you want to generate alerts for.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- 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:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAnomalySubscriptionRef
A reference to a AnomalySubscription resource.- Specified by:
getAnomalySubscriptionRefin interfaceIAnomalySubscriptionRef
-
getAttrAccountId
Your unique account identifier. -
getAttrSubscriptionArn
TheAnomalySubscriptionAmazon Resource Name (ARN). -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getFrequency
The frequency that anomaly notifications are sent. -
setFrequency
The frequency that anomaly notifications are sent. -
getMonitorArnList
A list of cost anomaly monitors. -
setMonitorArnList
A list of cost anomaly monitors. -
getSubscribers
A list of subscribers to notify.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnAnomalySubscription.SubscriberProperty> -
setSubscribers
A list of subscribers to notify. -
setSubscribers
A list of subscribers to notify. -
getSubscriptionName
The name for the subscription. -
setSubscriptionName
The name for the subscription. -
getResourceTags
@Stability(Stable) @Nullable public List<CfnAnomalySubscription.ResourceTagProperty> getResourceTags()Tags to assign to subscription. -
setResourceTags
@Stability(Stable) public void setResourceTags(@Nullable List<CfnAnomalySubscription.ResourceTagProperty> value) Tags to assign to subscription. -
getThreshold
(deprecated). -
setThreshold
(deprecated). -
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 areANOMALY_TOTAL_IMPACT_ABSOLUTEandANOMALY_TOTAL_IMPACT_PERCENTAGE, corresponding to an anomaly’s TotalImpact and TotalImpactPercentage, respectively (see Impact for more details). The supported nested expression types areANDandOR. The match optionGREATER_THAN_OR_EQUALis required. Values must be numbers between 0 and 10,000,000,000 in string format. -
setThresholdExpression
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 areANOMALY_TOTAL_IMPACT_ABSOLUTEandANOMALY_TOTAL_IMPACT_PERCENTAGE, corresponding to an anomaly’s TotalImpact and TotalImpactPercentage, respectively (see Impact for more details). The supported nested expression types areANDandOR. The match optionGREATER_THAN_OR_EQUALis required. Values must be numbers between 0 and 10,000,000,000 in string format.
-