1. Packages
  2. Packages
  3. AWS Cloud Control
  4. API Docs
  5. cloudwatch
  6. LogAlarm

We recommend new projects start with resources from the AWS provider.

Viewing docs for AWS Cloud Control v1.69.0
published on Monday, Jun 15, 2026 by Pulumi
aws-native logo

We recommend new projects start with resources from the AWS provider.

Viewing docs for AWS Cloud Control v1.69.0
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:

    ComparisonOperator string
    The arithmetic operation to use when comparing the specified threshold and the query results. Valid values are GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, and LessThanOrEqualToThreshold.
    QueryResultsToAlarm int
    The number of query results that must be breaching to trigger the alarm.
    QueryResultsToEvaluate int
    The number of query results over which data is compared to the specified threshold.
    ScheduledQueryConfiguration Pulumi.AwsNative.CloudWatch.Inputs.LogAlarmScheduledQueryConfiguration
    The scheduled query configuration for the log alarm.
    Threshold double
    The value to compare against the results of the scheduled query evaluation.
    ActionLogLineCount int
    The number of log lines to include in alarm notifications. Valid values are 0 to 50.
    ActionLogLineRoleArn string
    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 bool
    Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.
    AlarmActions List<string>
    The list of actions to execute when this alarm transitions into an ALARM state from any other state.
    AlarmDescription string
    The description of the log alarm.
    AlarmName string
    The name of the log alarm.
    InsufficientDataActions List<string>
    The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
    OkActions List<string>
    The actions to execute when this alarm transitions to the OK state from any other state.
    Tags List<Pulumi.AwsNative.Inputs.Tag>
    A list of key-value pairs to associate with the log alarm.
    TreatMissingData string
    Sets how this alarm is to handle missing data points. Valid values are breaching, notBreaching, ignore, and missing.
    ComparisonOperator string
    The arithmetic operation to use when comparing the specified threshold and the query results. Valid values are GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, and LessThanOrEqualToThreshold.
    QueryResultsToAlarm int
    The number of query results that must be breaching to trigger the alarm.
    QueryResultsToEvaluate int
    The number of query results over which data is compared to the specified threshold.
    ScheduledQueryConfiguration LogAlarmScheduledQueryConfigurationArgs
    The scheduled query configuration for the log alarm.
    Threshold float64
    The value to compare against the results of the scheduled query evaluation.
    ActionLogLineCount int
    The number of log lines to include in alarm notifications. Valid values are 0 to 50.
    ActionLogLineRoleArn string
    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 bool
    Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.
    AlarmActions []string
    The list of actions to execute when this alarm transitions into an ALARM state from any other state.
    AlarmDescription string
    The description of the log alarm.
    AlarmName string
    The name of the log alarm.
    InsufficientDataActions []string
    The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
    OkActions []string
    The actions to execute when this alarm transitions to the OK state from any other state.
    Tags TagArgs
    A list of key-value pairs to associate with the log alarm.
    TreatMissingData string
    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_to_alarm number
    The number of query results that must be breaching to trigger the alarm.
    query_results_to_evaluate number
    The number of query results over which data is compared to the specified threshold.
    scheduled_query_configuration object
    The scheduled query configuration for the log alarm.
    threshold number
    The value to compare against the results of the scheduled query evaluation.
    action_log_line_count number
    The number of log lines to include in alarm notifications. Valid values are 0 to 50.
    action_log_line_role_arn string
    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_actions list(string)
    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.
    tags list(object)
    A list of key-value pairs to associate with the log alarm.
    treat_missing_data string
    Sets how this alarm is to handle missing data points. Valid values are breaching, notBreaching, ignore, and missing.
    comparisonOperator String
    The arithmetic operation to use when comparing the specified threshold and the query results. Valid values are GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, and LessThanOrEqualToThreshold.
    queryResultsToAlarm Integer
    The number of query results that must be breaching to trigger the alarm.
    queryResultsToEvaluate Integer
    The number of query results over which data is compared to the specified threshold.
    scheduledQueryConfiguration LogAlarmScheduledQueryConfiguration
    The scheduled query configuration for the log alarm.
    threshold Double
    The value to compare against the results of the scheduled query evaluation.
    actionLogLineCount Integer
    The number of log lines to include in alarm notifications. Valid values are 0 to 50.
    actionLogLineRoleArn String
    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 Boolean
    Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.
    alarmActions List<String>
    The list of actions to execute when this alarm transitions into an ALARM state from any other state.
    alarmDescription String
    The description of the log alarm.
    alarmName String
    The name of the log alarm.
    insufficientDataActions List<String>
    The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
    okActions List<String>
    The actions to execute when this alarm transitions to the OK state from any other state.
    tags List<Tag>
    A list of key-value pairs to associate with the log alarm.
    treatMissingData String
    Sets how this alarm is to handle missing data points. Valid values are breaching, notBreaching, ignore, and missing.
    comparisonOperator string
    The arithmetic operation to use when comparing the specified threshold and the query results. Valid values are GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, and LessThanOrEqualToThreshold.
    queryResultsToAlarm number
    The number of query results that must be breaching to trigger the alarm.
    queryResultsToEvaluate number
    The number of query results over which data is compared to the specified threshold.
    scheduledQueryConfiguration LogAlarmScheduledQueryConfiguration
    The scheduled query configuration for the log alarm.
    threshold number
    The value to compare against the results of the scheduled query evaluation.
    actionLogLineCount number
    The number of log lines to include in alarm notifications. Valid values are 0 to 50.
    actionLogLineRoleArn string
    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 boolean
    Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.
    alarmActions string[]
    The list of actions to execute when this alarm transitions into an ALARM state from any other state.
    alarmDescription string
    The description of the log alarm.
    alarmName string
    The name of the log alarm.
    insufficientDataActions string[]
    The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
    okActions string[]
    The actions to execute when this alarm transitions to the OK state from any other state.
    tags Tag[]
    A list of key-value pairs to associate with the log alarm.
    treatMissingData string
    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_to_alarm int
    The number of query results that must be breaching to trigger the alarm.
    query_results_to_evaluate int
    The number of query results over which data is compared to the specified threshold.
    scheduled_query_configuration LogAlarmScheduledQueryConfigurationArgs
    The scheduled query configuration for the log alarm.
    threshold float
    The value to compare against the results of the scheduled query evaluation.
    action_log_line_count int
    The number of log lines to include in alarm notifications. Valid values are 0 to 50.
    action_log_line_role_arn str
    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_actions Sequence[str]
    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.
    tags Sequence[TagArgs]
    A list of key-value pairs to associate with the log alarm.
    treat_missing_data str
    Sets how this alarm is to handle missing data points. Valid values are breaching, notBreaching, ignore, and missing.
    comparisonOperator String
    The arithmetic operation to use when comparing the specified threshold and the query results. Valid values are GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, and LessThanOrEqualToThreshold.
    queryResultsToAlarm Number
    The number of query results that must be breaching to trigger the alarm.
    queryResultsToEvaluate Number
    The number of query results over which data is compared to the specified threshold.
    scheduledQueryConfiguration Property Map
    The scheduled query configuration for the log alarm.
    threshold Number
    The value to compare against the results of the scheduled query evaluation.
    actionLogLineCount Number
    The number of log lines to include in alarm notifications. Valid values are 0 to 50.
    actionLogLineRoleArn String
    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 Boolean
    Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.
    alarmActions List<String>
    The list of actions to execute when this alarm transitions into an ALARM state from any other state.
    alarmDescription String
    The description of the log alarm.
    alarmName String
    The name of the log alarm.
    insufficientDataActions List<String>
    The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
    okActions List<String>
    The actions to execute when this alarm transitions to the OK state from any other state.
    tags List<Property Map>
    A list of key-value pairs to associate with the log alarm.
    treatMissingData String
    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:

    Arn string
    The ARN of the log alarm.
    Id string
    The provider-assigned unique ID for this managed resource.
    Arn string
    The ARN of the log alarm.
    Id string
    The provider-assigned unique ID for this managed resource.
    arn string
    The ARN of the log alarm.
    id string
    The provider-assigned unique ID for this managed resource.
    arn String
    The ARN of the log alarm.
    id String
    The provider-assigned unique ID for this managed resource.
    arn string
    The ARN of the log alarm.
    id string
    The provider-assigned unique ID for this managed resource.
    arn str
    The ARN of the log alarm.
    id str
    The provider-assigned unique ID for this managed resource.
    arn String
    The ARN of the log alarm.
    id String
    The provider-assigned unique ID for this managed resource.

    Supporting Types

    LogAlarmScheduleConfiguration, LogAlarmScheduleConfigurationArgs

    The schedule configuration for the scheduled query.
    ScheduleExpression string
    The expression that defines when the scheduled query runs, e.g. rate(1 minute).
    EndTimeOffset int
    The number of seconds into the past to end the query window.
    StartTimeOffset int
    The number of seconds into the past to start the query window.
    ScheduleExpression string
    The expression that defines when the scheduled query runs, e.g. rate(1 minute).
    EndTimeOffset int
    The number of seconds into the past to end the query window.
    StartTimeOffset int
    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_offset number
    The number of seconds into the past to end the query window.
    start_time_offset number
    The number of seconds into the past to start the query window.
    scheduleExpression String
    The expression that defines when the scheduled query runs, e.g. rate(1 minute).
    endTimeOffset Integer
    The number of seconds into the past to end the query window.
    startTimeOffset Integer
    The number of seconds into the past to start the query window.
    scheduleExpression string
    The expression that defines when the scheduled query runs, e.g. rate(1 minute).
    endTimeOffset number
    The number of seconds into the past to end the query window.
    startTimeOffset number
    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_offset int
    The number of seconds into the past to end the query window.
    start_time_offset int
    The number of seconds into the past to start the query window.
    scheduleExpression String
    The expression that defines when the scheduled query runs, e.g. rate(1 minute).
    endTimeOffset Number
    The number of seconds into the past to end the query window.
    startTimeOffset Number
    The number of seconds into the past to start the query window.

    LogAlarmScheduledQueryConfiguration, LogAlarmScheduledQueryConfigurationArgs

    The scheduled query configuration for the log alarm.
    AggregationExpression string
    The aggregation expression for the scheduled query, e.g. count(*) or avg(latency) by host.
    LogGroupIdentifiers List<string>
    The log groups to query.
    QueryString string
    The query string to execute against the specified log groups.
    ScheduleConfiguration Pulumi.AwsNative.CloudWatch.Inputs.LogAlarmScheduleConfiguration
    The schedule configuration.
    ScheduledQueryRoleArn string
    The ARN of the IAM role that grants permissions to execute the scheduled query.
    AggregationExpression string
    The aggregation expression for the scheduled query, e.g. count(*) or avg(latency) by host.
    LogGroupIdentifiers []string
    The log groups to query.
    QueryString string
    The query string to execute against the specified log groups.
    ScheduleConfiguration LogAlarmScheduleConfiguration
    The schedule configuration.
    ScheduledQueryRoleArn string
    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_identifiers list(string)
    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_role_arn string
    The ARN of the IAM role that grants permissions to execute the scheduled query.
    aggregationExpression String
    The aggregation expression for the scheduled query, e.g. count(*) or avg(latency) by host.
    logGroupIdentifiers List<String>
    The log groups to query.
    queryString String
    The query string to execute against the specified log groups.
    scheduleConfiguration LogAlarmScheduleConfiguration
    The schedule configuration.
    scheduledQueryRoleArn String
    The ARN of the IAM role that grants permissions to execute the scheduled query.
    aggregationExpression string
    The aggregation expression for the scheduled query, e.g. count(*) or avg(latency) by host.
    logGroupIdentifiers string[]
    The log groups to query.
    queryString string
    The query string to execute against the specified log groups.
    scheduleConfiguration LogAlarmScheduleConfiguration
    The schedule configuration.
    scheduledQueryRoleArn string
    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_identifiers Sequence[str]
    The log groups to query.
    query_string str
    The query string to execute against the specified log groups.
    schedule_configuration LogAlarmScheduleConfiguration
    The schedule configuration.
    scheduled_query_role_arn str
    The ARN of the IAM role that grants permissions to execute the scheduled query.
    aggregationExpression String
    The aggregation expression for the scheduled query, e.g. count(*) or avg(latency) by host.
    logGroupIdentifiers List<String>
    The log groups to query.
    queryString String
    The query string to execute against the specified log groups.
    scheduleConfiguration Property Map
    The schedule configuration.
    scheduledQueryRoleArn String
    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.
    Key string
    The key name of the tag
    Value string
    The value of the tag
    Key string
    The key name of the tag
    Value string
    The value of the tag
    key string
    The key name of the tag
    value string
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag
    key string
    The key name of the tag
    value string
    The value of the tag
    key str
    The key name of the tag
    value str
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo

    We recommend new projects start with resources from the AWS provider.

    Viewing docs for AWS Cloud Control v1.69.0
    published on Monday, Jun 15, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial