Skip to main content

RunMicrovmRequest

Struct RunMicrovmRequest 

Source
pub struct RunMicrovmRequest {
Show 13 fields pub image_identifier: String, pub image_version: Option<String>, pub execution_role_arn: Option<String>, pub connectors: Vec<ConnectorIntent>, pub egress_network_connectors: Vec<String>, pub run_hook_payload: RunHookPayload, pub max_duration_sec: u32, pub max_idle_sec: u32, pub suspended_sec: u32, pub auto_resume: bool, pub token_scope: Option<String>, pub client_token: Option<String>, pub logging: Option<Logging>,
}
Expand description

Everything RunMicrovm needs.

run_hook_payload is a RunHookPayload, which cannot hold an over-ceiling value — so TRAP-5 is closed before this struct exists rather than checked when it is used.

Fields§

§image_identifier: String

The image ARN or ID to launch.

§image_version: Option<String>

imageVersion, or None for the image’s own latest active version.

§The launch half of blue/green

None is what this client always sent, and it means “whatever latestActiveImageVersion is now” — which is right for the ordinary case and wrong for the two that matter. A canary wants to launch against exactly the version it is testing, not against whatever became latest while it was starting. And a rollback wants to re-pin to the known-good version, which “latest” cannot express at all once a bad version is the latest one.

With ControlPlane::set_image_version_status the three moves compose: build v2, canary-launch pinned to v2, and on failure set v2 INACTIVE and re-pin to v1. A version set INACTIVE refuses to launch when pinned here, which is what makes the retire real rather than advisory.

Checked against the Version shape before the call — see require_valid_version on why a rollback is the worst moment for a rejection about the request.

§execution_role_arn: Option<String>

The execution role. Optional in the model; every real launch needs one.

§connectors: Vec<ConnectorIntent>

The connectors to request, as intents (TRAP-4). Ingress is required for a session to work at all; omitting egress omits the connector from the request (measured 2026-09-12: the platform gave the VM outbound network anyway, docs/PLATFORM.md).

§egress_network_connectors: Vec<String>

Customer-managed Lambda VPC egress connector ARNs, created through lambda-core. Cannot be combined with ConnectorIntent::Egress. Internet isolation requires a VPC without an internet gateway or NAT gateway; an ARN alone proves no isolation.

§run_hook_payload: RunHookPayload

The already-validated payload carrying the agent token.

§max_duration_sec: u32

maximumDurationInSeconds, checked against 1..=28800 when the request is sent.

§max_idle_sec: u32

idlePolicy.maxIdleDurationSeconds, checked against the model’s min: 60 before the call.

This comment used to say the guard was deliberately absent, because min is one of the four keys botocore’s VALIDATED_METADATA_ATTRS enforces locally. True of botocore, and this client never touches it — see require_idle_duration. 59 reached the wire.

§suspended_sec: u32

idlePolicy.suspendedDurationSeconds.

The model’s min is 0, so every u32 satisfies it and there is no guard — an absence with a reason rather than an oversight, and the drift gate pins the 0 so a future floor is noticed. Its ceiling is unstated.

The requested value drives the local resume window. The service also reports its active policy in Microvm::idle_policy.

§auto_resume: bool

idlePolicy.autoResumeEnabled.

§token_scope: Option<String>

A label for the run token, defaulting to the image identifier (TRAP-1).

§client_token: Option<String>

Optional durable launch idempotency key. Reuse only for retries of one launch, with identical parameters and run-hook payload. None preserves fresh defaults. Never derive this from an image name or reuse it for a different VM.

§logging: Option<Logging>

Per-VM logging: a CloudWatch group (and optional exact stream) or disabled. None leaves the service’s default destination in place (#201).

Implementations§

Source§

impl RunMicrovmRequest

Source

pub fn new( image_identifier: impl Into<String>, run_hook_payload: RunHookPayload, ) -> RunMicrovmRequest

A launch with the measured defaults: ingress only, ten-minute idle and suspended windows, a one-hour maximum duration, no auto-resume.

Source

pub fn with_egress(self) -> RunMicrovmRequest

Requests the managed internet egress connector. Omission does not block internet access.

Source

pub fn with_egress_network_connector( self, arn: impl Into<String>, ) -> RunMicrovmRequest

Routes egress through a customer-managed Lambda network connector.

Source

pub fn with_shell(self) -> RunMicrovmRequest

Requests a shell-capable launch: the ingress set becomes the measured pair, [HTTP_INGRESS, SHELL_INGRESS].

Replaces ALL_INGRESS rather than adding beside it, because the platform forbids the combination and says so only at token-mint time — the VM launches, reaches RUNNING, and bills before the failure appears (docs/PLATFORM.md, 2026-08-15). [HTTP_INGRESS, SHELL_INGRESS] is the set measured to both launch and mint a shell token, and HTTP_INGRESS stays in the pair so the daemon endpoint keeps working. Egress is untouched: shell access and outbound network are separate questions.

Source

pub fn with_image_version(self, version: impl Into<String>) -> RunMicrovmRequest

Pins the launch to one imageVersion. See the field for why that matters.

Trait Implementations§

Source§

impl Clone for RunMicrovmRequest

Source§

fn clone(&self) -> RunMicrovmRequest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RunMicrovmRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more