aws_sdk_ssm/client/
update_maintenance_window_task.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`UpdateMaintenanceWindowTask`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`window_id(impl Into<String>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::window_id) / [`set_window_id(Option<String>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::set_window_id):<br>required: **true**<br><p>The maintenance window ID that contains the task to modify.</p><br>
7    ///   - [`window_task_id(impl Into<String>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::window_task_id) / [`set_window_task_id(Option<String>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::set_window_task_id):<br>required: **true**<br><p>The task ID to modify.</p><br>
8    ///   - [`targets(Target)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::targets) / [`set_targets(Option<Vec::<Target>>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::set_targets):<br>required: **false**<br><p>The targets (either managed nodes or tags) to modify. Managed nodes are specified using the format <code>Key=instanceids,Values=instanceID_1,instanceID_2</code>. Tags are specified using the format <code> Key=tag_name,Values=tag_value</code>.</p><note>  <p>One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html">Registering maintenance window tasks without targets</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p> </note><br>
9    ///   - [`task_arn(impl Into<String>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::task_arn) / [`set_task_arn(Option<String>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::set_task_arn):<br>required: **false**<br><p>The task ARN to modify.</p><br>
10    ///   - [`service_role_arn(impl Into<String>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::service_role_arn) / [`set_service_role_arn(Option<String>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::set_service_role_arn):<br>required: **false**<br><p>The Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services Systems Manager to assume when running a maintenance window task. If you do not specify a service role ARN, Systems Manager uses a service-linked role in your account. If no appropriate service-linked role for Systems Manager exists in your account, it is created when you run <code>RegisterTaskWithMaintenanceWindow</code>.</p> <p>However, for an improved security posture, we strongly recommend creating a custom policy and custom service role for running your maintenance window tasks. The policy can be crafted to provide only the permissions needed for your particular maintenance window tasks. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-maintenance-permissions.html">Setting up Maintenance Windows</a> in the in the <i>Amazon Web Services Systems Manager User Guide</i>.</p><br>
11    ///   - [`task_parameters(impl Into<String>, MaintenanceWindowTaskParameterValueExpression)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::task_parameters) / [`set_task_parameters(Option<HashMap::<String, MaintenanceWindowTaskParameterValueExpression>>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::set_task_parameters):<br>required: **false**<br><p>The parameters to modify.</p><note>  <p><code>TaskParameters</code> has been deprecated. To specify parameters to pass to a task when it runs, instead use the <code>Parameters</code> option in the <code>TaskInvocationParameters</code> structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see <code>MaintenanceWindowTaskInvocationParameters</code>.</p> </note> <p>The map has the following format:</p> <p>Key: string, between 1 and 255 characters</p> <p>Value: an array of strings, each string is between 1 and 255 characters</p><br>
12    ///   - [`task_invocation_parameters(MaintenanceWindowTaskInvocationParameters)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::task_invocation_parameters) / [`set_task_invocation_parameters(Option<MaintenanceWindowTaskInvocationParameters>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::set_task_invocation_parameters):<br>required: **false**<br><p>The parameters that the task should use during execution. Populate only the fields that match the task type. All other fields should be empty.</p><important>  <p>When you update a maintenance window task that has options specified in <code>TaskInvocationParameters</code>, you must provide again all the <code>TaskInvocationParameters</code> values that you want to retain. The values you don't specify again are removed. For example, suppose that when you registered a Run Command task, you specified <code>TaskInvocationParameters</code> values for <code>Comment</code>, <code>NotificationConfig</code>, and <code>OutputS3BucketName</code>. If you update the maintenance window task and specify only a different <code>OutputS3BucketName</code> value, the values for <code>Comment</code> and <code>NotificationConfig</code> are removed.</p> </important><br>
13    ///   - [`priority(i32)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::priority) / [`set_priority(Option<i32>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::set_priority):<br>required: **false**<br><p>The new task priority to specify. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.</p><br>
14    ///   - [`max_concurrency(impl Into<String>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::max_concurrency) / [`set_max_concurrency(Option<String>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::set_max_concurrency):<br>required: **false**<br><p>The new <code>MaxConcurrency</code> value you want to specify. <code>MaxConcurrency</code> is the number of targets that are allowed to run this task, in parallel.</p><note>  <p>Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html">targetless task</a> You must provide a value in all other cases.</p>  <p>For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of <code>1</code>. This value doesn't affect the running of your task.</p> </note><br>
15    ///   - [`max_errors(impl Into<String>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::max_errors) / [`set_max_errors(Option<String>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::set_max_errors):<br>required: **false**<br><p>The new <code>MaxErrors</code> value to specify. <code>MaxErrors</code> is the maximum number of errors that are allowed before the task stops being scheduled.</p><note>  <p>Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html">targetless task</a> You must provide a value in all other cases.</p>  <p>For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of <code>1</code>. This value doesn't affect the running of your task.</p> </note><br>
16    ///   - [`logging_info(LoggingInfo)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::logging_info) / [`set_logging_info(Option<LoggingInfo>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::set_logging_info):<br>required: **false**<br><p>The new logging location in Amazon S3 to specify.</p><note>  <p><code>LoggingInfo</code> has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use the <code>OutputS3BucketName</code> and <code>OutputS3KeyPrefix</code> options in the <code>TaskInvocationParameters</code> structure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see <code>MaintenanceWindowTaskInvocationParameters</code>.</p> </note><br>
17    ///   - [`name(impl Into<String>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::name) / [`set_name(Option<String>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::set_name):<br>required: **false**<br><p>The new task name to specify.</p><br>
18    ///   - [`description(impl Into<String>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::description) / [`set_description(Option<String>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::set_description):<br>required: **false**<br><p>The new task description to specify.</p><br>
19    ///   - [`replace(bool)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::replace) / [`set_replace(Option<bool>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::set_replace):<br>required: **false**<br><p>If True, then all fields that are required by the <code>RegisterTaskWithMaintenanceWindow</code> operation are also required for this API request. Optional fields that aren't specified are set to null.</p><br>
20    ///   - [`cutoff_behavior(MaintenanceWindowTaskCutoffBehavior)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::cutoff_behavior) / [`set_cutoff_behavior(Option<MaintenanceWindowTaskCutoffBehavior>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::set_cutoff_behavior):<br>required: **false**<br><p>Indicates whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.</p> <ul>  <li>   <p><code>CONTINUE_TASK</code>: When the cutoff time is reached, any tasks that are running continue. The default value.</p></li>  <li>   <p><code>CANCEL_TASK</code>:</p>   <ul>    <li>     <p>For Automation, Lambda, Step Functions tasks: When the cutoff time is reached, any task invocations that are already running continue, but no new task invocations are started.</p></li>    <li>     <p>For Run Command tasks: When the cutoff time is reached, the system sends a <code>CancelCommand</code> operation that attempts to cancel the command associated with the task. However, there is no guarantee that the command will be terminated and the underlying process stopped.</p></li>   </ul>   <p>The status for tasks that are not completed is <code>TIMED_OUT</code>.</p></li> </ul><br>
21    ///   - [`alarm_configuration(AlarmConfiguration)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::alarm_configuration) / [`set_alarm_configuration(Option<AlarmConfiguration>)`](crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::set_alarm_configuration):<br>required: **false**<br><p>The CloudWatch alarm you want to apply to your maintenance window task.</p><br>
22    /// - On success, responds with [`UpdateMaintenanceWindowTaskOutput`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput) with field(s):
23    ///   - [`window_id(Option<String>)`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput::window_id): <p>The ID of the maintenance window that was updated.</p>
24    ///   - [`window_task_id(Option<String>)`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput::window_task_id): <p>The task ID of the maintenance window that was updated.</p>
25    ///   - [`targets(Option<Vec::<Target>>)`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput::targets): <p>The updated target values.</p>
26    ///   - [`task_arn(Option<String>)`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput::task_arn): <p>The updated task ARN value.</p>
27    ///   - [`service_role_arn(Option<String>)`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput::service_role_arn): <p>The Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services Systems Manager to assume when running a maintenance window task. If you do not specify a service role ARN, Systems Manager uses a service-linked role in your account. If no appropriate service-linked role for Systems Manager exists in your account, it is created when you run <code>RegisterTaskWithMaintenanceWindow</code>.</p> <p>However, for an improved security posture, we strongly recommend creating a custom policy and custom service role for running your maintenance window tasks. The policy can be crafted to provide only the permissions needed for your particular maintenance window tasks. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-maintenance-permissions.html">Setting up Maintenance Windows</a> in the in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
28    ///   - [`task_parameters(Option<HashMap::<String, MaintenanceWindowTaskParameterValueExpression>>)`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput::task_parameters): <p>The updated parameter values.</p><note>  <p><code>TaskParameters</code> has been deprecated. To specify parameters to pass to a task when it runs, instead use the <code>Parameters</code> option in the <code>TaskInvocationParameters</code> structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see <code>MaintenanceWindowTaskInvocationParameters</code>.</p> </note>
29    ///   - [`task_invocation_parameters(Option<MaintenanceWindowTaskInvocationParameters>)`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput::task_invocation_parameters): <p>The updated parameter values.</p>
30    ///   - [`priority(i32)`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput::priority): <p>The updated priority value.</p>
31    ///   - [`max_concurrency(Option<String>)`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput::max_concurrency): <p>The updated <code>MaxConcurrency</code> value.</p>
32    ///   - [`max_errors(Option<String>)`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput::max_errors): <p>The updated <code>MaxErrors</code> value.</p>
33    ///   - [`logging_info(Option<LoggingInfo>)`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput::logging_info): <p>The updated logging information in Amazon S3.</p><note>  <p><code>LoggingInfo</code> has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use the <code>OutputS3BucketName</code> and <code>OutputS3KeyPrefix</code> options in the <code>TaskInvocationParameters</code> structure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see <code>MaintenanceWindowTaskInvocationParameters</code>.</p> </note>
34    ///   - [`name(Option<String>)`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput::name): <p>The updated task name.</p>
35    ///   - [`description(Option<String>)`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput::description): <p>The updated task description.</p>
36    ///   - [`cutoff_behavior(Option<MaintenanceWindowTaskCutoffBehavior>)`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput::cutoff_behavior): <p>The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.</p>
37    ///   - [`alarm_configuration(Option<AlarmConfiguration>)`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskOutput::alarm_configuration): <p>The details for the CloudWatch alarm you applied to your maintenance window task.</p>
38    /// - On failure, responds with [`SdkError<UpdateMaintenanceWindowTaskError>`](crate::operation::update_maintenance_window_task::UpdateMaintenanceWindowTaskError)
39    pub fn update_maintenance_window_task(
40        &self,
41    ) -> crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder {
42        crate::operation::update_maintenance_window_task::builders::UpdateMaintenanceWindowTaskFluentBuilder::new(self.handle.clone())
43    }
44}