create_maintenance_window
async
¶
create_maintenance_window(
name: MaintenanceWindowName,
schedule: MaintenanceWindowSchedule,
duration: MaintenanceWindowDurationHours,
cutoff: MaintenanceWindowCutoff,
allow_unassociated_targets: MaintenanceWindowAllowUnassociatedTargets,
*,
config_overrides: Optional[AsyncSSMClientConfig] = None,
description: Optional[MaintenanceWindowDescription] = None,
start_date: Optional[MaintenanceWindowStringDateTime] = None,
end_date: Optional[MaintenanceWindowStringDateTime] = None,
schedule_timezone: Optional[MaintenanceWindowTimezone] = None,
schedule_offset: Optional[MaintenanceWindowOffset] = None,
client_token: Optional[ClientToken] = None,
tags: Optional[TagList] = None,
) -> CreateMaintenanceWindowResult
Creates a new maintenance window.
The value you specify for Duration determines the specific end time for the maintenance window based on the time it begins. No maintenance window tasks are permitted to start after the resulting endtime minus the number of hours you specify for Cutoff. For example, if the maintenance window starts at 3 PM, the duration is three hours, and the value you specify for Cutoff is one hour, no maintenance window tasks can start after 5 PM.
Parameters:
-
name(MaintenanceWindowName) –The name of the maintenance window.
-
description(Optional[MaintenanceWindowDescription], default:None) –An optional description for the maintenance window. We recommend specifying a description to help you organize your maintenance windows.
-
start_date(Optional[MaintenanceWindowStringDateTime], default:None) –The date and time, in ISO-8601 Extended format, for when you want the maintenance window to become active.
StartDateallows you to delay activation of the maintenance window until the specified future date.When using a rate schedule, if you provide a start date that occurs in the past, the current date and time are used as the start date.
-
end_date(Optional[MaintenanceWindowStringDateTime], default:None) –The date and time, in ISO-8601 Extended format, for when you want the maintenance window to become inactive.
EndDateallows you to set a date and time in the future when the maintenance window will no longer run. -
schedule(MaintenanceWindowSchedule) –The schedule of the maintenance window in the form of a cron or rate expression.
-
schedule_timezone(Optional[MaintenanceWindowTimezone], default:None) –The time zone that the scheduled maintenance window executions are based on, in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the Time Zone Database on the IANA website.
-
schedule_offset(Optional[MaintenanceWindowOffset], default:None) –The number of days to wait after the date and time specified by a cron expression before running the maintenance window.
For example, the following cron expression schedules a maintenance window to run on the third Tuesday of every month at 11:30 PM.
cron(30 23 ? * TUE#3 *)If the schedule offset is
2, the maintenance window won't run until two days later. -
duration(MaintenanceWindowDurationHours) –The duration of the maintenance window in hours.
-
cutoff(MaintenanceWindowCutoff) –The number of hours before the end of the maintenance window that Amazon Web Services Systems Manager stops scheduling new tasks for execution.
-
allow_unassociated_targets(MaintenanceWindowAllowUnassociatedTargets) –Enables a maintenance window task to run on managed nodes, even if you haven't registered those nodes as targets. If enabled, then you must specify the unregistered managed nodes (by node ID) when you register a task with the maintenance window.
If you don't enable this option, then you must specify previously-registered targets when you register a task with the maintenance window.
-
client_token(Optional[ClientToken], default:None) –User-provided idempotency token.
-
tags(Optional[TagList], default:None) –Optional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag a maintenance window to identify the type of tasks it will run, the types of targets, and the environment it will run in. In this case, you could specify the following key-value pairs:
-
Key=TaskType,Value=AgentUpdate -
Key=OS,Value=Windows -
Key=Environment,Value=Production
To add tags to an existing maintenance window, use the AddTagsToResource operation.
-
Raises:
-
IdempotentParameterMismatch–Error returned when an idempotent operation is retried and the parameters don't match the original call to the API with the same idempotency token.
-
InternalServerError–An error occurred on the server side.
-
ResourceLimitExceededException–Error returned when the caller has exceeded the default resource quotas. For example, too many maintenance windows or patch baselines have been created.
For information about resource quotas in Systems Manager, see Systems Manager service quotas in the Amazon Web Services General Reference.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ssm/_services/async_ssm.py
1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 | |