

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::APS::AnomalyDetector
<a name="aws-resource-aps-anomalydetector"></a>

Anomaly detection uses the Random Cut Forest algorithm for time-series analysis. The anomaly detector analyzes Amazon Managed Service for Prometheus metrics to identify unusual patterns and behaviors.

## Syntax
<a name="aws-resource-aps-anomalydetector-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-aps-anomalydetector-syntax.json"></a>

```
{
  "Type" : "AWS::APS::AnomalyDetector",
  "Properties" : {
      "[Alias](#cfn-aps-anomalydetector-alias)" : String,
      "[Configuration](#cfn-aps-anomalydetector-configuration)" : AnomalyDetectorConfiguration,
      "[EvaluationIntervalInSeconds](#cfn-aps-anomalydetector-evaluationintervalinseconds)" : Integer,
      "[Labels](#cfn-aps-anomalydetector-labels)" : [ Label, ... ],
      "[MissingDataAction](#cfn-aps-anomalydetector-missingdataaction)" : MissingDataAction,
      "[Tags](#cfn-aps-anomalydetector-tags)" : [ Tag, ... ],
      "[Workspace](#cfn-aps-anomalydetector-workspace)" : String
    }
}
```

### YAML
<a name="aws-resource-aps-anomalydetector-syntax.yaml"></a>

```
Type: AWS::APS::AnomalyDetector
Properties:
  [Alias](#cfn-aps-anomalydetector-alias): String
  [Configuration](#cfn-aps-anomalydetector-configuration): 
    AnomalyDetectorConfiguration
  [EvaluationIntervalInSeconds](#cfn-aps-anomalydetector-evaluationintervalinseconds): Integer
  [Labels](#cfn-aps-anomalydetector-labels): 
    - Label
  [MissingDataAction](#cfn-aps-anomalydetector-missingdataaction): 
    MissingDataAction
  [Tags](#cfn-aps-anomalydetector-tags): 
    - Tag
  [Workspace](#cfn-aps-anomalydetector-workspace): String
```

## Properties
<a name="aws-resource-aps-anomalydetector-properties"></a>

