Skip to content

EC2  >  Operations  >  modify_instance_event_window

modify_instance_event_window

Operation

modify_instance_event_window async

modify_instance_event_window(request: ModifyInstanceEventWindowInput | ModifyInstanceEventWindowInputDict, /, *, plugins: list[Plugin] | None = None) -> ModifyInstanceEventWindowOutput
modify_instance_event_window(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[ModifyInstanceEventWindowInputDict]) -> ModifyInstanceEventWindowOutput

Modifies the specified event window.

You can define either a set of time ranges or a cron expression when modifying the event window, but not both.

To modify the targets associated with the event window, use the AssociateInstanceEventWindow and DisassociateInstanceEventWindow API.

If Amazon Web Services has already scheduled an event, modifying an event window won't change the time of the scheduled event.

For more information, see Define event windows for scheduled events in the Amazon EC2 User Guide.

Parameters:

Name Type Description Default
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
ModifyInstanceEventWindowOutput

An instance of ModifyInstanceEventWindowOutput.

Input

Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.

Model

ModifyInstanceEventWindowInput dataclass

Bases: _SerdeShape

Dataclass for ModifyInstanceEventWindowInput structure.

Attributes
cron_expression class-attribute instance-attribute
cron_expression: str | None = ...

The cron expression of the event window, for example, * 0-4,20-23 * * 1,5.

Constraints:

  • Only hour and day of the week values are supported.

  • For day of the week values, you can specify either integers 0 through 6, or alternative single values SUN through SAT.

  • The minute, month, and year must be specified by *.

  • The hour value must be one or a multiple range, for example, 0-4 or 0-4,20-23.

  • Each hour range must be >= 2 hours, for example, 0-2 or 20-23.

  • The event window must be >= 4 hours. The combined total time ranges in the event window must be >= 4 hours.

For more information about cron expressions, see cron on the Wikipedia website.

dry_run class-attribute instance-attribute
dry_run: bool | None = ...

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

instance_event_window_id class-attribute instance-attribute
instance_event_window_id: str | None = ...

The ID of the event window.

name class-attribute instance-attribute
name: str | None = ...

The name of the event window.

time_ranges class-attribute instance-attribute
time_ranges: list[InstanceEventWindowTimeRangeRequest] | None = ...

The time ranges of the event window.

Dictionaries

ModifyInstanceEventWindowInputDict

Bases: TypedDict

Dictionary form of ModifyInstanceEventWindowInput.

Attributes
cron_expression instance-attribute
cron_expression: str | None

The cron expression of the event window, for example, * 0-4,20-23 * * 1,5.

Constraints:

  • Only hour and day of the week values are supported.

  • For day of the week values, you can specify either integers 0 through 6, or alternative single values SUN through SAT.

  • The minute, month, and year must be specified by *.

  • The hour value must be one or a multiple range, for example, 0-4 or 0-4,20-23.

  • Each hour range must be >= 2 hours, for example, 0-2 or 20-23.

  • The event window must be >= 4 hours. The combined total time ranges in the event window must be >= 4 hours.

For more information about cron expressions, see cron on the Wikipedia website.

dry_run instance-attribute
dry_run: bool | None

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

instance_event_window_id instance-attribute
instance_event_window_id: Required[str]

The ID of the event window.

name instance-attribute
name: str | None

The name of the event window.

time_ranges instance-attribute

The time ranges of the event window.

Output

ModifyInstanceEventWindowOutput dataclass

Bases: _SerdeShape

Dataclass for ModifyInstanceEventWindowOutput structure.

Attributes

instance_event_window class-attribute instance-attribute
instance_event_window: InstanceEventWindow | None = ...

Information about the event window.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.