Class CfnAnomalySubscription
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
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();
-
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.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnAnomalySubscription(Construct scope, String id, CfnAnomalySubscriptionProps props) Create a newAWS::CE::AnomalySubscription.protectedCfnAnomalySubscription(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnAnomalySubscription(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionYour unique account identifier.TheAnomalySubscriptionAmazon Resource Name (ARN).The frequency that anomaly notifications are sent.A list of cost anomaly monitors.AWS::CE::AnomalySubscription.ResourceTags.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.voidsetResourceTags(List<Object> value) AWS::CE::AnomalySubscription.ResourceTags.voidsetResourceTags(IResolvable value) AWS::CE::AnomalySubscription.ResourceTags.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.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods 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.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 Construct scope, @NotNull String id, @NotNull CfnAnomalySubscriptionProps props) Create a newAWS::CE::AnomalySubscription.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrAccountId
Your unique account identifier. -
getAttrSubscriptionArn
TheAnomalySubscriptionAmazon Resource Name (ARN). -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
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
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
A list of cost anomaly monitors. -
setMonitorArnList
A list of cost anomaly monitors. -
getSubscribers
A list of subscribers to notify. -
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
AWS::CE::AnomalySubscription.ResourceTags. -
setResourceTags
AWS::CE::AnomalySubscription.ResourceTags. -
setResourceTags
AWS::CE::AnomalySubscription.ResourceTags. -
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
(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
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.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
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.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.
-