pub struct StackResourceState {Show 13 fields
pub resource_type: String,
pub internal_state: Option<Value>,
pub status: ResourceStatus,
pub outputs: Option<ResourceOutputs>,
pub config: Resource,
pub previous_config: Option<Resource>,
pub retry_attempt: u32,
pub error: Option<AlienError>,
pub is_externally_provisioned: bool,
pub lifecycle: Option<ResourceLifecycle>,
pub dependencies: Vec<ResourceRef>,
pub last_failed_state: Option<Value>,
pub remote_binding_params: Option<Value>,
}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., Function::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.
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.
is_externally_provisioned: boolTrue if the resource was provisioned by an external system (e.g., CloudFormation). Defaults to false, indicating dynamic provisioning by the executor.
lifecycle: Option<ResourceLifecycle>The lifecycle of the resource (Frozen, Live, LiveOnSetup). Defaults to Live if not specified.
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().
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
Trait Implementations§
Source§impl Clone for StackResourceState
impl Clone for StackResourceState
Source§fn clone(&self) -> StackResourceState
fn clone(&self) -> StackResourceState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more