pub struct StackResourceState {Show 19 fields
pub resource_type: String,
pub internal_state: Option<Value>,
pub status: ResourceStatus,
pub display_name: Option<String>,
pub description: Option<String>,
pub progress: Option<String>,
pub outputs: Option<ResourceOutputs>,
pub config: Resource,
pub previous_config: Option<Resource>,
pub retry_attempt: u32,
pub error: Option<AlienError>,
pub lifecycle: Option<ResourceLifecycle>,
pub controller_platform: Option<Platform>,
pub dependencies: Vec<ResourceRef>,
pub last_failed_state: Option<Value>,
pub remote_binding_params: Option<Value>,
pub external_binding: bool,
pub dependency_update_pending: bool,
pub requested_update_ran: Option<String>,
}Expand description
Represents the state of a single resource within the stack for a specific platform.
Fields§
§resource_type: StringThe high-level type of the resource (e.g., Worker::RESOURCE_TYPE, Storage::RESOURCE_TYPE).
internal_state: Option<Value>The platform-specific resource controller that manages this resource’s lifecycle. This is None when the resource status is Pending. Stored as JSON to make the struct serializable and movable to alien-core.
status: ResourceStatusHigh-level status derived from the internal state.
display_name: Option<String>Presentation metadata from the effective resource entry, outside runtime configuration.
description: Option<String>§progress: Option<String>Last reported step explanation for display only; not a machine-readable status.
outputs: Option<ResourceOutputs>Outputs generated by the resource (e.g., ARN, URL, Bucket Name).
config: ResourceThe current resource configuration.
previous_config: Option<Resource>The previous resource configuration during updates. This is set when an update is initiated and cleared when the update completes or fails.
retry_attempt: u32Tracks consecutive retry attempts for the current state transition.
error: Option<AlienError>Stores the last error encountered during a failed step transition.
lifecycle: Option<ResourceLifecycle>The lifecycle of the resource (Frozen or Live). Defaults to Live if not specified.
controller_platform: Option<Platform>Platform whose controller owns this resource state. Defaults to the containing stack platform when absent.
dependencies: Vec<ResourceRef>Complete list of dependencies for this resource, including infrastructure dependencies. This preserves the full dependency information from the stack definition.
last_failed_state: Option<Value>Stores the controller state that failed, used for manual retry operations. This allows resuming from the exact point where the failure occurred. Stored as JSON to make the struct serializable and movable to alien-core.
remote_binding_params: Option<Value>Binding parameters for remote access.
Only populated when the resource has remote_access: true in its ResourceEntry.
This is the JSON serialization of the binding configuration (e.g., StorageBinding, VaultBinding).
Populated by controllers during provisioning using get_binding_params().
external_binding: boolWhether this resource was adopted from an external binding instead of provisioned. The binding may exist only where the adopting executor ran (a Helm value or a chart-created database), so the record carries it: deleting the resource releases it and never touches what the binding points at.
dependency_update_pending: boolWhether this resource owes an update because a dependency is changing, though its own config is not. The update waits until the dependency has rolled to the release being applied, so the owed update must survive between plans and restarts. Cleared when the update starts. State written before this field existed reads as not owing one.
requested_update_ran: Option<String>The rollout in which an update ran because the controller asked for one while the config was unchanged. While the controller keeps asking in that same rollout, its dependents no longer wait for it, so a check that never settles cannot hold them back for good. A later rollout is a new request and is waited for again. Cleared once the controller stops asking. State written before this field existed (it was a flag then) reads as none.
Implementations§
Source§impl StackResourceState
impl StackResourceState
Sourcepub fn builder() -> StackResourceStateBuilder
pub fn builder() -> StackResourceStateBuilder
Create an instance of StackResourceState using the builder syntax
Source§impl StackResourceState
impl StackResourceState
Sourcepub fn new_pending(
resource_type: String,
config: Resource,
lifecycle: Option<ResourceLifecycle>,
dependencies: Vec<ResourceRef>,
) -> Self
pub fn new_pending( resource_type: String, config: Resource, lifecycle: Option<ResourceLifecycle>, dependencies: Vec<ResourceRef>, ) -> Self
Creates a new pending StackResourceState for a resource that’s about to be created
Sourcepub fn with_updates<F>(&self, update_fn: F) -> Selfwhere
F: FnOnce(&mut Self),
pub fn with_updates<F>(&self, update_fn: F) -> Selfwhere
F: FnOnce(&mut Self),
Creates a new StackResourceState based on this one, with only the specified fields modified
Sourcepub fn with_failure(&self, status: ResourceStatus, error: AlienError) -> Self
pub fn with_failure(&self, status: ResourceStatus, error: AlienError) -> Self
Creates a new StackResourceState with the status changed to a failure state and error set