`Alias`  <a name="cfn-aps-anomalydetector-alias"></a>
The user-friendly name of the anomaly detector.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Configuration`  <a name="cfn-aps-anomalydetector-configuration"></a>
The algorithm configuration of the anomaly detector.  
*Required*: Yes  
*Type*: [AnomalyDetectorConfiguration](aws-properties-aps-anomalydetector-anomalydetectorconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EvaluationIntervalInSeconds`  <a name="cfn-aps-anomalydetector-evaluationintervalinseconds"></a>
The frequency, in seconds, at which the anomaly detector evaluates metrics.  
*Required*: No  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Labels`  <a name="cfn-aps-anomalydetector-labels"></a>
The Amazon Managed Service for Prometheus metric labels associated with the anomaly detector.  
*Required*: No  
*Type*: Array of [Label](aws-properties-aps-anomalydetector-label.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MissingDataAction`  <a name="cfn-aps-anomalydetector-missingdataaction"></a>
The action taken when data is missing during evaluation.  
*Required*: No  
*Type*: [MissingDataAction](aws-properties-aps-anomalydetector-missingdataaction.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-aps-anomalydetector-tags"></a>
The tags applied to the anomaly detector.  
*Required*: No  
*Type*: Array of [Tag](aws-properties-aps-anomalydetector-tag.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Workspace`  <a name="cfn-aps-anomalydetector-workspace"></a>
An Amazon Managed Service for Prometheus workspace is a logical and isolated Prometheus server dedicated to ingesting, storing, and querying your Prometheus-compatible metrics.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^arn:(aws|aws-us-gov|aws-cn):aps:[a-z0-9-]+:[0-9]+:workspace/[a-zA-Z0-9-]+$`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## Return values
<a name="aws-resource-aps-anomalydetector-return-values"></a>

### Ref
<a name="aws-resource-aps-anomalydetector-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the resource name. For example:

 `{ "Ref": "Id" }` 

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-aps-anomalydetector-return-values-fn--getatt"></a>

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 [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-aps-anomalydetector-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
The Amazon Resource Name (ARN) of the anomaly detector.

# AWS::APS::AnomalyDetector AnomalyDetectorConfiguration
<a name="aws-properties-aps-anomalydetector-anomalydetectorconfiguration"></a>

The configuration for the anomaly detection algorithm.

## Syntax
<a name="aws-properties-aps-anomalydetector-anomalydetectorconfiguration-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-aps-anomalydetector-anomalydetectorconfiguration-syntax.json"></a>

```
{
  "[RandomCutForest](#cfn-aps-anomalydetector-anomalydetectorconfiguration-randomcutforest)" : RandomCutForestConfiguration
}
```

### YAML
<a name="aws-properties-aps-anomalydetector-anomalydetectorconfiguration-syntax.yaml"></a>

```
  [RandomCutForest](#cfn-aps-anomalydetector-anomalydetectorconfiguration-randomcutforest): 
    RandomCutForestConfiguration
```

## Properties
<a name="aws-properties-aps-anomalydetector-anomalydetectorconfiguration-properties"></a>

`RandomCutForest`  <a name="cfn-aps-anomalydetector-anomalydetectorconfiguration-randomcutforest"></a>
The Random Cut Forest algorithm configuration for anomaly detection.  
*Required*: Yes  
*Type*: [RandomCutForestConfiguration](aws-properties-aps-anomalydetector-randomcutforestconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::APS::AnomalyDetector IgnoreNearExpected
<a name="aws-properties-aps-anomalydetector-ignorenearexpected"></a>

Configuration for threshold settings that determine when values near expected values should be ignored during anomaly detection.

## Syntax
<a name="aws-properties-aps-anomalydetector-ignorenearexpected-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-aps-anomalydetector-ignorenearexpected-syntax.json"></a>

```
{
  "[Amount](#cfn-aps-anomalydetector-ignorenearexpected-amount)" : Number,
  "[Ratio](#cfn-aps-anomalydetector-ignorenearexpected-ratio)" : Number
}
```

### YAML
<a name="aws-properties-aps-anomalydetector-ignorenearexpected-syntax.yaml"></a>

```
  [Amount](#cfn-aps-anomalydetector-ignorenearexpected-amount): Number
  [Ratio](#cfn-aps-anomalydetector-ignorenearexpected-ratio): Number
```

## Properties
<a name="aws-properties-aps-anomalydetector-ignorenearexpected-properties"></a>

`Amount`  <a name="cfn-aps-anomalydetector-ignorenearexpected-amount"></a>
The absolute amount by which values can differ from expected values before being considered anomalous.  
*Required*: No  
*Type*: Number  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Ratio`  <a name="cfn-aps-anomalydetector-ignorenearexpected-ratio"></a>
The ratio by which values can differ from expected values before being considered anomalous.  
*Required*: No  
*Type*: Number  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::APS::AnomalyDetector Label
<a name="aws-properties-aps-anomalydetector-label"></a>

The Amazon Managed Service for Prometheus metric labels associated with the anomaly detector.

## Syntax
<a name="aws-properties-aps-anomalydetector-label-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-aps-anomalydetector-label-syntax.json"></a>

```
{
  "[Key](#cfn-aps-anomalydetector-label-key)" : String,
  "[Value](#cfn-aps-anomalydetector-label-value)" : String
}
```

### YAML
<a name="aws-properties-aps-anomalydetector-label-syntax.yaml"></a>

```
  [Key](#cfn-aps-anomalydetector-label-key): String
  [Value](#cfn-aps-anomalydetector-label-value): String
```

## Properties
<a name="aws-properties-aps-anomalydetector-label-properties"></a>

`Key`  <a name="cfn-aps-anomalydetector-label-key"></a>
The key of the label.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-aps-anomalydetector-label-value"></a>
The value for this label.  
*Required*: Yes  
*Type*: String  
*Minimum*: `0`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::APS::AnomalyDetector MissingDataAction
<a name="aws-properties-aps-anomalydetector-missingdataaction"></a>

Specifies the action to take when data is missing during anomaly detection evaluation.

## Syntax
<a name="aws-properties-aps-anomalydetector-missingdataaction-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-aps-anomalydetector-missingdataaction-syntax.json"></a>

```
{
  "[MarkAsAnomaly](#cfn-aps-anomalydetector-missingdataaction-markasanomaly)" : Boolean,
  "[Skip](#cfn-aps-anomalydetector-missingdataaction-skip)" : Boolean
}
```

### YAML
<a name="aws-properties-aps-anomalydetector-missingdataaction-syntax.yaml"></a>

```
  [MarkAsAnomaly](#cfn-aps-anomalydetector-missingdataaction-markasanomaly): Boolean
  [Skip](#cfn-aps-anomalydetector-missingdataaction-skip): Boolean
```

## Properties
<a name="aws-properties-aps-anomalydetector-missingdataaction-properties"></a>

`MarkAsAnomaly`  <a name="cfn-aps-anomalydetector-missingdataaction-markasanomaly"></a>
Marks missing data points as anomalies.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Skip`  <a name="cfn-aps-anomalydetector-missingdataaction-skip"></a>
Skips evaluation when data is missing.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::APS::AnomalyDetector RandomCutForestConfiguration
<a name="aws-properties-aps-anomalydetector-randomcutforestconfiguration"></a>

Configuration for the Random Cut Forest algorithm used for anomaly detection in time-series data.

## Syntax
<a name="aws-properties-aps-anomalydetector-randomcutforestconfiguration-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-aps-anomalydetector-randomcutforestconfiguration-syntax.json"></a>

```
{
  "[IgnoreNearExpectedFromAbove](#cfn-aps-anomalydetector-randomcutforestconfiguration-ignorenearexpectedfromabove)" : IgnoreNearExpected,
  "[IgnoreNearExpectedFromBelow](#cfn-aps-anomalydetector-randomcutforestconfiguration-ignorenearexpectedfrombelow)" : IgnoreNearExpected,
  "[Query](#cfn-aps-anomalydetector-randomcutforestconfiguration-query)" : String,
  "[SampleSize](#cfn-aps-anomalydetector-randomcutforestconfiguration-samplesize)" : Integer,
  "[ShingleSize](#cfn-aps-anomalydetector-randomcutforestconfiguration-shinglesize)" : Integer
}
```

### YAML
<a name="aws-properties-aps-anomalydetector-randomcutforestconfiguration-syntax.yaml"></a>

```
  [IgnoreNearExpectedFromAbove](#cfn-aps-anomalydetector-randomcutforestconfiguration-ignorenearexpectedfromabove): 
    IgnoreNearExpected
  [IgnoreNearExpectedFromBelow](#cfn-aps-anomalydetector-randomcutforestconfiguration-ignorenearexpectedfrombelow): 
    IgnoreNearExpected
  [Query](#cfn-aps-anomalydetector-randomcutforestconfiguration-query): String
  [SampleSize](#cfn-aps-anomalydetector-randomcutforestconfiguration-samplesize): Integer
  [ShingleSize](#cfn-aps-anomalydetector-randomcutforestconfiguration-shinglesize): Integer
```

## Properties
<a name="aws-properties-aps-anomalydetector-randomcutforestconfiguration-properties"></a>

`IgnoreNearExpectedFromAbove`  <a name="cfn-aps-anomalydetector-randomcutforestconfiguration-ignorenearexpectedfromabove"></a>
Configuration for ignoring values that are near expected values from above during anomaly detection.  
*Required*: No  
*Type*: [IgnoreNearExpected](aws-properties-aps-anomalydetector-ignorenearexpected.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`IgnoreNearExpectedFromBelow`  <a name="cfn-aps-anomalydetector-randomcutforestconfiguration-ignorenearexpectedfrombelow"></a>
Configuration for ignoring values that are near expected values from below during anomaly detection.  
*Required*: No  
*Type*: [IgnoreNearExpected](aws-properties-aps-anomalydetector-ignorenearexpected.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Query`  <a name="cfn-aps-anomalydetector-randomcutforestconfiguration-query"></a>
The Prometheus query used to retrieve the time-series data for anomaly detection.  
Random Cut Forest queries must be wrapped by a supported PromQL aggregation operator. For more information, see [Aggregation operators](https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators) on the *Prometheus docs* website.  
**Supported PromQL aggregation operators**: `avg`, `count`, `group`, `max`, `min`, `quantile`, `stddev`, `stdvar`, and `sum`.
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SampleSize`  <a name="cfn-aps-anomalydetector-randomcutforestconfiguration-samplesize"></a>
The number of data points sampled from the input stream for the Random Cut Forest algorithm. The default number is 256 consecutive data points.  
*Required*: No  
*Type*: Integer  
*Minimum*: `256`  
*Maximum*: `1024`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ShingleSize`  <a name="cfn-aps-anomalydetector-randomcutforestconfiguration-shinglesize"></a>
The number of consecutive data points used to create a shingle for the Random Cut Forest algorithm. The default number is 8 consecutive data points.  
*Required*: No  
*Type*: Integer  
*Minimum*: `2`  
*Maximum*: `1024`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::APS::AnomalyDetector Tag
<a name="aws-properties-aps-anomalydetector-tag"></a>

A tag associated with a resource.

## Syntax
<a name="aws-properties-aps-anomalydetector-tag-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-aps-anomalydetector-tag-syntax.json"></a>

```
{
  "[Key](#cfn-aps-anomalydetector-tag-key)" : String,
  "[Value](#cfn-aps-anomalydetector-tag-value)" : String
}
```

### YAML
<a name="aws-properties-aps-anomalydetector-tag-syntax.yaml"></a>

```
  [Key](#cfn-aps-anomalydetector-tag-key): String
  [Value](#cfn-aps-anomalydetector-tag-value): String
```

## Properties
<a name="aws-properties-aps-anomalydetector-tag-properties"></a>

`Key`  <a name="cfn-aps-anomalydetector-tag-key"></a>
The key of the tag. Must not begin with `aws:`.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-aps-anomalydetector-tag-value"></a>
The value of the tag.  
*Required*: Yes  
*Type*: String  
*Minimum*: `0`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)