Struct aws_sdk_ecs::types::ContainerRestartPolicy
source · #[non_exhaustive]pub struct ContainerRestartPolicy {
pub enabled: bool,
pub ignored_exit_codes: Option<Vec<i32>>,
pub restart_attempt_period: Option<i32>,
}Expand description
You can enable a restart policy for each container defined in your task definition, to overcome transient failures faster and maintain task availability. When you enable a restart policy for a container, Amazon ECS can restart the container if it exits, without needing to replace the task. For more information, see Restart individual containers in Amazon ECS tasks with container restart policies in the Amazon Elastic Container Service Developer Guide.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enabled: boolSpecifies whether a restart policy is enabled for the container.
ignored_exit_codes: Option<Vec<i32>>A list of exit codes that Amazon ECS will ignore and not attempt a restart on. You can specify a maximum of 50 container exit codes. By default, Amazon ECS does not ignore any exit codes.
restart_attempt_period: Option<i32>A period of time (in seconds) that the container must run for before a restart can be attempted. A container can be restarted only once every restartAttemptPeriod seconds. If a container isn't able to run for this time period and exits early, it will not be restarted. You can set a minimum restartAttemptPeriod of 60 seconds and a maximum restartAttemptPeriod of 1800 seconds. By default, a container must run for 300 seconds before it can be restarted.
Implementations§
source§impl ContainerRestartPolicy
impl ContainerRestartPolicy
sourcepub fn ignored_exit_codes(&self) -> &[i32]
pub fn ignored_exit_codes(&self) -> &[i32]
A list of exit codes that Amazon ECS will ignore and not attempt a restart on. You can specify a maximum of 50 container exit codes. By default, Amazon ECS does not ignore any exit codes.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .ignored_exit_codes.is_none().
sourcepub fn restart_attempt_period(&self) -> Option<i32>
pub fn restart_attempt_period(&self) -> Option<i32>
A period of time (in seconds) that the container must run for before a restart can be attempted. A container can be restarted only once every restartAttemptPeriod seconds. If a container isn't able to run for this time period and exits early, it will not be restarted. You can set a minimum restartAttemptPeriod of 60 seconds and a maximum restartAttemptPeriod of 1800 seconds. By default, a container must run for 300 seconds before it can be restarted.
source§impl ContainerRestartPolicy
impl ContainerRestartPolicy
sourcepub fn builder() -> ContainerRestartPolicyBuilder
pub fn builder() -> ContainerRestartPolicyBuilder
Creates a new builder-style object to manufacture ContainerRestartPolicy.
Trait Implementations§
source§impl Clone for ContainerRestartPolicy
impl Clone for ContainerRestartPolicy
source§fn clone(&self) -> ContainerRestartPolicy
fn clone(&self) -> ContainerRestartPolicy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ContainerRestartPolicy
impl Debug for ContainerRestartPolicy
source§impl PartialEq for ContainerRestartPolicy
impl PartialEq for ContainerRestartPolicy
impl StructuralPartialEq for ContainerRestartPolicy
Auto Trait Implementations§
impl Freeze for ContainerRestartPolicy
impl RefUnwindSafe for ContainerRestartPolicy
impl Send for ContainerRestartPolicy
impl Sync for ContainerRestartPolicy
impl Unpin for ContainerRestartPolicy
impl UnwindSafe for ContainerRestartPolicy
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more