# CfnInstanceEventWindowProps

Properties for defining a `CfnInstanceEventWindow`.

Used as props by: [CfnInstanceEventWindow](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnInstanceEventWindow.html)

- Source: Generated at build time
- Type last changed: v2.272.0 · 30 Sep 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const cfnInstanceEventWindowProps: ec2.CfnInstanceEventWindowProps = {
  cronExpression: 'cronExpression',
  name: 'name',
  tags: [{
    key: 'key',
    value: 'value',
  }],
  timeRanges: [{
    endHour: 123,
    endWeekDay: 'endWeekDay',
    startHour: 123,
    startWeekDay: 'startWeekDay',
  }],
};
```

Python:

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

cfn_instance_event_window_props = ec2.CfnInstanceEventWindowProps(
    cron_expression="cronExpression",
    name="name",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    time_ranges=[ec2.CfnInstanceEventWindow.TimeRangeProperty(
        end_hour=123,
        end_week_day="endWeekDay",
        start_hour=123,
        start_week_day="startWeekDay"
    )]
)
```

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.ec2.*;

CfnInstanceEventWindowProps cfnInstanceEventWindowProps = CfnInstanceEventWindowProps.builder()
        .cronExpression("cronExpression")
        .name("name")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .timeRanges(List.of(TimeRangeProperty.builder()
                .endHour(123)
                .endWeekDay("endWeekDay")
                .startHour(123)
                .startWeekDay("startWeekDay")
                .build()))
        .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.EC2;

var cfnInstanceEventWindowProps = new CfnInstanceEventWindowProps {
    CronExpression = "cronExpression",
    Name = "name",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } },
    TimeRanges = new [] { new TimeRangeProperty {
        EndHour = 123,
        EndWeekDay = "endWeekDay",
        StartHour = 123,
        StartWeekDay = "startWeekDay"
    } }
};
```

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"

cfnInstanceEventWindowProps := &CfnInstanceEventWindowProps{
	CronExpression: jsii.String("cronExpression"),
	Name: jsii.String("name"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	TimeRanges: []interface{}{
		&TimeRangeProperty{
			EndHour: jsii.Number(123),
			EndWeekDay: jsii.String("endWeekDay"),
			StartHour: jsii.Number(123),
			StartWeekDay: jsii.String("startWeekDay"),
		},
	},
}
```

## Properties

- `cronExpression`: string — The cron expression defined for the event window.

  Exactly one of TimeRanges or CronExpression must be specified.

- `name`: string — The name of the event window.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — The tags applied to the event window.

- `timeRanges`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnInstanceEventWindow.TimeRangeProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnInstanceEventWindow.TimeRangeProperty.html)[] — The time ranges of the event window.

  Exactly one of TimeRanges or CronExpression must be specified.
