CronOptions

class aws_cdk.aws_cloudwatch.CronOptions(*, minute, day=None, hour=None, month=None, time_zone=None, week_day=None)

Bases: object

Options to configure a cron expression.

All fields are strings so you can use complex expressions. Absence of a field implies ‘*’.

Parameters:
  • minute (str) – The minute to run this rule at.

  • day (Optional[str]) – The day of the month to run this rule at. Default: - Every day of the month

  • hour (Optional[str]) – The hour to run this rule at. Default: - Every hour

  • month (Optional[str]) – The month to run this rule at. Default: - Every month

  • time_zone (Optional[TimeZone]) – The timezone to run the schedule in. Default: - TimeZone.ETC_UTC

  • week_day (Optional[str]) – The day of the week to run this rule at. Default: - Any day of the week

See:

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/alarm-mute-rules.html#defining-alarm-mute-rules

ExampleMetadata:

infused

Example:

# alarm1: cloudwatch.Alarm
# alarm2: cloudwatch.Alarm


alarm_mute_rule = cloudwatch.AlarmMuteRule(self, "AlarmMuteRule",
    alarms=[alarm1],
    # Defines the mute period begins at 0:00 everyday in UTC
    schedule=cloudwatch.ScheduleExpression.cron(minute="0", hour="0"),
    # Specifies the mute rule lasts 1 hour.
    duration=Duration.hours(1)
)

# The mute target can be added after construction.
alarm_mute_rule.add_alarm(alarm2)

Attributes

day

The day of the month to run this rule at.

Default:
  • Every day of the month

hour

The hour to run this rule at.

Default:
  • Every hour

minute

The minute to run this rule at.

month

The month to run this rule at.

Default:
  • Every month

time_zone

The timezone to run the schedule in.

Default:
  • TimeZone.ETC_UTC

week_day

The day of the week to run this rule at.

Default:
  • Any day of the week