@renovosolutions/cdk-library-cloudwatch-alarms
Version:
AWS CDK Construct Library to automatically create CloudWatch Alarms for resources in a CDK app based on resource type.
1,146 lines (707 loc) • 5 MB
Markdown
# API Reference <a name="API Reference" id="api-reference"></a>
## Constructs <a name="Constructs" id="Constructs"></a>
### ApiGatewayRestApi4XXErrorAlarm <a name="ApiGatewayRestApi4XXErrorAlarm" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm"></a>
This alarm detects a high number of client-side errors.
This can indicate an issue in the authorization or client request parameters. It could also mean that a resource was
removed or a client is requesting one that doesn't exist. Consider enabling CloudWatch Logs and checking for any errors
that may be causing the 4XX errors. Moreover, consider enabling detailed CloudWatch metrics to view this metric per
resource and method and narrow down the source of the errors. Errors could also be caused by exceeding the configured
throttling limit.
The alarm is triggered when number of client-errors exceeds the threshold.
#### Initializers <a name="Initializers" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.Initializer"></a>
```typescript
import { ApiGatewayRestApi4XXErrorAlarm } from '@renovosolutions/cdk-library-cloudwatch-alarms'
new ApiGatewayRestApi4XXErrorAlarm(scope: IConstruct, id: string, props: ApiGatewayRestApi4XXErrorAlarmProps)
```
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.Initializer.parameter.scope">scope</a></code> | <code>constructs.IConstruct</code> | *No description.* |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.Initializer.parameter.props">props</a></code> | <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarmProps">ApiGatewayRestApi4XXErrorAlarmProps</a></code> | *No description.* |
---
##### `scope`<sup>Required</sup> <a name="scope" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.Initializer.parameter.scope"></a>
- *Type:* constructs.IConstruct
---
##### `id`<sup>Required</sup> <a name="id" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.Initializer.parameter.id"></a>
- *Type:* string
---
##### `props`<sup>Required</sup> <a name="props" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.Initializer.parameter.props"></a>
- *Type:* <a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarmProps">ApiGatewayRestApi4XXErrorAlarmProps</a>
---
#### Methods <a name="Methods" id="Methods"></a>
| **Name** | **Description** |
| --- | --- |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.toString">toString</a></code> | Returns a string representation of this construct. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.with">with</a></code> | Applies one or more mixins to this construct. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.applyRemovalPolicy">applyRemovalPolicy</a></code> | Apply the given removal policy to this resource. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.addAlarmAction">addAlarmAction</a></code> | Trigger this action if the alarm fires. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.addInsufficientDataAction">addInsufficientDataAction</a></code> | Trigger this action if there is insufficient data to evaluate the alarm. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.addOkAction">addOkAction</a></code> | Trigger this action if the alarm returns from breaching state into ok state. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.renderAlarmRule">renderAlarmRule</a></code> | AlarmRule indicating ALARM state for Alarm. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.toAnnotation">toAnnotation</a></code> | Turn this alarm into a horizontal annotation. |
---
##### `toString` <a name="toString" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.toString"></a>
```typescript
public toString(): string
```
Returns a string representation of this construct.
##### `with` <a name="with" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.with"></a>
```typescript
public with(mixins: ...IMixin[]): IConstruct
```
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple `with()` calls if subsequent mixins should apply to added
constructs.
###### `mixins`<sup>Required</sup> <a name="mixins" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.with.parameter.mixins"></a>
- *Type:* ...constructs.IMixin[]
---
##### `applyRemovalPolicy` <a name="applyRemovalPolicy" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.applyRemovalPolicy"></a>
```typescript
public applyRemovalPolicy(policy: RemovalPolicy): void
```
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
###### `policy`<sup>Required</sup> <a name="policy" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.applyRemovalPolicy.parameter.policy"></a>
- *Type:* aws-cdk-lib.RemovalPolicy
---
##### `addAlarmAction` <a name="addAlarmAction" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.addAlarmAction"></a>
```typescript
public addAlarmAction(actions: ...IAlarmAction[]): void
```
Trigger this action if the alarm fires.
Typically SnsAction or AutoScalingAction.
###### `actions`<sup>Required</sup> <a name="actions" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.addAlarmAction.parameter.actions"></a>
- *Type:* ...aws-cdk-lib.aws_cloudwatch.IAlarmAction[]
---
##### `addInsufficientDataAction` <a name="addInsufficientDataAction" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.addInsufficientDataAction"></a>
```typescript
public addInsufficientDataAction(actions: ...IAlarmAction[]): void
```
Trigger this action if there is insufficient data to evaluate the alarm.
Typically SnsAction or AutoScalingAction.
###### `actions`<sup>Required</sup> <a name="actions" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.addInsufficientDataAction.parameter.actions"></a>
- *Type:* ...aws-cdk-lib.aws_cloudwatch.IAlarmAction[]
---
##### `addOkAction` <a name="addOkAction" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.addOkAction"></a>
```typescript
public addOkAction(actions: ...IAlarmAction[]): void
```
Trigger this action if the alarm returns from breaching state into ok state.
Typically SnsAction or AutoScalingAction.
###### `actions`<sup>Required</sup> <a name="actions" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.addOkAction.parameter.actions"></a>
- *Type:* ...aws-cdk-lib.aws_cloudwatch.IAlarmAction[]
---
##### `renderAlarmRule` <a name="renderAlarmRule" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.renderAlarmRule"></a>
```typescript
public renderAlarmRule(): string
```
AlarmRule indicating ALARM state for Alarm.
##### `toAnnotation` <a name="toAnnotation" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.toAnnotation"></a>
```typescript
public toAnnotation(): HorizontalAnnotation
```
Turn this alarm into a horizontal annotation.
This is useful if you want to represent an Alarm in a non-AlarmWidget.
An `AlarmWidget` can directly show an alarm, but it can only show a
single alarm and no other metrics. Instead, you can convert the alarm to
a HorizontalAnnotation and add it as an annotation to another graph.
This might be useful if:
- You want to show multiple alarms inside a single graph, for example if
you have both a "small margin/long period" alarm as well as a
"large margin/short period" alarm.
- You want to show an Alarm line in a graph with multiple metrics in it.
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
| **Name** | **Description** |
| --- | --- |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.isOwnedResource">isOwnedResource</a></code> | Returns true if the construct was created by CDK, and false otherwise. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.isResource">isResource</a></code> | Check whether the given construct is a Resource. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.fromAlarmArn">fromAlarmArn</a></code> | Import an existing CloudWatch alarm provided an ARN. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.fromAlarmName">fromAlarmName</a></code> | Import an existing CloudWatch alarm provided an Name. |
---
##### `isConstruct` <a name="isConstruct" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.isConstruct"></a>
```typescript
import { ApiGatewayRestApi4XXErrorAlarm } from '@renovosolutions/cdk-library-cloudwatch-alarms'
ApiGatewayRestApi4XXErrorAlarm.isConstruct(x: any)
```
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct`
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on
disk are seen as independent, completely different libraries. As a
consequence, the class `Construct` in each copy of the `constructs` library
is seen as a different class, and an instance of one class will not test as
`instanceof` the other class. `npm install` will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the `constructs`
library can be accidentally installed, and `instanceof` will behave
unpredictably. It is safest to avoid using `instanceof`, and using
this type-testing method instead.
###### `x`<sup>Required</sup> <a name="x" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.isConstruct.parameter.x"></a>
- *Type:* any
Any object.
---
##### `isOwnedResource` <a name="isOwnedResource" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.isOwnedResource"></a>
```typescript
import { ApiGatewayRestApi4XXErrorAlarm } from '@renovosolutions/cdk-library-cloudwatch-alarms'
ApiGatewayRestApi4XXErrorAlarm.isOwnedResource(construct: IConstruct)
```
Returns true if the construct was created by CDK, and false otherwise.
###### `construct`<sup>Required</sup> <a name="construct" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.isOwnedResource.parameter.construct"></a>
- *Type:* constructs.IConstruct
---
##### `isResource` <a name="isResource" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.isResource"></a>
```typescript
import { ApiGatewayRestApi4XXErrorAlarm } from '@renovosolutions/cdk-library-cloudwatch-alarms'
ApiGatewayRestApi4XXErrorAlarm.isResource(construct: IConstruct)
```
Check whether the given construct is a Resource.
###### `construct`<sup>Required</sup> <a name="construct" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.isResource.parameter.construct"></a>
- *Type:* constructs.IConstruct
---
##### `fromAlarmArn` <a name="fromAlarmArn" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.fromAlarmArn"></a>
```typescript
import { ApiGatewayRestApi4XXErrorAlarm } from '@renovosolutions/cdk-library-cloudwatch-alarms'
ApiGatewayRestApi4XXErrorAlarm.fromAlarmArn(scope: Construct, id: string, alarmArn: string)
```
Import an existing CloudWatch alarm provided an ARN.
###### `scope`<sup>Required</sup> <a name="scope" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.fromAlarmArn.parameter.scope"></a>
- *Type:* constructs.Construct
The parent creating construct (usually `this`).
---
###### `id`<sup>Required</sup> <a name="id" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.fromAlarmArn.parameter.id"></a>
- *Type:* string
The construct's name.
---
###### `alarmArn`<sup>Required</sup> <a name="alarmArn" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.fromAlarmArn.parameter.alarmArn"></a>
- *Type:* string
Alarm ARN (i.e. arn:aws:cloudwatch:<region>:<account-id>:alarm:Foo).
---
##### `fromAlarmName` <a name="fromAlarmName" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.fromAlarmName"></a>
```typescript
import { ApiGatewayRestApi4XXErrorAlarm } from '@renovosolutions/cdk-library-cloudwatch-alarms'
ApiGatewayRestApi4XXErrorAlarm.fromAlarmName(scope: Construct, id: string, alarmName: string)
```
Import an existing CloudWatch alarm provided an Name.
###### `scope`<sup>Required</sup> <a name="scope" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.fromAlarmName.parameter.scope"></a>
- *Type:* constructs.Construct
The parent creating construct (usually `this`).
---
###### `id`<sup>Required</sup> <a name="id" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.fromAlarmName.parameter.id"></a>
- *Type:* string
The construct's name.
---
###### `alarmName`<sup>Required</sup> <a name="alarmName" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.fromAlarmName.parameter.alarmName"></a>
- *Type:* string
Alarm Name.
---
#### Properties <a name="Properties" id="Properties"></a>
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.env">env</a></code> | <code>aws-cdk-lib.interfaces.ResourceEnvironment</code> | The environment this resource belongs to. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.stack">stack</a></code> | <code>aws-cdk-lib.Stack</code> | The stack in which this resource is defined. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.alarmArn">alarmArn</a></code> | <code>string</code> | ARN of this alarm. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.alarmName">alarmName</a></code> | <code>string</code> | Name of this alarm. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.alarmRef">alarmRef</a></code> | <code>aws-cdk-lib.interfaces.aws_cloudwatch.AlarmReference</code> | A reference to a Alarm resource. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.metric">metric</a></code> | <code>aws-cdk-lib.aws_cloudwatch.IMetric</code> | The metric object this alarm was based on. |
---
##### `node`<sup>Required</sup> <a name="node" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.node"></a>
```typescript
public readonly node: Node;
```
- *Type:* constructs.Node
The tree node.
---
##### `env`<sup>Required</sup> <a name="env" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.env"></a>
```typescript
public readonly env: ResourceEnvironment;
```
- *Type:* aws-cdk-lib.interfaces.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like `new Role()`, `new Bucket()`, etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
`Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
different than the stack they were imported into.
---
##### `stack`<sup>Required</sup> <a name="stack" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.stack"></a>
```typescript
public readonly stack: Stack;
```
- *Type:* aws-cdk-lib.Stack
The stack in which this resource is defined.
---
##### `alarmArn`<sup>Required</sup> <a name="alarmArn" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.alarmArn"></a>
```typescript
public readonly alarmArn: string;
```
- *Type:* string
ARN of this alarm.
---
##### `alarmName`<sup>Required</sup> <a name="alarmName" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.alarmName"></a>
```typescript
public readonly alarmName: string;
```
- *Type:* string
Name of this alarm.
---
##### `alarmRef`<sup>Required</sup> <a name="alarmRef" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.alarmRef"></a>
```typescript
public readonly alarmRef: AlarmReference;
```
- *Type:* aws-cdk-lib.interfaces.aws_cloudwatch.AlarmReference
A reference to a Alarm resource.
---
##### `metric`<sup>Required</sup> <a name="metric" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.metric"></a>
```typescript
public readonly metric: IMetric;
```
- *Type:* aws-cdk-lib.aws_cloudwatch.IMetric
The metric object this alarm was based on.
---
#### Constants <a name="Constants" id="Constants"></a>
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.ANOMALY_DETECTION_NO_THRESHOLD">ANOMALY_DETECTION_NO_THRESHOLD</a></code> | <code>number</code> | Conventional value for the threshold property when creating anomaly detection alarms. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.PROPERTY_INJECTION_ID">PROPERTY_INJECTION_ID</a></code> | <code>string</code> | Uniquely identifies this class. |
---
##### `ANOMALY_DETECTION_NO_THRESHOLD`<sup>Required</sup> <a name="ANOMALY_DETECTION_NO_THRESHOLD" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.ANOMALY_DETECTION_NO_THRESHOLD"></a>
```typescript
public readonly ANOMALY_DETECTION_NO_THRESHOLD: number;
```
- *Type:* number
Conventional value for the threshold property when creating anomaly detection alarms.
Anomaly detection alarms don't have numbered threshold. Instead, they have a dynamically
calculated threshold based on the metric math expression that contains a metric expression.
The `threshold` property is required, but the value is ignored. This
constant has the value 0, and has a symbolic name to indicate why the
threshold is 0. You can use `new AnomalyDetectionAlarm()` to avoid having to pass
the `threshold` property at all.
---
##### `PROPERTY_INJECTION_ID`<sup>Required</sup> <a name="PROPERTY_INJECTION_ID" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi4XXErrorAlarm.property.PROPERTY_INJECTION_ID"></a>
```typescript
public readonly PROPERTY_INJECTION_ID: string;
```
- *Type:* string
Uniquely identifies this class.
---
### ApiGatewayRestApi5XXErrorAlarm <a name="ApiGatewayRestApi5XXErrorAlarm" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm"></a>
This alarm detects a high number of server-side errors.
This can indicate that there is something wrong on the API backend, the network,
or the integration between the API gateway and the backend API.
The alarm is triggered when number of server-errors exceeds the threshold.
#### Initializers <a name="Initializers" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.Initializer"></a>
```typescript
import { ApiGatewayRestApi5XXErrorAlarm } from '@renovosolutions/cdk-library-cloudwatch-alarms'
new ApiGatewayRestApi5XXErrorAlarm(scope: IConstruct, id: string, props: ApiGatewayRestApi5XXErrorAlarmProps)
```
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.Initializer.parameter.scope">scope</a></code> | <code>constructs.IConstruct</code> | *No description.* |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.Initializer.parameter.props">props</a></code> | <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarmProps">ApiGatewayRestApi5XXErrorAlarmProps</a></code> | *No description.* |
---
##### `scope`<sup>Required</sup> <a name="scope" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.Initializer.parameter.scope"></a>
- *Type:* constructs.IConstruct
---
##### `id`<sup>Required</sup> <a name="id" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.Initializer.parameter.id"></a>
- *Type:* string
---
##### `props`<sup>Required</sup> <a name="props" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.Initializer.parameter.props"></a>
- *Type:* <a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarmProps">ApiGatewayRestApi5XXErrorAlarmProps</a>
---
#### Methods <a name="Methods" id="Methods"></a>
| **Name** | **Description** |
| --- | --- |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.toString">toString</a></code> | Returns a string representation of this construct. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.with">with</a></code> | Applies one or more mixins to this construct. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.applyRemovalPolicy">applyRemovalPolicy</a></code> | Apply the given removal policy to this resource. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.addAlarmAction">addAlarmAction</a></code> | Trigger this action if the alarm fires. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.addInsufficientDataAction">addInsufficientDataAction</a></code> | Trigger this action if there is insufficient data to evaluate the alarm. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.addOkAction">addOkAction</a></code> | Trigger this action if the alarm returns from breaching state into ok state. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.renderAlarmRule">renderAlarmRule</a></code> | AlarmRule indicating ALARM state for Alarm. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.toAnnotation">toAnnotation</a></code> | Turn this alarm into a horizontal annotation. |
---
##### `toString` <a name="toString" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.toString"></a>
```typescript
public toString(): string
```
Returns a string representation of this construct.
##### `with` <a name="with" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.with"></a>
```typescript
public with(mixins: ...IMixin[]): IConstruct
```
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple `with()` calls if subsequent mixins should apply to added
constructs.
###### `mixins`<sup>Required</sup> <a name="mixins" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.with.parameter.mixins"></a>
- *Type:* ...constructs.IMixin[]
---
##### `applyRemovalPolicy` <a name="applyRemovalPolicy" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.applyRemovalPolicy"></a>
```typescript
public applyRemovalPolicy(policy: RemovalPolicy): void
```
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
###### `policy`<sup>Required</sup> <a name="policy" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.applyRemovalPolicy.parameter.policy"></a>
- *Type:* aws-cdk-lib.RemovalPolicy
---
##### `addAlarmAction` <a name="addAlarmAction" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.addAlarmAction"></a>
```typescript
public addAlarmAction(actions: ...IAlarmAction[]): void
```
Trigger this action if the alarm fires.
Typically SnsAction or AutoScalingAction.
###### `actions`<sup>Required</sup> <a name="actions" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.addAlarmAction.parameter.actions"></a>
- *Type:* ...aws-cdk-lib.aws_cloudwatch.IAlarmAction[]
---
##### `addInsufficientDataAction` <a name="addInsufficientDataAction" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.addInsufficientDataAction"></a>
```typescript
public addInsufficientDataAction(actions: ...IAlarmAction[]): void
```
Trigger this action if there is insufficient data to evaluate the alarm.
Typically SnsAction or AutoScalingAction.
###### `actions`<sup>Required</sup> <a name="actions" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.addInsufficientDataAction.parameter.actions"></a>
- *Type:* ...aws-cdk-lib.aws_cloudwatch.IAlarmAction[]
---
##### `addOkAction` <a name="addOkAction" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.addOkAction"></a>
```typescript
public addOkAction(actions: ...IAlarmAction[]): void
```
Trigger this action if the alarm returns from breaching state into ok state.
Typically SnsAction or AutoScalingAction.
###### `actions`<sup>Required</sup> <a name="actions" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.addOkAction.parameter.actions"></a>
- *Type:* ...aws-cdk-lib.aws_cloudwatch.IAlarmAction[]
---
##### `renderAlarmRule` <a name="renderAlarmRule" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.renderAlarmRule"></a>
```typescript
public renderAlarmRule(): string
```
AlarmRule indicating ALARM state for Alarm.
##### `toAnnotation` <a name="toAnnotation" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.toAnnotation"></a>
```typescript
public toAnnotation(): HorizontalAnnotation
```
Turn this alarm into a horizontal annotation.
This is useful if you want to represent an Alarm in a non-AlarmWidget.
An `AlarmWidget` can directly show an alarm, but it can only show a
single alarm and no other metrics. Instead, you can convert the alarm to
a HorizontalAnnotation and add it as an annotation to another graph.
This might be useful if:
- You want to show multiple alarms inside a single graph, for example if
you have both a "small margin/long period" alarm as well as a
"large margin/short period" alarm.
- You want to show an Alarm line in a graph with multiple metrics in it.
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
| **Name** | **Description** |
| --- | --- |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.isOwnedResource">isOwnedResource</a></code> | Returns true if the construct was created by CDK, and false otherwise. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.isResource">isResource</a></code> | Check whether the given construct is a Resource. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.fromAlarmArn">fromAlarmArn</a></code> | Import an existing CloudWatch alarm provided an ARN. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.fromAlarmName">fromAlarmName</a></code> | Import an existing CloudWatch alarm provided an Name. |
---
##### `isConstruct` <a name="isConstruct" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.isConstruct"></a>
```typescript
import { ApiGatewayRestApi5XXErrorAlarm } from '@renovosolutions/cdk-library-cloudwatch-alarms'
ApiGatewayRestApi5XXErrorAlarm.isConstruct(x: any)
```
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct`
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on
disk are seen as independent, completely different libraries. As a
consequence, the class `Construct` in each copy of the `constructs` library
is seen as a different class, and an instance of one class will not test as
`instanceof` the other class. `npm install` will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the `constructs`
library can be accidentally installed, and `instanceof` will behave
unpredictably. It is safest to avoid using `instanceof`, and using
this type-testing method instead.
###### `x`<sup>Required</sup> <a name="x" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.isConstruct.parameter.x"></a>
- *Type:* any
Any object.
---
##### `isOwnedResource` <a name="isOwnedResource" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.isOwnedResource"></a>
```typescript
import { ApiGatewayRestApi5XXErrorAlarm } from '@renovosolutions/cdk-library-cloudwatch-alarms'
ApiGatewayRestApi5XXErrorAlarm.isOwnedResource(construct: IConstruct)
```
Returns true if the construct was created by CDK, and false otherwise.
###### `construct`<sup>Required</sup> <a name="construct" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.isOwnedResource.parameter.construct"></a>
- *Type:* constructs.IConstruct
---
##### `isResource` <a name="isResource" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.isResource"></a>
```typescript
import { ApiGatewayRestApi5XXErrorAlarm } from '@renovosolutions/cdk-library-cloudwatch-alarms'
ApiGatewayRestApi5XXErrorAlarm.isResource(construct: IConstruct)
```
Check whether the given construct is a Resource.
###### `construct`<sup>Required</sup> <a name="construct" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.isResource.parameter.construct"></a>
- *Type:* constructs.IConstruct
---
##### `fromAlarmArn` <a name="fromAlarmArn" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.fromAlarmArn"></a>
```typescript
import { ApiGatewayRestApi5XXErrorAlarm } from '@renovosolutions/cdk-library-cloudwatch-alarms'
ApiGatewayRestApi5XXErrorAlarm.fromAlarmArn(scope: Construct, id: string, alarmArn: string)
```
Import an existing CloudWatch alarm provided an ARN.
###### `scope`<sup>Required</sup> <a name="scope" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.fromAlarmArn.parameter.scope"></a>
- *Type:* constructs.Construct
The parent creating construct (usually `this`).
---
###### `id`<sup>Required</sup> <a name="id" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.fromAlarmArn.parameter.id"></a>
- *Type:* string
The construct's name.
---
###### `alarmArn`<sup>Required</sup> <a name="alarmArn" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.fromAlarmArn.parameter.alarmArn"></a>
- *Type:* string
Alarm ARN (i.e. arn:aws:cloudwatch:<region>:<account-id>:alarm:Foo).
---
##### `fromAlarmName` <a name="fromAlarmName" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.fromAlarmName"></a>
```typescript
import { ApiGatewayRestApi5XXErrorAlarm } from '@renovosolutions/cdk-library-cloudwatch-alarms'
ApiGatewayRestApi5XXErrorAlarm.fromAlarmName(scope: Construct, id: string, alarmName: string)
```
Import an existing CloudWatch alarm provided an Name.
###### `scope`<sup>Required</sup> <a name="scope" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.fromAlarmName.parameter.scope"></a>
- *Type:* constructs.Construct
The parent creating construct (usually `this`).
---
###### `id`<sup>Required</sup> <a name="id" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.fromAlarmName.parameter.id"></a>
- *Type:* string
The construct's name.
---
###### `alarmName`<sup>Required</sup> <a name="alarmName" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.fromAlarmName.parameter.alarmName"></a>
- *Type:* string
Alarm Name.
---
#### Properties <a name="Properties" id="Properties"></a>
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.env">env</a></code> | <code>aws-cdk-lib.interfaces.ResourceEnvironment</code> | The environment this resource belongs to. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.stack">stack</a></code> | <code>aws-cdk-lib.Stack</code> | The stack in which this resource is defined. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.alarmArn">alarmArn</a></code> | <code>string</code> | ARN of this alarm. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.alarmName">alarmName</a></code> | <code>string</code> | Name of this alarm. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.alarmRef">alarmRef</a></code> | <code>aws-cdk-lib.interfaces.aws_cloudwatch.AlarmReference</code> | A reference to a Alarm resource. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.metric">metric</a></code> | <code>aws-cdk-lib.aws_cloudwatch.IMetric</code> | The metric object this alarm was based on. |
---
##### `node`<sup>Required</sup> <a name="node" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.node"></a>
```typescript
public readonly node: Node;
```
- *Type:* constructs.Node
The tree node.
---
##### `env`<sup>Required</sup> <a name="env" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.env"></a>
```typescript
public readonly env: ResourceEnvironment;
```
- *Type:* aws-cdk-lib.interfaces.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like `new Role()`, `new Bucket()`, etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
`Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
different than the stack they were imported into.
---
##### `stack`<sup>Required</sup> <a name="stack" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.stack"></a>
```typescript
public readonly stack: Stack;
```
- *Type:* aws-cdk-lib.Stack
The stack in which this resource is defined.
---
##### `alarmArn`<sup>Required</sup> <a name="alarmArn" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.alarmArn"></a>
```typescript
public readonly alarmArn: string;
```
- *Type:* string
ARN of this alarm.
---
##### `alarmName`<sup>Required</sup> <a name="alarmName" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.alarmName"></a>
```typescript
public readonly alarmName: string;
```
- *Type:* string
Name of this alarm.
---
##### `alarmRef`<sup>Required</sup> <a name="alarmRef" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.alarmRef"></a>
```typescript
public readonly alarmRef: AlarmReference;
```
- *Type:* aws-cdk-lib.interfaces.aws_cloudwatch.AlarmReference
A reference to a Alarm resource.
---
##### `metric`<sup>Required</sup> <a name="metric" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.metric"></a>
```typescript
public readonly metric: IMetric;
```
- *Type:* aws-cdk-lib.aws_cloudwatch.IMetric
The metric object this alarm was based on.
---
#### Constants <a name="Constants" id="Constants"></a>
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.ANOMALY_DETECTION_NO_THRESHOLD">ANOMALY_DETECTION_NO_THRESHOLD</a></code> | <code>number</code> | Conventional value for the threshold property when creating anomaly detection alarms. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.PROPERTY_INJECTION_ID">PROPERTY_INJECTION_ID</a></code> | <code>string</code> | Uniquely identifies this class. |
---
##### `ANOMALY_DETECTION_NO_THRESHOLD`<sup>Required</sup> <a name="ANOMALY_DETECTION_NO_THRESHOLD" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.ANOMALY_DETECTION_NO_THRESHOLD"></a>
```typescript
public readonly ANOMALY_DETECTION_NO_THRESHOLD: number;
```
- *Type:* number
Conventional value for the threshold property when creating anomaly detection alarms.
Anomaly detection alarms don't have numbered threshold. Instead, they have a dynamically
calculated threshold based on the metric math expression that contains a metric expression.
The `threshold` property is required, but the value is ignored. This
constant has the value 0, and has a symbolic name to indicate why the
threshold is 0. You can use `new AnomalyDetectionAlarm()` to avoid having to pass
the `threshold` property at all.
---
##### `PROPERTY_INJECTION_ID`<sup>Required</sup> <a name="PROPERTY_INJECTION_ID" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApi5XXErrorAlarm.property.PROPERTY_INJECTION_ID"></a>
```typescript
public readonly PROPERTY_INJECTION_ID: string;
```
- *Type:* string
Uniquely identifies this class.
---
### ApiGatewayRestApiCountAnomalyAlarm <a name="ApiGatewayRestApiCountAnomalyAlarm" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm"></a>
An anomaly detection alarm on the API Gateway `Count` metric.
AWS recommends a static `Count` alarm with `LESS_THAN_THRESHOLD` to detect
unexpected traffic drops, but says the threshold "Depends on your situation".
This anomaly variant lets the band track historical traffic so the alarm
fires on actual deviations without picking a number that goes stale. By default
it flags both unexpected drops and unusual spikes (e.g. abuse or retry storms).
Because anomaly detection requires the `Average` statistic, this alarm tracks the
average request rate per period, not total request volume.
Note: on the drop side it detects partial drops below the expected band, not a
complete outage. API Gateway does not publish `Count` when there are zero requests,
so a full outage produces missing data (treated as not breaching) rather than a low
value. To alarm on zero traffic, pair this with a static `Count` alarm or a canary.
#### Initializers <a name="Initializers" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.Initializer"></a>
```typescript
import { ApiGatewayRestApiCountAnomalyAlarm } from '@renovosolutions/cdk-library-cloudwatch-alarms'
new ApiGatewayRestApiCountAnomalyAlarm(scope: IConstruct, id: string, props: ApiGatewayRestApiCountAnomalyAlarmProps)
```
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.Initializer.parameter.scope">scope</a></code> | <code>constructs.IConstruct</code> | *No description.* |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.Initializer.parameter.props">props</a></code> | <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarmProps">ApiGatewayRestApiCountAnomalyAlarmProps</a></code> | *No description.* |
---
##### `scope`<sup>Required</sup> <a name="scope" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.Initializer.parameter.scope"></a>
- *Type:* constructs.IConstruct
---
##### `id`<sup>Required</sup> <a name="id" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.Initializer.parameter.id"></a>
- *Type:* string
---
##### `props`<sup>Required</sup> <a name="props" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.Initializer.parameter.props"></a>
- *Type:* <a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarmProps">ApiGatewayRestApiCountAnomalyAlarmProps</a>
---
#### Methods <a name="Methods" id="Methods"></a>
| **Name** | **Description** |
| --- | --- |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.toString">toString</a></code> | Returns a string representation of this construct. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.with">with</a></code> | Applies one or more mixins to this construct. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.applyRemovalPolicy">applyRemovalPolicy</a></code> | Apply the given removal policy to this resource. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.addAlarmAction">addAlarmAction</a></code> | Trigger this action if the alarm fires. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.addInsufficientDataAction">addInsufficientDataAction</a></code> | Trigger this action if there is insufficient data to evaluate the alarm. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.addOkAction">addOkAction</a></code> | Trigger this action if the alarm returns from breaching state into ok state. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.renderAlarmRule">renderAlarmRule</a></code> | AlarmRule indicating ALARM state for Alarm. |
| <code><a href="#@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.toAnnotation">toAnnotation</a></code> | Turn this alarm into a horizontal annotation. |
---
##### `toString` <a name="toString" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.toString"></a>
```typescript
public toString(): string
```
Returns a string representation of this construct.
##### `with` <a name="with" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.with"></a>
```typescript
public with(mixins: ...IMixin[]): IConstruct
```
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple `with()` calls if subsequent mixins should apply to added
constructs.
###### `mixins`<sup>Required</sup> <a name="mixins" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.with.parameter.mixins"></a>
- *Type:* ...constructs.IMixin[]
---
##### `applyRemovalPolicy` <a name="applyRemovalPolicy" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.applyRemovalPolicy"></a>
```typescript
public applyRemovalPolicy(policy: RemovalPolicy): void
```
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
###### `policy`<sup>Required</sup> <a name="policy" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.applyRemovalPolicy.parameter.policy"></a>
- *Type:* aws-cdk-lib.RemovalPolicy
---
##### `addAlarmAction` <a name="addAlarmAction" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.addAlarmAction"></a>
```typescript
public addAlarmAction(actions: ...IAlarmAction[]): void
```
Trigger this action if the alarm fires.
Typically SnsAction or AutoScalingAction.
###### `actions`<sup>Required</sup> <a name="actions" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.addAlarmAction.parameter.actions"></a>
- *Type:* ...aws-cdk-lib.aws_cloudwatch.IAlarmAction[]
---
##### `addInsufficientDataAction` <a name="addInsufficientDataAction" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.addInsufficientDataAction"></a>
```typescript
public addInsufficientDataAction(actions: ...IAlarmAction[]): void
```
Trigger this action if there is insufficient data to evaluate the alarm.
Typically SnsAction or AutoScalingAction.
###### `actions`<sup>Required</sup> <a name="actions" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.addInsufficientDataAction.parameter.actions"></a>
- *Type:* ...aws-cdk-lib.aws_cloudwatch.IAlarmAction[]
---
##### `addOkAction` <a name="addOkAction" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.addOkAction"></a>
```typescript
public addOkAction(actions: ...IAlarmAction[]): void
```
Trigger this action if the alarm returns from breaching state into ok state.
Typically SnsAction or AutoScalingAction.
###### `actions`<sup>Required</sup> <a name="actions" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.addOkAction.parameter.actions"></a>
- *Type:* ...aws-cdk-lib.aws_cloudwatch.IAlarmAction[]
---
##### `renderAlarmRule` <a name="renderAlarmRule" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.renderAlarmRule"></a>
```typescript
public renderAlarmRule(): string
```
AlarmRule indicating ALARM state for Alarm.
##### `toAnnotation` <a name="toAnnotation" id="@renovosolutions/cdk-library-cloudwatch-alarms.ApiGatewayRestApiCountAnomalyAlarm.toAnnotation"></a>
```typescript
public toAnnotation(): HorizontalAnnotation
```
Turn this alarm into a horizontal annotation.
This is useful if you want to represent an Alarm in a non-AlarmWidget.
An `AlarmWidget` can directly show an alarm, but it can only show a
single alarm and no other metrics. Instead, you can convert the alarm to
a HorizontalAnnotation and add it as an annotation to another graph.
This might be useful if:
- You want to show multiple alarms inside a single graph, for example if
you have both a "small marg