Class CfnLogAlarm
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.cloudwatch.CfnLogAlarm
- All Implemented Interfaces:
IInspectable,ILogAlarmRef,IEnvironmentAware,ITaggableV2,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.133.0 (build 0f43e37)",
date="2026-06-16T16:14:20.700Z")
@Stability(Stable)
public class CfnLogAlarm
extends CfnResource
implements IInspectable, ILogAlarmRef, ITaggableV2
Resource Type definition for AWS::CloudWatch::LogAlarm.
A LogAlarm evaluates scheduled query results from CloudWatch Logs and triggers actions when thresholds are breached.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudwatch.*;
CfnLogAlarm cfnLogAlarm = CfnLogAlarm.Builder.create(this, "MyCfnLogAlarm")
.comparisonOperator("comparisonOperator")
.queryResultsToAlarm(123)
.queryResultsToEvaluate(123)
.scheduledQueryConfiguration(ScheduledQueryConfigurationProperty.builder()
.aggregationExpression("aggregationExpression")
.logGroupIdentifiers(List.of("logGroupIdentifiers"))
.queryLanguage("queryLanguage")
.queryString("queryString")
.scheduleConfiguration(ScheduleConfigurationProperty.builder()
.scheduleExpression("scheduleExpression")
// the properties below are optional
.endTimeOffset(123)
.startTimeOffset(123)
.build())
.scheduledQueryRoleArn("scheduledQueryRoleArn")
.build())
.threshold(123)
// the properties below are optional
.actionLogLineCount(123)
.actionLogLineRoleArn("actionLogLineRoleArn")
.actionsEnabled(false)
.alarmActions(List.of("alarmActions"))
.alarmDescription("alarmDescription")
.alarmName("alarmName")
.insufficientDataActions(List.of("insufficientDataActions"))
.okActions(List.of("okActions"))
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.treatMissingData("treatMissingData")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnLogAlarm.static interfaceThe schedule configuration for the scheduled query.static interfaceThe scheduled query configuration for the log alarm.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.cloudwatch.ILogAlarmRef
ILogAlarmRef.Jsii$Default, ILogAlarmRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnLogAlarm(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnLogAlarm(software.amazon.jsii.JsiiObjectRef objRef) CfnLogAlarm(software.constructs.Construct scope, String id, CfnLogAlarmProps props) Create a newAWS::CloudWatch::LogAlarm. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForLogAlarm(ILogAlarmRef resource) The number of log lines to include in alarm notifications.The ARN of the IAM role that grants CloudWatch permissions to fetch log lines for alarm notifications.Indicates whether actions should be executed during any changes to the alarm state.The list of actions to execute when this alarm transitions into an ALARM state from any other state.The description of the log alarm.The name of the log alarm.The ARN of the log alarm.Tag Manager which manages the tags for this resource.The arithmetic operation to use when comparing the specified threshold and the query results.The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.A reference to a LogAlarm resource.The actions to execute when this alarm transitions to the OK state from any other state.The number of query results that must be breaching to trigger the alarm.The number of query results over which data is compared to the specified threshold.The scheduled query configuration for the log alarm.getTags()A list of key-value pairs to associate with the log alarm.The value to compare against the results of the scheduled query evaluation.Sets how this alarm is to handle missing data points.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnLogAlarm.renderProperties(Map<String, Object> props) voidsetActionLogLineCount(Number value) The number of log lines to include in alarm notifications.voidsetActionLogLineRoleArn(String value) The ARN of the IAM role that grants CloudWatch permissions to fetch log lines for alarm notifications.voidsetActionsEnabled(Boolean value) Indicates whether actions should be executed during any changes to the alarm state.voidsetActionsEnabled(IResolvable value) Indicates whether actions should be executed during any changes to the alarm state.voidsetAlarmActions(List<String> value) The list of actions to execute when this alarm transitions into an ALARM state from any other state.voidsetAlarmDescription(String value) The description of the log alarm.voidsetAlarmName(String value) The name of the log alarm.voidsetComparisonOperator(String value) The arithmetic operation to use when comparing the specified threshold and the query results.voidsetInsufficientDataActions(List<String> value) The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.voidsetOkActions(List<String> value) The actions to execute when this alarm transitions to the OK state from any other state.voidsetQueryResultsToAlarm(Number value) The number of query results that must be breaching to trigger the alarm.voidsetQueryResultsToEvaluate(Number value) The number of query results over which data is compared to the specified threshold.voidThe scheduled query configuration for the log alarm.voidThe scheduled query configuration for the log alarm.voidA list of key-value pairs to associate with the log alarm.voidsetThreshold(Number value) The value to compare against the results of the scheduled query evaluation.voidsetTreatMissingData(String value) Sets how this alarm is to handle missing data points.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyCrossStackReferenceStrength, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, cfnPropertyName, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId, withMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNode, withMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnLogAlarm
protected CfnLogAlarm(software.amazon.jsii.JsiiObjectRef objRef) -
CfnLogAlarm
protected CfnLogAlarm(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnLogAlarm
@Stability(Stable) public CfnLogAlarm(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnLogAlarmProps props) Create a newAWS::CloudWatch::LogAlarm.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
arnForLogAlarm
- Parameters:
resource- This parameter is required.
-
isCfnLogAlarm
Checks whether the given object is a CfnLogAlarm.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
The ARN of the log alarm. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getCfnPropertyNames
- Overrides:
getCfnPropertyNamesin classCfnResource
-
getLogAlarmRef
A reference to a LogAlarm resource.- Specified by:
getLogAlarmRefin interfaceILogAlarmRef
-
getComparisonOperator
The arithmetic operation to use when comparing the specified threshold and the query results. -
setComparisonOperator
The arithmetic operation to use when comparing the specified threshold and the query results. -
getQueryResultsToAlarm
The number of query results that must be breaching to trigger the alarm. -
setQueryResultsToAlarm
The number of query results that must be breaching to trigger the alarm. -
getQueryResultsToEvaluate
The number of query results over which data is compared to the specified threshold. -
setQueryResultsToEvaluate
The number of query results over which data is compared to the specified threshold. -
getScheduledQueryConfiguration
The scheduled query configuration for the log alarm.Returns union: either
IResolvableorCfnLogAlarm.ScheduledQueryConfigurationProperty -
setScheduledQueryConfiguration
The scheduled query configuration for the log alarm. -
setScheduledQueryConfiguration
@Stability(Stable) public void setScheduledQueryConfiguration(@NotNull CfnLogAlarm.ScheduledQueryConfigurationProperty value) The scheduled query configuration for the log alarm. -
getThreshold
The value to compare against the results of the scheduled query evaluation. -
setThreshold
The value to compare against the results of the scheduled query evaluation. -
getActionLogLineCount
The number of log lines to include in alarm notifications. -
setActionLogLineCount
The number of log lines to include in alarm notifications. -
getActionLogLineRoleArn
The ARN of the IAM role that grants CloudWatch permissions to fetch log lines for alarm notifications. -
setActionLogLineRoleArn
The ARN of the IAM role that grants CloudWatch permissions to fetch log lines for alarm notifications. -
getActionsEnabled
Indicates whether actions should be executed during any changes to the alarm state.Returns union: either
BooleanorIResolvable -
setActionsEnabled
Indicates whether actions should be executed during any changes to the alarm state. -
setActionsEnabled
Indicates whether actions should be executed during any changes to the alarm state. -
getAlarmActions
The list of actions to execute when this alarm transitions into an ALARM state from any other state. -
setAlarmActions
The list of actions to execute when this alarm transitions into an ALARM state from any other state. -
getAlarmDescription
The description of the log alarm. -
setAlarmDescription
The description of the log alarm. -
getAlarmName
The name of the log alarm. -
setAlarmName
The name of the log alarm. -
getInsufficientDataActions
The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. -
setInsufficientDataActions
The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. -
getOkActions
The actions to execute when this alarm transitions to the OK state from any other state. -
setOkActions
The actions to execute when this alarm transitions to the OK state from any other state. -
getTags
A list of key-value pairs to associate with the log alarm. -
setTags
A list of key-value pairs to associate with the log alarm. -
getTreatMissingData
Sets how this alarm is to handle missing data points. -
setTreatMissingData
Sets how this alarm is to handle missing data points.
-