AWS::CE::AnomalySubscription
The AWS::CE::AnomalySubscription
resource is a Cost Explorer resource type that associates a monitor, threshold, and list of subscribers. It delivers notifications about anomalies detected by a monitor that exceeds a threshold. The content consists of the detailed metadata and the current status of the AnomalySubscription
object.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::CE::AnomalySubscription", "Properties" : { "Frequency" :
String
, "MonitorArnList" :[ String, ... ]
, "ResourceTags" :[ ResourceTag, ... ]
, "Subscribers" :[ Subscriber, ... ]
, "SubscriptionName" :String
, "Threshold" :Double
} }
YAML
Type: AWS::CE::AnomalySubscription Properties: Frequency:
String
MonitorArnList:- String
ResourceTags:- ResourceTag
Subscribers:- Subscriber
SubscriptionName:String
Threshold:Double
Properties
Frequency
-
The frequency that anomaly reports are sent over email.
Required: Yes
Type: String
Allowed values:
DAILY | IMMEDIATE | WEEKLY
Update requires: No interruption
MonitorArnList
-
A list of cost anomaly monitors.
Required: Yes
Type: List of String
Update requires: No interruption
ResourceTags
Not currently supported by AWS CloudFormation.
Required: No
Type: List of ResourceTag
Update requires: Replacement
Subscribers
-
A list of subscribers to notify.
Required: Yes
Type: List of Subscriber
Update requires: No interruption
SubscriptionName
-
The name for the subscription.
Required: Yes
Type: String
Minimum:
0
Maximum:
1024
Pattern:
[\S\s]*
Update requires: No interruption
Threshold
-
The dollar value that triggers a notification if the threshold is exceeded.
Required: Yes
Type: Double
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref
function, Ref
returns SubscriptionArn
. For example:
{ "Ref": "myAnomalyMonitorLogicalName" }
For more information about using the Ref
function, see Ref.
Fn::GetAtt
The Fn::GetAtt
intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using the Fn::GetAtt
intrinsic function, see Fn::GetAtt.
Examples
Attaching subscriptions to monitors
The following example shows two monitors attached to a subscription.
JSON
{ "Resources": { "CustomAnomalyMonitorWithLinkedAccount": { "Type": "AWS::CE::AnomalyMonitor", "Properties": { "MonitorName": "MonitorName", "MonitorType": "CUSTOM", "MonitorSpecification": " { \"Dimensions\" : { \"Key\" : \"LINKED_ACCOUNT\", \"Values\" : [ \"123456789012\", \"123456789013\" ] } }" } }, "AnomalyServiceMonitor": { "Type": "AWS::CE::AnomalyMonitor", "Properties": { "MonitorName": "MonitorName", "MonitorType": "DIMENSIONAL", "MonitorDimension": "SERVICE" } }, "AnomalySubscription": { "Type": "AWS::CE::AnomalySubscription", "Properties": { "SubscriptionName": "SubscriptionName", "Threshold": 100, "Frequency": "DAILY", "MonitorArnList": [ {"Ref": "CustomAnomalyMonitorWithLinkedAccount"}, {"Ref": "AnomalyServiceMonitor"} ], "Subscribers": [ { "Type": "EMAIL", "Address": "abc@def.com" } ] } } } }
YAML
Resources: CustomAnomalyMonitorWithLinkedAccount: Type: 'AWS::CE::AnomalyMonitor' Properties: MonitorName: "MonitorName" MonitorType: "CUSTOM" MonitorSpecification: ' { "Dimensions" : { "Key" : "LINKED_ACCOUNT", "Values" : [ "123456789012", "123456789013" ] } }' AnomalyServiceMonitor: Type: 'AWS::CE::AnomalyMonitor' Properties: MonitorName: 'MonitorName' MonitorType: 'DIMENSIONAL' MonitorDimension: 'SERVICE' AnomalySubscription: Type: 'AWS::CE::AnomalySubscription' Properties: SubscriptionName: "SubscriptionName" Threshold: 100 Frequency: "DAILY" MonitorArnList: [ !Ref CustomAnomalyMonitorWithLinkedAccount, !Ref AnomalyServiceMonitor ] Subscribers: [ { "Type": "EMAIL", "Address": "abc@def.com" } ]
See also
-
AnomalySubscription in the AWS Billing and Cost Management API Reference.
-
CreateAnomalySubscription in the AWS Billing and Cost Management API Reference.
-
DeleteAnomalySubscription in the AWS Billing and Cost Management API Reference.
-
GetAnomalySubscriptions in the AWS Billing and Cost Management API Reference.
-
UpdateAnomalySubscription in the AWS Billing and Cost Management API Reference.