anomaly_subscriptions
Creates, updates, deletes or gets an anomaly_subscription
resource or lists anomaly_subscriptions
in a region
Overview
Name | anomaly_subscriptions |
Type | Resource |
Description | AWS Cost Anomaly Detection leverages advanced Machine Learning technologies to identify anomalous spend and root causes, so you can quickly take action. Create subscription to be notified |
Id | aws.ce.anomaly_subscriptions |
Fields
Name | Datatype | Description |
---|---|---|
subscription_arn | string | Subscription ARN |
subscription_name | string | The name of the subscription. |
account_id | string | The accountId |
monitor_arn_list | array | A list of cost anomaly monitors. |
subscribers | array | A list of subscriber |
threshold | number | The dollar value that triggers a notification if the threshold is exceeded. |
threshold_expression | string | An Expression object in JSON String format used to specify the anomalies that you want to generate alerts for. |
frequency | string | The frequency at which anomaly reports are sent over email. |
resource_tags | array | Tags to assign to subscription. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | MonitorArnList, Subscribers, Frequency, SubscriptionName, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all anomaly_subscriptions
in a region.
SELECT
region,
subscription_arn,
subscription_name,
account_id,
monitor_arn_list,
subscribers,
threshold,
threshold_expression,
frequency,
resource_tags
FROM aws.ce.anomaly_subscriptions
WHERE region = 'us-east-1';
Gets all properties from an individual anomaly_subscription
.
SELECT
region,
subscription_arn,
subscription_name,
account_id,
monitor_arn_list,
subscribers,
threshold,
threshold_expression,
frequency,
resource_tags
FROM aws.ce.anomaly_subscriptions
WHERE region = 'us-east-1' AND data__Identifier = '<SubscriptionArn>';
INSERT
example
Use the following StackQL query and manifest file to create a new anomaly_subscription
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.ce.anomaly_subscriptions (
SubscriptionName,
MonitorArnList,
Subscribers,
Frequency,
region
)
SELECT
'{{ SubscriptionName }}',
'{{ MonitorArnList }}',
'{{ Subscribers }}',
'{{ Frequency }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ce.anomaly_subscriptions (
SubscriptionName,
MonitorArnList,
Subscribers,
Threshold,
ThresholdExpression,
Frequency,
ResourceTags,
region
)
SELECT
'{{ SubscriptionName }}',
'{{ MonitorArnList }}',
'{{ Subscribers }}',
'{{ Threshold }}',
'{{ ThresholdExpression }}',
'{{ Frequency }}',
'{{ ResourceTags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: anomaly_subscription
props:
- name: SubscriptionName
value: '{{ SubscriptionName }}'
- name: MonitorArnList
value:
- '{{ MonitorArnList[0] }}'
- name: Subscribers
value:
- Address: '{{ Address }}'
Status: '{{ Status }}'
Type: '{{ Type }}'
- name: Threshold
value: null
- name: ThresholdExpression
value: '{{ ThresholdExpression }}'
- name: Frequency
value: '{{ Frequency }}'
- name: ResourceTags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.ce.anomaly_subscriptions
WHERE data__Identifier = '<SubscriptionArn>'
AND region = 'us-east-1';
Permissions
To operate on the anomaly_subscriptions
resource, the following permissions are required:
Create
ce:CreateAnomalySubscription,
ce:TagResource
Read
ce:GetAnomalySubscriptions
Update
ce:UpdateAnomalySubscription
Delete
ce:DeleteAnomalySubscription
List
ce:GetAnomalySubscriptions