We recommend new projects start with resources from the AWS provider.
published on Monday, Jun 15, 2026 by Pulumi
We recommend new projects start with resources from the AWS provider.
published on Monday, Jun 15, 2026 by Pulumi
Resource Type definition for AWS::CloudWatch::LogAlarm. A LogAlarm evaluates scheduled query results from CloudWatch Logs and triggers actions when thresholds are breached.
Create LogAlarm Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new LogAlarm(name: string, args: LogAlarmArgs, opts?: CustomResourceOptions);@overload
def LogAlarm(resource_name: str,
args: LogAlarmArgs,
opts: Optional[ResourceOptions] = None)
@overload
def LogAlarm(resource_name: str,
opts: Optional[ResourceOptions] = None,
query_results_to_alarm: Optional[int] = None,
query_results_to_evaluate: Optional[int] = None,
threshold: Optional[float] = None,
scheduled_query_configuration: Optional[LogAlarmScheduledQueryConfigurationArgs] = None,
comparison_operator: Optional[str] = None,
alarm_description: Optional[str] = None,
action_log_line_role_arn: Optional[str] = None,
alarm_name: Optional[str] = None,
ok_actions: Optional[Sequence[str]] = None,
action_log_line_count: Optional[int] = None,
insufficient_data_actions: Optional[Sequence[str]] = None,
alarm_actions: Optional[Sequence[str]] = None,
tags: Optional[Sequence[_root_inputs.TagArgs]] = None,
actions_enabled: Optional[bool] = None,
treat_missing_data: Optional[str] = None)func NewLogAlarm(ctx *Context, name string, args LogAlarmArgs, opts ...ResourceOption) (*LogAlarm, error)public LogAlarm(string name, LogAlarmArgs args, CustomResourceOptions? opts = null)
public LogAlarm(String name, LogAlarmArgs args)
public LogAlarm(String name, LogAlarmArgs args, CustomResourceOptions options)
type: aws-native:cloudwatch:LogAlarm
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "aws-native_cloudwatch_logalarm" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args LogAlarmArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args LogAlarmArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args LogAlarmArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LogAlarmArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LogAlarmArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
LogAlarm Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The LogAlarm resource accepts the following input properties:
- Comparison
Operator string - The arithmetic operation to use when comparing the specified threshold and the query results. Valid values are GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, and LessThanOrEqualToThreshold.
- Query
Results intTo Alarm - The number of query results that must be breaching to trigger the alarm.
- Query
Results intTo Evaluate - The number of query results over which data is compared to the specified threshold.
- Scheduled
Query Pulumi.Configuration Aws Native. Cloud Watch. Inputs. Log Alarm Scheduled Query Configuration - The scheduled query configuration for the log alarm.
- Threshold double
- The value to compare against the results of the scheduled query evaluation.
- Action
Log intLine Count - The number of log lines to include in alarm notifications. Valid values are 0 to 50.
- Action
Log stringLine Role Arn - The ARN of the IAM role that grants CloudWatch permissions to fetch log lines for alarm notifications. Required when ActionLogLineCount is greater than 0.
- Actions
Enabled bool - Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.
- Alarm
Actions List<string> - The list of actions to execute when this alarm transitions into an ALARM state from any other state.
- Alarm
Description string - The description of the log alarm.
- Alarm
Name string - The name of the log alarm.
- Insufficient
Data List<string>Actions - The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
- Ok
Actions List<string> - The actions to execute when this alarm transitions to the OK state from any other state.
-
List<Pulumi.
Aws Native. Inputs. Tag> - A list of key-value pairs to associate with the log alarm.
- Treat
Missing stringData - Sets how this alarm is to handle missing data points. Valid values are breaching, notBreaching, ignore, and missing.
- Comparison
Operator string - The arithmetic operation to use when comparing the specified threshold and the query results. Valid values are GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, and LessThanOrEqualToThreshold.
- Query
Results intTo Alarm - The number of query results that must be breaching to trigger the alarm.
- Query
Results intTo Evaluate - The number of query results over which data is compared to the specified threshold.
- Scheduled
Query LogConfiguration Alarm Scheduled Query Configuration Args - The scheduled query configuration for the log alarm.
- Threshold float64
- The value to compare against the results of the scheduled query evaluation.
- Action
Log intLine Count - The number of log lines to include in alarm notifications. Valid values are 0 to 50.
- Action
Log stringLine Role Arn - The ARN of the IAM role that grants CloudWatch permissions to fetch log lines for alarm notifications. Required when ActionLogLineCount is greater than 0.
- Actions
Enabled bool - Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.
- Alarm
Actions []string - The list of actions to execute when this alarm transitions into an ALARM state from any other state.
- Alarm
Description string - The description of the log alarm.
- Alarm
Name string - The name of the log alarm.
- Insufficient
Data []stringActions - The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
- Ok
Actions []string - The actions to execute when this alarm transitions to the OK state from any other state.
-
Tag
Args - A list of key-value pairs to associate with the log alarm.
- Treat
Missing stringData - Sets how this alarm is to handle missing data points. Valid values are breaching, notBreaching, ignore, and missing.
- comparison_
operator string - The arithmetic operation to use when comparing the specified threshold and the query results. Valid values are GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, and LessThanOrEqualToThreshold.
- query_
results_ numberto_ alarm - The number of query results that must be breaching to trigger the alarm.
- query_
results_ numberto_ evaluate - The number of query results over which data is compared to the specified threshold.
- scheduled_
query_ objectconfiguration - The scheduled query configuration for the log alarm.
- threshold number
- The value to compare against the results of the scheduled query evaluation.
- action_
log_ numberline_ count - The number of log lines to include in alarm notifications. Valid values are 0 to 50.
- action_
log_ stringline_ role_ arn - The ARN of the IAM role that grants CloudWatch permissions to fetch log lines for alarm notifications. Required when ActionLogLineCount is greater than 0.
- actions_
enabled bool - Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.
- alarm_
actions list(string) - The list of actions to execute when this alarm transitions into an ALARM state from any other state.
- alarm_
description string - The description of the log alarm.
- alarm_
name string - The name of the log alarm.
- insufficient_
data_ list(string)actions - The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
- ok_
actions list(string) - The actions to execute when this alarm transitions to the OK state from any other state.
- list(object)
- A list of key-value pairs to associate with the log alarm.
- treat_
missing_ stringdata - Sets how this alarm is to handle missing data points. Valid values are breaching, notBreaching, ignore, and missing.
- comparison
Operator String - The arithmetic operation to use when comparing the specified threshold and the query results. Valid values are GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, and LessThanOrEqualToThreshold.
- query
Results IntegerTo Alarm - The number of query results that must be breaching to trigger the alarm.
- query
Results IntegerTo Evaluate - The number of query results over which data is compared to the specified threshold.
- scheduled
Query LogConfiguration Alarm Scheduled Query Configuration - The scheduled query configuration for the log alarm.
- threshold Double
- The value to compare against the results of the scheduled query evaluation.
- action
Log IntegerLine Count - The number of log lines to include in alarm notifications. Valid values are 0 to 50.
- action
Log StringLine Role Arn - The ARN of the IAM role that grants CloudWatch permissions to fetch log lines for alarm notifications. Required when ActionLogLineCount is greater than 0.
- actions
Enabled Boolean - Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.
- alarm
Actions List<String> - The list of actions to execute when this alarm transitions into an ALARM state from any other state.
- alarm
Description String - The description of the log alarm.
- alarm
Name String - The name of the log alarm.
- insufficient
Data List<String>Actions - The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
- ok
Actions List<String> - The actions to execute when this alarm transitions to the OK state from any other state.
- List<Tag>
- A list of key-value pairs to associate with the log alarm.
- treat
Missing StringData - Sets how this alarm is to handle missing data points. Valid values are breaching, notBreaching, ignore, and missing.
- comparison
Operator string - The arithmetic operation to use when comparing the specified threshold and the query results. Valid values are GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, and LessThanOrEqualToThreshold.
- query
Results numberTo Alarm - The number of query results that must be breaching to trigger the alarm.
- query
Results numberTo Evaluate - The number of query results over which data is compared to the specified threshold.
- scheduled
Query LogConfiguration Alarm Scheduled Query Configuration - The scheduled query configuration for the log alarm.
- threshold number
- The value to compare against the results of the scheduled query evaluation.
- action
Log numberLine Count - The number of log lines to include in alarm notifications. Valid values are 0 to 50.
- action
Log stringLine Role Arn - The ARN of the IAM role that grants CloudWatch permissions to fetch log lines for alarm notifications. Required when ActionLogLineCount is greater than 0.
- actions
Enabled boolean - Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.
- alarm
Actions string[] - The list of actions to execute when this alarm transitions into an ALARM state from any other state.
- alarm
Description string - The description of the log alarm.
- alarm
Name string - The name of the log alarm.
- insufficient
Data string[]Actions - The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
- ok
Actions string[] - The actions to execute when this alarm transitions to the OK state from any other state.
- Tag[]
- A list of key-value pairs to associate with the log alarm.
- treat
Missing stringData - Sets how this alarm is to handle missing data points. Valid values are breaching, notBreaching, ignore, and missing.
- comparison_
operator str - The arithmetic operation to use when comparing the specified threshold and the query results. Valid values are GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, and LessThanOrEqualToThreshold.
- query_
results_ intto_ alarm - The number of query results that must be breaching to trigger the alarm.
- query_
results_ intto_ evaluate - The number of query results over which data is compared to the specified threshold.
- scheduled_
query_ Logconfiguration Alarm Scheduled Query Configuration Args - The scheduled query configuration for the log alarm.
- threshold float
- The value to compare against the results of the scheduled query evaluation.
- action_
log_ intline_ count - The number of log lines to include in alarm notifications. Valid values are 0 to 50.
- action_
log_ strline_ role_ arn - The ARN of the IAM role that grants CloudWatch permissions to fetch log lines for alarm notifications. Required when ActionLogLineCount is greater than 0.
- actions_
enabled bool - Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.
- alarm_
actions Sequence[str] - The list of actions to execute when this alarm transitions into an ALARM state from any other state.
- alarm_
description str - The description of the log alarm.
- alarm_
name str - The name of the log alarm.
- insufficient_
data_ Sequence[str]actions - The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
- ok_
actions Sequence[str] - The actions to execute when this alarm transitions to the OK state from any other state.
-
Sequence[Tag
Args] - A list of key-value pairs to associate with the log alarm.
- treat_
missing_ strdata - Sets how this alarm is to handle missing data points. Valid values are breaching, notBreaching, ignore, and missing.
- comparison
Operator String - The arithmetic operation to use when comparing the specified threshold and the query results. Valid values are GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, and LessThanOrEqualToThreshold.
- query
Results NumberTo Alarm - The number of query results that must be breaching to trigger the alarm.
- query
Results NumberTo Evaluate - The number of query results over which data is compared to the specified threshold.
- scheduled
Query Property MapConfiguration - The scheduled query configuration for the log alarm.
- threshold Number
- The value to compare against the results of the scheduled query evaluation.
- action
Log NumberLine Count - The number of log lines to include in alarm notifications. Valid values are 0 to 50.
- action
Log StringLine Role Arn - The ARN of the IAM role that grants CloudWatch permissions to fetch log lines for alarm notifications. Required when ActionLogLineCount is greater than 0.
- actions
Enabled Boolean - Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.
- alarm
Actions List<String> - The list of actions to execute when this alarm transitions into an ALARM state from any other state.
- alarm
Description String - The description of the log alarm.
- alarm
Name String - The name of the log alarm.
- insufficient
Data List<String>Actions - The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
- ok
Actions List<String> - The actions to execute when this alarm transitions to the OK state from any other state.
- List<Property Map>
- A list of key-value pairs to associate with the log alarm.
- treat
Missing StringData - Sets how this alarm is to handle missing data points. Valid values are breaching, notBreaching, ignore, and missing.
Outputs
All input properties are implicitly available as output properties. Additionally, the LogAlarm resource produces the following output properties:
Supporting Types
LogAlarmScheduleConfiguration, LogAlarmScheduleConfigurationArgs
The schedule configuration for the scheduled query.- Schedule
Expression string - The expression that defines when the scheduled query runs, e.g. rate(1 minute).
- End
Time intOffset - The number of seconds into the past to end the query window.
- Start
Time intOffset - The number of seconds into the past to start the query window.
- Schedule
Expression string - The expression that defines when the scheduled query runs, e.g. rate(1 minute).
- End
Time intOffset - The number of seconds into the past to end the query window.
- Start
Time intOffset - The number of seconds into the past to start the query window.
- schedule_
expression string - The expression that defines when the scheduled query runs, e.g. rate(1 minute).
- end_
time_ numberoffset - The number of seconds into the past to end the query window.
- start_
time_ numberoffset - The number of seconds into the past to start the query window.
- schedule
Expression String - The expression that defines when the scheduled query runs, e.g. rate(1 minute).
- end
Time IntegerOffset - The number of seconds into the past to end the query window.
- start
Time IntegerOffset - The number of seconds into the past to start the query window.
- schedule
Expression string - The expression that defines when the scheduled query runs, e.g. rate(1 minute).
- end
Time numberOffset - The number of seconds into the past to end the query window.
- start
Time numberOffset - The number of seconds into the past to start the query window.
- schedule_
expression str - The expression that defines when the scheduled query runs, e.g. rate(1 minute).
- end_
time_ intoffset - The number of seconds into the past to end the query window.
- start_
time_ intoffset - The number of seconds into the past to start the query window.
- schedule
Expression String - The expression that defines when the scheduled query runs, e.g. rate(1 minute).
- end
Time NumberOffset - The number of seconds into the past to end the query window.
- start
Time NumberOffset - The number of seconds into the past to start the query window.
LogAlarmScheduledQueryConfiguration, LogAlarmScheduledQueryConfigurationArgs
The scheduled query configuration for the log alarm.- Aggregation
Expression string - The aggregation expression for the scheduled query, e.g. count(*) or avg(latency) by host.
- Log
Group List<string>Identifiers - The log groups to query.
- Query
String string - The query string to execute against the specified log groups.
- Schedule
Configuration Pulumi.Aws Native. Cloud Watch. Inputs. Log Alarm Schedule Configuration - The schedule configuration.
- Scheduled
Query stringRole Arn - The ARN of the IAM role that grants permissions to execute the scheduled query.
- Aggregation
Expression string - The aggregation expression for the scheduled query, e.g. count(*) or avg(latency) by host.
- Log
Group []stringIdentifiers - The log groups to query.
- Query
String string - The query string to execute against the specified log groups.
- Schedule
Configuration LogAlarm Schedule Configuration - The schedule configuration.
- Scheduled
Query stringRole Arn - The ARN of the IAM role that grants permissions to execute the scheduled query.
- aggregation_
expression string - The aggregation expression for the scheduled query, e.g. count(*) or avg(latency) by host.
- log_
group_ list(string)identifiers - The log groups to query.
- query_
string string - The query string to execute against the specified log groups.
- schedule_
configuration object - The schedule configuration.
- scheduled_
query_ stringrole_ arn - The ARN of the IAM role that grants permissions to execute the scheduled query.
- aggregation
Expression String - The aggregation expression for the scheduled query, e.g. count(*) or avg(latency) by host.
- log
Group List<String>Identifiers - The log groups to query.
- query
String String - The query string to execute against the specified log groups.
- schedule
Configuration LogAlarm Schedule Configuration - The schedule configuration.
- scheduled
Query StringRole Arn - The ARN of the IAM role that grants permissions to execute the scheduled query.
- aggregation
Expression string - The aggregation expression for the scheduled query, e.g. count(*) or avg(latency) by host.
- log
Group string[]Identifiers - The log groups to query.
- query
String string - The query string to execute against the specified log groups.
- schedule
Configuration LogAlarm Schedule Configuration - The schedule configuration.
- scheduled
Query stringRole Arn - The ARN of the IAM role that grants permissions to execute the scheduled query.
- aggregation_
expression str - The aggregation expression for the scheduled query, e.g. count(*) or avg(latency) by host.
- log_
group_ Sequence[str]identifiers - The log groups to query.
- query_
string str - The query string to execute against the specified log groups.
- schedule_
configuration LogAlarm Schedule Configuration - The schedule configuration.
- scheduled_
query_ strrole_ arn - The ARN of the IAM role that grants permissions to execute the scheduled query.
- aggregation
Expression String - The aggregation expression for the scheduled query, e.g. count(*) or avg(latency) by host.
- log
Group List<String>Identifiers - The log groups to query.
- query
String String - The query string to execute against the specified log groups.
- schedule
Configuration Property Map - The schedule configuration.
- scheduled
Query StringRole Arn - The ARN of the IAM role that grants permissions to execute the scheduled query.
Tag, TagArgs
A set of tags to apply to the resource.Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.
published on Monday, Jun 15, 2026 by Pulumi