# CronOptions

Options to configure a cron expression.

All fields are strings so you can use complex expressions. Absence of
a field implies '*' or '?', whichever one is appropriate.

Used as argument in: [Schedule.cron](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.Schedule.html#cron)

- Source: [`aws-stepfunctions-tasks/lib/schedule.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/schedule.ts#L80)
- Type last changed: v2.168.0 · 20 Nov 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_stepfunctions_tasks as stepfunctions_tasks } from 'aws-cdk-lib';
const cronOptions: stepfunctions_tasks.CronOptions = {
  day: 'day',
  hour: 'hour',
  minute: 'minute',
  month: 'month',
  weekDay: 'weekDay',
  year: 'year',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_stepfunctions_tasks as stepfunctions_tasks

cron_options = stepfunctions_tasks.CronOptions(
    day="day",
    hour="hour",
    minute="minute",
    month="month",
    week_day="weekDay",
    year="year"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.stepfunctions.tasks.*;

CronOptions cronOptions = CronOptions.builder()
        .day("day")
        .hour("hour")
        .minute("minute")
        .month("month")
        .weekDay("weekDay")
        .year("year")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.StepFunctions.Tasks;

var cronOptions = new CronOptions {
    Day = "day",
    Hour = "hour",
    Minute = "minute",
    Month = "month",
    WeekDay = "weekDay",
    Year = "year"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cronOptions := &CronOptions{
	Day: jsii.String("day"),
	Hour: jsii.String("hour"),
	Minute: jsii.String("minute"),
	Month: jsii.String("month"),
	WeekDay: jsii.String("weekDay"),
	Year: jsii.String("year"),
}
```

## Properties

- `day`: string — The day of the month to run this rule at.

  **Default:** Every day of the month

- `hour`: string — The hour to run this rule at.

  **Default:** Every hour

- `minute`: string — The minute to run this rule at.

  **Default:** Every minute

- `month`: string — The month to run this rule at.

  **Default:** Every month

- `weekDay`: string — The day of the week to run this rule at.

  **Default:** Whichever day of the week that `day` falls on

- `year`: string — The year to run this rule at.

  **Default:** Every year
