pub struct EcsRuntime { /* private fields */ }Expand description
Docker/Podman executor for ECS tasks.
Implementations§
Source§impl EcsRuntime
impl EcsRuntime
Sourcepub fn with_secretsmanager(self, state: SharedSecretsManagerState) -> Self
pub fn with_secretsmanager(self, state: SharedSecretsManagerState) -> Self
Wire SecretsManager state so secrets[].valueFrom entries
pointing at SecretsManager ARNs resolve at task launch.
Sourcepub fn with_ssm(self, state: SharedSsmState) -> Self
pub fn with_ssm(self, state: SharedSsmState) -> Self
Wire SSM state so secrets[].valueFrom entries pointing at
Parameter Store ARNs resolve at task launch.
Source§impl EcsRuntime
impl EcsRuntime
Sourcepub fn run_task(
self: Arc<Self>,
state: SharedEcsState,
task_id: String,
account_id: String,
)
pub fn run_task( self: Arc<Self>, state: SharedEcsState, task_id: String, account_id: String, )
Spawn the task asynchronously. Returns immediately after transitioning
the task to PENDING; the background task advances it to RUNNING
once the container is created and to STOPPED once the container
exits.
pub async fn run_task_inner( &self, state: &SharedEcsState, task_id: &str, account_id: &str, ) -> Result<(), RuntimeError>
Sourcepub async fn stop_task(&self, task_id: &str, reason: &str) -> bool
pub async fn stop_task(&self, task_id: &str, reason: &str) -> bool
Kill every container behind a task with the configured stop
timeout. Returns true if at least one container was killed. Called
synchronously from StopTask; the wait loop in run_task_inner
observes the exits and transitions the task to STOPPED.
Source§impl EcsRuntime
impl EcsRuntime
Sourcepub fn new(server_port: u16) -> Option<Self>
pub fn new(server_port: u16) -> Option<Self>
Auto-detect Docker or Podman. Returns None if neither is
available. Honours FAKECLOUD_CONTAINER_CLI for explicit override.
server_port is the port the main fakecloud server bound to;
needed to resolve AWS ECR URIs against the local OCI v2 registry.
Sourcepub async fn new_k8s(server_port: u16) -> Result<Self, BackendInitError>
pub async fn new_k8s(server_port: u16) -> Result<Self, BackendInitError>
Construct the Kubernetes backend. server_port is fakecloud’s
bound port (used when FAKECLOUD_K8S_SELF_URL omits one). Fails
fast on misconfiguration — never silently degrades to Docker.
Sourcepub async fn reap_stale(&self)
pub async fn reap_stale(&self)
Sweep task Pods orphaned by a previous process (k8s only; no-op on the Docker backend, handled by the shared container reaper).
Sourcepub fn with_delivery_bus(self, bus: Arc<DeliveryBus>) -> Self
pub fn with_delivery_bus(self, bus: Arc<DeliveryBus>) -> Self
Wire EventBridge delivery so task state transitions emit
aws.ecs / ECS Task State Change events.
Sourcepub fn with_logs(self, logs: SharedLogsState) -> Self
pub fn with_logs(self, logs: SharedLogsState) -> Self
Wire CloudWatch Logs state so tasks using the awslogs driver
get their captured stdout/stderr forwarded.
Auto Trait Implementations§
impl !Freeze for EcsRuntime
impl !RefUnwindSafe for EcsRuntime
impl !UnwindSafe for EcsRuntime
impl Send for EcsRuntime
impl Sync for EcsRuntime
impl Unpin for EcsRuntime
impl UnsafeUnpin for EcsRuntime
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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