Skip to content

aws.ce.get_anomaly_subscriptions

Example SQL Queries

SELECT * FROM
aws.ce.get_anomaly_subscriptions;

Description

Retrieves the cost anomaly subscription objects for your account. You can filter using a list of cost anomaly monitor Amazon Resource Names (ARNs).

Table Definition

Column NameColumn Data Type
max_results Input Column

The number of entries a paginated response contains.

BIGINT
monitor_arn Input Column

Cost anomaly monitor ARNs.

VARCHAR
next_page_token Input Column

The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

VARCHAR
subscription_arn_list Input Column

A list of cost anomaly subscription ARNs.

VARCHAR[]
Show child fields
subscription_arn_list[]
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

anomaly_subscriptions

A list of cost anomaly subscriptions that includes the detailed metadata for each one.

STRUCT(
"subscription_arn" VARCHAR,
"account_id" VARCHAR,
"monitor_arn_list" VARCHAR[],
"subscribers" STRUCT(
"address" VARCHAR,
"type" VARCHAR,
"status" VARCHAR
)[],
"threshold" DOUBLE,
"frequency" VARCHAR,
"subscription_name" VARCHAR,
"threshold_expression" STRUCT(
"dimensions" STRUCT(
"key" VARCHAR,
"values" VARCHAR[],
"match_options" VARCHAR[]
),
"tags" STRUCT(
"key" VARCHAR,
"values" VARCHAR[],
"match_options" VARCHAR[]
),
"cost_categories" STRUCT(
"key" VARCHAR,
"values" VARCHAR[],
"match_options" VARCHAR[]
)
)
)[]
Show child fields
anomaly_subscriptions[]
Show child fields
anomaly_subscriptions[].account_id

Your unique account identifier.

anomaly_subscriptions[].frequency

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.

anomaly_subscriptions[].monitor_arn_list[]
anomaly_subscriptions[].subscribers[]
Show child fields
anomaly_subscriptions[].subscribers[].address

The email address or SNS Amazon Resource Name (ARN). This depends on the Type.

anomaly_subscriptions[].subscribers[].status

Indicates if the subscriber accepts the notifications.

anomaly_subscriptions[].subscribers[].type

The notification delivery channel.

anomaly_subscriptions[].subscription_arn

The AnomalySubscription Amazon Resource Name (ARN).

anomaly_subscriptions[].subscription_name

The name for the subscription.

anomaly_subscriptions[].threshold

(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 this resource. You cannot specify both.

anomaly_subscriptions[].threshold_expression

An Expression object used to specify the anomalies that you want to generate alerts for. This supports dimensions and nested expressions. The supported dimensions are ANOMALY_TOTAL_IMPACT_ABSOLUTE and ANOMALY_TOTAL_IMPACT_PERCENTAGE, corresponding to an anomaly’s TotalImpact and TotalImpactPercentage, respectively (see Impact for more details). The supported nested expression types are AND and OR. The match option GREATER_THAN_OR_EQUAL is required. Values must be numbers between 0 and 10,000,000,000 in string format.

One of Threshold or ThresholdExpression is required for this resource. You cannot specify both.

The following are examples of valid ThresholdExpressions:

  • Absolute threshold: { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }

  • Percentage threshold: { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }

  • AND two thresholds together: { "And": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }

  • OR two thresholds together: { "Or": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }

Show child fields
anomaly_subscriptions[].threshold_expression.cost_categories

The filter that's based on CostCategory values.

Show child fields
anomaly_subscriptions[].threshold_expression.cost_categories.key

The unique name of the Cost Category.

anomaly_subscriptions[].threshold_expression.cost_categories.match_options[]
anomaly_subscriptions[].threshold_expression.cost_categories.values[]
anomaly_subscriptions[].threshold_expression.dimensions

The specific Dimension to use for Expression.

Show child fields
anomaly_subscriptions[].threshold_expression.dimensions.key

The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

Not all dimensions are supported in each API. Refer to the documentation for each specific API to see what is supported.

LINK_ACCOUNT_NAME and SERVICE_CODE can only be used in CostCategoryRule.

ANOMALY_TOTAL_IMPACT_ABSOLUTE and ANOMALY_TOTAL_IMPACT_PERCENTAGE can only be used in AnomalySubscriptions.

anomaly_subscriptions[].threshold_expression.dimensions.match_options[]
anomaly_subscriptions[].threshold_expression.dimensions.values[]
anomaly_subscriptions[].threshold_expression.tags

The specific Tag to use for Expression.

Show child fields
anomaly_subscriptions[].threshold_expression.tags.key

The key for the tag.

anomaly_subscriptions[].threshold_expression.tags.match_options[]
anomaly_subscriptions[].threshold_expression.tags.values[]