Struct aws_sdk_ecs::operation::update_task_protection::builders::UpdateTaskProtectionFluentBuilder
source · pub struct UpdateTaskProtectionFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to UpdateTaskProtection
.
Updates the protection status of a task. You can set protectionEnabled
to true
to protect your task from termination during scale-in events from Service Autoscaling or deployments.
Task-protection, by default, expires after 2 hours at which point Amazon ECS clears the protectionEnabled
property making the task eligible for termination by a subsequent scale-in event.
You can specify a custom expiration period for task protection from 1 minute to up to 2,880 minutes (48 hours). To specify the custom expiration period, set the expiresInMinutes
property. The expiresInMinutes
property is always reset when you invoke this operation for a task that already has protectionEnabled
set to true
. You can keep extending the protection expiration period of a task by invoking this operation repeatedly.
To learn more about Amazon ECS task protection, see Task scale-in protection in the Amazon Elastic Container Service Developer Guide .
This operation is only supported for tasks belonging to an Amazon ECS service. Invoking this operation for a standalone task will result in an TASK_NOT_VALID
failure. For more information, see API failure reasons.
If you prefer to set task protection from within the container, we recommend using the Task scale-in protection endpoint.
Implementations§
source§impl UpdateTaskProtectionFluentBuilder
impl UpdateTaskProtectionFluentBuilder
sourcepub fn as_input(&self) -> &UpdateTaskProtectionInputBuilder
pub fn as_input(&self) -> &UpdateTaskProtectionInputBuilder
Access the UpdateTaskProtection as a reference.
sourcepub async fn send(
self
) -> Result<UpdateTaskProtectionOutput, SdkError<UpdateTaskProtectionError, HttpResponse>>
pub async fn send( self ) -> Result<UpdateTaskProtectionOutput, SdkError<UpdateTaskProtectionError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub async fn customize(
self
) -> Result<CustomizableOperation<UpdateTaskProtectionOutput, UpdateTaskProtectionError>, SdkError<UpdateTaskProtectionError>>
pub async fn customize( self ) -> Result<CustomizableOperation<UpdateTaskProtectionOutput, UpdateTaskProtectionError>, SdkError<UpdateTaskProtectionError>>
Consumes this builder, creating a customizable operation that can be modified before being sent.
sourcepub fn cluster(self, input: impl Into<String>) -> Self
pub fn cluster(self, input: impl Into<String>) -> Self
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service that the task sets exist in.
sourcepub fn set_cluster(self, input: Option<String>) -> Self
pub fn set_cluster(self, input: Option<String>) -> Self
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service that the task sets exist in.
sourcepub fn get_cluster(&self) -> &Option<String>
pub fn get_cluster(&self) -> &Option<String>
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service that the task sets exist in.
sourcepub fn tasks(self, input: impl Into<String>) -> Self
pub fn tasks(self, input: impl Into<String>) -> Self
Appends an item to tasks
.
To override the contents of this collection use set_tasks
.
A list of up to 10 task IDs or full ARN entries.
sourcepub fn set_tasks(self, input: Option<Vec<String>>) -> Self
pub fn set_tasks(self, input: Option<Vec<String>>) -> Self
A list of up to 10 task IDs or full ARN entries.
sourcepub fn get_tasks(&self) -> &Option<Vec<String>>
pub fn get_tasks(&self) -> &Option<Vec<String>>
A list of up to 10 task IDs or full ARN entries.
sourcepub fn protection_enabled(self, input: bool) -> Self
pub fn protection_enabled(self, input: bool) -> Self
Specify true
to mark a task for protection and false
to unset protection, making it eligible for termination.
sourcepub fn set_protection_enabled(self, input: Option<bool>) -> Self
pub fn set_protection_enabled(self, input: Option<bool>) -> Self
Specify true
to mark a task for protection and false
to unset protection, making it eligible for termination.
sourcepub fn get_protection_enabled(&self) -> &Option<bool>
pub fn get_protection_enabled(&self) -> &Option<bool>
Specify true
to mark a task for protection and false
to unset protection, making it eligible for termination.
sourcepub fn expires_in_minutes(self, input: i32) -> Self
pub fn expires_in_minutes(self, input: i32) -> Self
If you set protectionEnabled
to true
, you can specify the duration for task protection in minutes. You can specify a value from 1 minute to up to 2,880 minutes (48 hours). During this time, your task will not be terminated by scale-in events from Service Auto Scaling or deployments. After this time period lapses, protectionEnabled
will be reset to false
.
If you don’t specify the time, then the task is automatically protected for 120 minutes (2 hours).
sourcepub fn set_expires_in_minutes(self, input: Option<i32>) -> Self
pub fn set_expires_in_minutes(self, input: Option<i32>) -> Self
If you set protectionEnabled
to true
, you can specify the duration for task protection in minutes. You can specify a value from 1 minute to up to 2,880 minutes (48 hours). During this time, your task will not be terminated by scale-in events from Service Auto Scaling or deployments. After this time period lapses, protectionEnabled
will be reset to false
.
If you don’t specify the time, then the task is automatically protected for 120 minutes (2 hours).
sourcepub fn get_expires_in_minutes(&self) -> &Option<i32>
pub fn get_expires_in_minutes(&self) -> &Option<i32>
If you set protectionEnabled
to true
, you can specify the duration for task protection in minutes. You can specify a value from 1 minute to up to 2,880 minutes (48 hours). During this time, your task will not be terminated by scale-in events from Service Auto Scaling or deployments. After this time period lapses, protectionEnabled
will be reset to false
.
If you don’t specify the time, then the task is automatically protected for 120 minutes (2 hours).
Trait Implementations§
source§impl Clone for UpdateTaskProtectionFluentBuilder
impl Clone for UpdateTaskProtectionFluentBuilder
source§fn clone(&self) -> UpdateTaskProtectionFluentBuilder
fn clone(&self) -> UpdateTaskProtectionFluentBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more