pub struct Image {
pub identifier: String,
pub name: String,
pub version: String,
pub state: String,
pub size: SizeClass,
pub log_group: Option<String>,
pub log_stream: Option<String>,
}Expand description
A built image, and the log group the service created alongside it.
Fields§
§identifier: StringThe image ARN, which is what imageIdentifier takes.
name: StringThe image name.
version: StringThe version the create call produced.
state: StringThe state the service last reported.
size: SizeClassThe class the requested baseline selected.
Carried on the image because billing follows the baseline requested at create time, and by the time anyone asks what a run cost the request is gone.
log_group: Option<String>The build log group the create call configured, or None for the service default
(Image::build_log_group’s derivation).
Carried for the same reason size is: by the time anyone asks where the build’s
logs went, the request is gone.
log_stream: Option<String>The resolved exact log stream the create call configured — the caller’s prefix
plus / plus the sixteen-hex per-build discriminator — or None when no stream
was configured.
This is the only place the resolved name exists: the discriminator is minted fresh
inside ControlPlane::create_image, so a caller who wants to read their build’s
logs has to read the name off this field rather than re-deriving it. The CLI’s
build envelope reports it as logStream for exactly that reason.
Implementations§
Source§impl Image
impl Image
Sourcepub fn build_log_group(&self) -> String
pub fn build_log_group(&self) -> String
The configured build log group, or the derived default
/aws/lambda-microvms/<image-name>.
The default is the group the service creates itself, so a Terraform stack never
owns it and terraform destroy leaves it behind — “the stack destroyed cleanly”
is not “the account is clean”. Six of these accumulated before anyone noticed. A
configured group (crate::control::CreateImageRequest::log_group) replaces the
derivation, because the derived name is then a group no build ever writes to.
Sourcepub fn is_ready(state: &str) -> bool
pub fn is_ready(state: &str) -> bool
Whether the state the service reported means “built and usable”.
Accepts the two model-backed spellings and the two tolerated ones. Kept generous because the service has answered differently across API versions, and a hard equality check on one spelling is how a working build looks like a stalled one.
Sourcepub fn is_failed(state: &str) -> bool
pub fn is_failed(state: &str) -> bool
Whether the state means the build failed.
A substring test rather than a set, because the model’s failure spellings are
CREATE_FAILED, UPDATE_FAILED, and DELETE_FAILED and the thing they share is
the word — matching that means a fourth added later is still recognised as a
failure rather than polled until the deadline.
Trait Implementations§
impl Eq for Image
impl StructuralPartialEq for Image
Auto Trait Implementations§
impl Freeze for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnsafeUnpin for Image
impl UnwindSafe for Image
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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