@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:35.576Z") 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();
Modifier and Type | Class and Description |
---|---|
static class |
CfnAnomalySubscription.Builder
A fluent builder for
CfnAnomalySubscription . |
static interface |
CfnAnomalySubscription.ResourceTagProperty
The tag structure that contains a tag key and value.
|
static interface |
CfnAnomalySubscription.SubscriberProperty
The recipient of `AnomalySubscription` notifications.
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnAnomalySubscription(Construct scope,
java.lang.String id,
CfnAnomalySubscriptionProps props)
Create a new `AWS::CE::AnomalySubscription`.
|
protected |
CfnAnomalySubscription(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnAnomalySubscription(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrAccountId()
Your unique account identifier.
|
java.lang.String |
getAttrSubscriptionArn()
The `AnomalySubscription` Amazon Resource Name (ARN).
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getFrequency()
The frequency that anomaly notifications are sent.
|
java.util.List<java.lang.String> |
getMonitorArnList()
A list of cost anomaly monitors.
|
java.lang.Object |
getResourceTags()
`AWS::CE::AnomalySubscription.ResourceTags`.
|
java.lang.Object |
getSubscribers()
A list of subscribers to notify.
|
java.lang.String |
getSubscriptionName()
The name for the subscription.
|
java.lang.Number |
getThreshold()
(deprecated).
|
java.lang.String |
getThresholdExpression()
An [Expression](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html) object in JSON string format used to specify the anomalies that you want to generate alerts for.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setFrequency(java.lang.String value)
The frequency that anomaly notifications are sent.
|
void |
setMonitorArnList(java.util.List<java.lang.String> value)
A list of cost anomaly monitors.
|
void |
setResourceTags(IResolvable value)
`AWS::CE::AnomalySubscription.ResourceTags`.
|
void |
setResourceTags(java.util.List<java.lang.Object> value)
`AWS::CE::AnomalySubscription.ResourceTags`.
|
void |
setSubscribers(IResolvable value)
A list of subscribers to notify.
|
void |
setSubscribers(java.util.List<java.lang.Object> value)
A list of subscribers to notify.
|
void |
setSubscriptionName(java.lang.String value)
The name for the subscription.
|
void |
setThreshold(java.lang.Number value)
(deprecated).
|
void |
setThresholdExpression(java.lang.String value)
An [Expression](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html) object in JSON string format used to specify the anomalies that you want to generate alerts for.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnAnomalySubscription(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnAnomalySubscription(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnAnomalySubscription(Construct scope, java.lang.String id, CfnAnomalySubscriptionProps props)
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.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrAccountId()
public java.lang.String getAttrSubscriptionArn()
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public java.lang.String getFrequency()
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 .
public void setFrequency(java.lang.String value)
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 .
public java.util.List<java.lang.String> getMonitorArnList()
public void setMonitorArnList(java.util.List<java.lang.String> value)
public java.lang.Object getSubscribers()
public void setSubscribers(IResolvable value)
public void setSubscribers(java.util.List<java.lang.Object> value)
public java.lang.String getSubscriptionName()
public void setSubscriptionName(java.lang.String value)
public java.lang.Object getResourceTags()
public void setResourceTags(IResolvable value)
public void setResourceTags(java.util.List<java.lang.Object> value)
public java.lang.Number getThreshold()
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.
public void setThreshold(java.lang.Number value)
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.
public java.lang.String getThresholdExpression()
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.
public void setThresholdExpression(java.lang.String value)
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.