interface CronOptions
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.CloudWatch.CronOptions |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#CronOptions |
Java | software.amazon.awscdk.services.cloudwatch.CronOptions |
Python | aws_cdk.aws_cloudwatch.CronOptions |
TypeScript (source) | aws-cdk-lib » aws_cloudwatch » CronOptions |
Options to configure a cron expression.
All fields are strings so you can use complex expressions. Absence of a field implies '*'.
Example
declare const alarm1: cloudwatch.Alarm;
declare const alarm2: cloudwatch.Alarm;
const alarmMuteRule = new cloudwatch.AlarmMuteRule(this, '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.
alarmMuteRule.addAlarm(alarm2);
Properties
| Name | Type | Description |
|---|---|---|
| minute | string | The minute to run this rule at. |
| day? | string | The day of the month to run this rule at. |
| hour? | string | The hour to run this rule at. |
| month? | string | The month to run this rule at. |
| time | Time | The timezone to run the schedule in. |
| week | string | The day of the week to run this rule at. |
minute
Type:
string
The minute to run this rule at.
day?
Type:
string
(optional, default: Every day of the month)
The day of the month to run this rule at.
hour?
Type:
string
(optional, default: Every hour)
The hour to run this rule at.
month?
Type:
string
(optional, default: Every month)
The month to run this rule at.
timeZone?
Type:
Time
(optional, default: TimeZone.ETC_UTC)
The timezone to run the schedule in.
weekDay?
Type:
string
(optional, default: Any day of the week)
The day of the week to run this rule at.

.NET
Go
Java
Python
TypeScript (