interface CfnLogAlarmProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.CloudWatch.CfnLogAlarmProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#CfnLogAlarmProps |
Java | software.amazon.awscdk.services.cloudwatch.CfnLogAlarmProps |
Python | aws_cdk.aws_cloudwatch.CfnLogAlarmProps |
TypeScript | aws-cdk-lib » aws_cloudwatch » CfnLogAlarmProps |
Properties for defining a CfnLogAlarm.
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-logalarm.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudwatch as cloudwatch } from 'aws-cdk-lib';
const cfnLogAlarmProps: cloudwatch.CfnLogAlarmProps = {
comparisonOperator: 'comparisonOperator',
queryResultsToAlarm: 123,
queryResultsToEvaluate: 123,
scheduledQueryConfiguration: {
aggregationExpression: 'aggregationExpression',
logGroupIdentifiers: ['logGroupIdentifiers'],
queryLanguage: 'queryLanguage',
queryString: 'queryString',
scheduleConfiguration: {
scheduleExpression: 'scheduleExpression',
// the properties below are optional
endTimeOffset: 123,
startTimeOffset: 123,
},
scheduledQueryRoleArn: 'scheduledQueryRoleArn',
},
threshold: 123,
// the properties below are optional
actionLogLineCount: 123,
actionLogLineRoleArn: 'actionLogLineRoleArn',
actionsEnabled: false,
alarmActions: ['alarmActions'],
alarmDescription: 'alarmDescription',
alarmName: 'alarmName',
insufficientDataActions: ['insufficientDataActions'],
okActions: ['okActions'],
tags: [{
key: 'key',
value: 'value',
}],
treatMissingData: 'treatMissingData',
};
Properties
| Name | Type | Description |
|---|---|---|
| comparison | string | The arithmetic operation to use when comparing the specified threshold and the query results. |
| query | number | The number of query results that must be breaching to trigger the alarm. |
| query | number | The number of query results over which data is compared to the specified threshold. |
| scheduled | IResolvable | Scheduled | The scheduled query configuration for the log alarm. |
| threshold | number | The value to compare against the results of the scheduled query evaluation. |
| action | number | The number of log lines to include in alarm notifications. |
| action | string | The ARN of the IAM role that grants CloudWatch permissions to fetch log lines for alarm notifications. |
| actions | boolean | IResolvable | Indicates whether actions should be executed during any changes to the alarm state. |
| alarm | string[] | The list of actions to execute when this alarm transitions into an ALARM state from any other state. |
| alarm | string | The description of the log alarm. |
| alarm | string | The name of the log alarm. |
| insufficient | string[] | The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. |
| ok | string[] | The actions to execute when this alarm transitions to the OK state from any other state. |
| tags? | Cfn[] | A list of key-value pairs to associate with the log alarm. |
| treat | string | Sets how this alarm is to handle missing data points. |
comparisonOperator
Type:
string
The arithmetic operation to use when comparing the specified threshold and the query results.
Valid values are GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, and LessThanOrEqualToThreshold.
queryResultsToAlarm
Type:
number
The number of query results that must be breaching to trigger the alarm.
queryResultsToEvaluate
Type:
number
The number of query results over which data is compared to the specified threshold.
scheduledQueryConfiguration
Type:
IResolvable | Scheduled
The scheduled query configuration for the log alarm.
threshold
Type:
number
The value to compare against the results of the scheduled query evaluation.
actionLogLineCount?
Type:
number
(optional)
The number of log lines to include in alarm notifications.
Valid values are 0 to 50.
actionLogLineRoleArn?
Type:
string
(optional)
The ARN of the IAM role that grants CloudWatch permissions to fetch log lines for alarm notifications.
Required when ActionLogLineCount is greater than 0.
actionsEnabled?
Type:
boolean | IResolvable
(optional, default: true)
Indicates whether actions should be executed during any changes to the alarm state.
The default is TRUE.
alarmActions?
Type:
string[]
(optional)
The list of actions to execute when this alarm transitions into an ALARM state from any other state.
alarmDescription?
Type:
string
(optional)
The description of the log alarm.
alarmName?
Type:
string
(optional)
The name of the log alarm.
insufficientDataActions?
Type:
string[]
(optional)
The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
okActions?
Type:
string[]
(optional)
The actions to execute when this alarm transitions to the OK state from any other state.
tags?
Type:
Cfn[]
(optional)
A list of key-value pairs to associate with the log alarm.
treatMissingData?
Type:
string
(optional)
Sets how this alarm is to handle missing data points.
Valid values are breaching, notBreaching, ignore, and missing.

.NET
Go
Java
Python
TypeScript