pub struct EcsRuntime { /* private fields */ }Expand description
Docker/Podman executor for ECS tasks.
Implementations§
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.
pub fn cli_name(&self) -> &str
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.
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.
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.
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 the container behind a task (if any) with the configured stop
timeout. Returns true if a container was killed. Called synchronously
from StopTask; the wait loop in run_task_inner observes the
exit and transitions the task to STOPPED.