# Monitor

Defines monitors that will be associated with an AWS AppConfig environment.

- Source: [`aws-appconfig/lib/environment.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-appconfig/lib/environment.ts#L416)
- Type last changed: v2.234.0 · 8 Jan 2026

## Example

```ts
declare const application: appconfig.Application;
declare const alarm: cloudwatch.Alarm;
declare const compositeAlarm: cloudwatch.CompositeAlarm;

new appconfig.Environment(this, 'MyEnvironment', {
  application,
  monitors: [
    appconfig.Monitor.fromCloudWatchAlarm(alarm),
    appconfig.Monitor.fromCloudWatchAlarm(compositeAlarm),
  ],
});
```

## Initializer

```ts
new Monitor()
```

## Properties

- `alarmArn`: string (required) — The alarm ARN for AWS AppConfig to monitor.

- `alarmRoleArn`: string — The IAM role ARN for AWS AppConfig to view the alarm state.

- `isCompositeAlarm`: boolean — Indicates whether a CloudWatch alarm is a composite alarm.

- `monitorType`: [MonitorType](/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.MonitorType.html) (required) — The type of monitor.

## Methods

- `fromCfnMonitorsProperty(monitorsProperty: CfnEnvironment.MonitorsProperty): Monitor // chainable` (static) — Creates a Monitor from a CfnEnvironment.MonitorsProperty construct.

  **Parameters**

  - `monitorsProperty` — The monitors property.

- `fromCloudWatchAlarm(alarm: IAlarmRef, alarmRole?: IRoleRef): Monitor // chainable` (static) — Creates a Monitor from a CloudWatch alarm.

  If the alarm role is not specified, a role will
  be generated.

  **Parameters**

  - `alarm` — The Amazon CloudWatch alarm.
  - `alarmRole` — The IAM role for AWS AppConfig to view the alarm state.
