# CfnAnomalySubscriptionProps

Properties for defining a `CfnAnomalySubscription`.

Used as props by: [CfnAnomalySubscription](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ce.CfnAnomalySubscription.html)

- Source: Generated at build time
- Type last changed: v2.227.0 · 21 Nov 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ce as ce } from 'aws-cdk-lib';
const cfnAnomalySubscriptionProps: ce.CfnAnomalySubscriptionProps = {
  frequency: 'frequency',
  monitorArnList: ['monitorArnList'],
  subscribers: [{
    address: 'address',
    type: 'type',

    // the properties below are optional
    status: 'status',
  }],
  subscriptionName: 'subscriptionName',

  // the properties below are optional
  resourceTags: [{
    key: 'key',
    value: 'value',
  }],
  threshold: 123,
  thresholdExpression: 'thresholdExpression',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ce as ce

cfn_anomaly_subscription_props = ce.CfnAnomalySubscriptionProps(
    frequency="frequency",
    monitor_arn_list=["monitorArnList"],
    subscribers=[ce.CfnAnomalySubscription.SubscriberProperty(
        address="address",
        type="type",

        # the properties below are optional
        status="status"
    )],
    subscription_name="subscriptionName",

    # the properties below are optional
    resource_tags=[ce.CfnAnomalySubscription.ResourceTagProperty(
        key="key",
        value="value"
    )],
    threshold=123,
    threshold_expression="thresholdExpression"
)
```

Java:

```java
// 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.*;

CfnAnomalySubscriptionProps cfnAnomalySubscriptionProps = CfnAnomalySubscriptionProps.builder()
        .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();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CE;

var cfnAnomalySubscriptionProps = new CfnAnomalySubscriptionProps {
    Frequency = "frequency",
    MonitorArnList = new [] { "monitorArnList" },
    Subscribers = new [] { new SubscriberProperty {
        Address = "address",
        Type = "type",

        // the properties below are optional
        Status = "status"
    } },
    SubscriptionName = "subscriptionName",

    // the properties below are optional
    ResourceTags = new [] { new ResourceTagProperty {
        Key = "key",
        Value = "value"
    } },
    Threshold = 123,
    ThresholdExpression = "thresholdExpression"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnAnomalySubscriptionProps := &CfnAnomalySubscriptionProps{
	Frequency: jsii.String("frequency"),
	MonitorArnList: []interface{}{
		jsii.String("monitorArnList"),
	},
	Subscribers: []interface{}{
		&SubscriberProperty{
			Address: jsii.String("address"),
			Type: jsii.String("type"),

			// the properties below are optional
			Status: jsii.String("status"),
		},
	},
	SubscriptionName: jsii.String("subscriptionName"),

	// the properties below are optional
	ResourceTags: []ResourceTagProperty{
		&ResourceTagProperty{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	Threshold: jsii.Number(123),
	ThresholdExpression: jsii.String("thresholdExpression"),
}
```

## Properties

- `frequency`: string (required) — 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](https://docs.aws.amazon.com/cost-management/latest/userguide/ad-SNS.html) .

- `monitorArnList`: string | [IAnomalyMonitorRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ce.IAnomalyMonitorRef.html)[] (required) — A list of cost anomaly monitors.

- `resourceTags`: [CfnAnomalySubscription.ResourceTagProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ce.CfnAnomalySubscription.ResourceTagProperty.html)[] — Tags to assign to subscription.

- `subscribers`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnAnomalySubscription.SubscriberProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ce.CfnAnomalySubscription.SubscriberProperty.html)[] (required) — A list of subscribers to notify.

- `subscriptionName`: string (required) — The name for the subscription.

- `threshold`: number — (deprecated).

  An absolute dollar value that must be exceeded by the anomaly's total impact (see [Impact](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Impact.html) 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.

- `thresholdExpression`: string — 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. 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](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Impact.html) 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 `AWS::CE::AnomalySubscription` . You cannot specify both.

  For further information, see the [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ce-anomalysubscription.html#aws-resource-ce-anomalysubscription--examples) section of this page.
