Enum cloudformatious::ApplyError[][src]

pub enum ApplyError {
    CloudFormationApi(Box<dyn Error>),
    CreateChangeSetFailed {
        id: String,
        status: ChangeSetStatus,
        status_reason: String,
    },
    Failure {
        stack_id: String,
        stack_status: StackStatus,
        stack_status_reason: String,
        resource_events: Vec<(ResourceStatus, StackEventDetails)>,
    },
    Warning {
        output: ApplyOutput,
        resource_events: Vec<(ResourceStatus, StackEventDetails)>,
    },
}

Errors emitted by an apply operation.

Variants

CloudFormationApi(Box<dyn Error>)

A CloudFormation API error occurred.

This is likely to be due to invalid input parameters or missing CloudFormation permissions. The inner error should have a descriptive message.

Note: the inner error will always be some variant of RusotoError, but since they are generic over the type of service errors we either need a variant per API used, or Box. If you do need to programmatically match a particular API error you can use Box::downcast.

CreateChangeSetFailed

The change set failed to create.

Change sets are created asynchronously and may settle in a FAILED state. Trying to execute a FAILED change set will fail (who would have guessed). This error includes details of the failing change set to help diagnose errors.

Show fields

Fields of CreateChangeSetFailed

id: String

The id of the failed change set.

status: ChangeSetStatus

The status of the failed change set.

status_reason: String

The reason the change set failed to create.

Failure

The apply operation failed.

This error tries to capture enough information to quickly identify the root-cause of the operation’s failure (such as not having permission to create or update a particular resource in the stack).

Show fields

Fields of Failure

stack_id: String

The ID of the stack.

stack_status: StackStatus

The failed status in which the stack settled.

stack_status_reason: String

The first reason the stack moved into a failing state.

Note that this is not the reason associated with the current stack_status, but rather the reason for the first negative status the stack entered (which is usually more descriptive).

resource_events: Vec<(ResourceStatus, StackEventDetails)>

Resource events with negative statuses that may have precipitated the failure of the operation.

Note: this is represented as a Vec or tuples to avoid having to worry about matching StackEvent variants (when it would be a logical error for them to be anything other than the Resource variant).

Warning

The apply operation succeeded with warnings.

It is possible for resource errors to occur even when the overall operation succeeds, such as failing to delete a resource during clean-up after a successful update. Rather than letting this pass silently, or relying on carefully interrogating StackEvents, the operation returns an error.

Note that the error includes the ApplyOutput, since the stack did settle into a successful status. If you don’t care about non-critical resource errors you can use this to simply map this variant away:

let result = Err(ApplyError::Warning { output, resource_events });
result.or_else(|error| {
    if let ApplyError::Warning { output, .. } = error {
        Ok(output)
    } else {
        Err(error)
    }
})?;
Show fields

Fields of Warning

output: ApplyOutput

The operation output.

resource_events: Vec<(ResourceStatus, StackEventDetails)>

Resource events with negative statuses that did not affect the overall operation.

Note: this is represented as a Vec or tuples to avoid having to worry about matching StackEvent variants (when it would be a logical error for them to be anything other than the Resource variant).

Trait Implementations

impl Debug for ApplyError[src]

impl Display for ApplyError[src]

impl Error for ApplyError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.