Fail State

The Fail class acts as a end state of a state machine branch, signifying the state machine failed.

For more details on Fail, see the AWS documentation.

class awssl.Fail(Name='', Comment='', ErrorName='', ErrorCause='')

Models the Fail state, which terminates the state machine with an error code.

Parameters:
  • Name (str) – [Required] The name of the state within the branch of the state machine
  • Comment (str) – [Optional] A comment describing the intent of this fail state
  • ErrorName (str) – [Optional] A code to identify the error causing the failed state
  • ErrorCause (str) – [Optional] More detailed information on the cause of the error
clone(NameFormatString='{}')

Returns a clone of this instance, with the clone named per the NameFormatString, to avoid state name clashes.

If this instance is not an end state, then the next state will also be cloned, to establish a complete clone of the branch form this instance onwards.

Parameters:NameFormatString (str) – [Required] The naming template to be applied to generate the name of the new instance.
Returns:Fail – A new instance of this instance and any other instances in its branch.
get_error_cause()

Returns the more detailed cause of the error that is associated with this instance.

Returns:str – The cause of the error associated with this instance
get_error_name()

Returns the error name that is associated with this Fail instance

Returns:str – The error name associated with this instance
set_error_cause(ErrorCause='')

Set the cause of the error associated with this instance.

Parameters:ErrorCause (str) – [Optional] More detailed information on the cause of the error
set_error_name(ErrorName='')

Set the error name to be associated with this instance.

Parameters:ErrorName (str) – [Optional] A code to identify the error causing the failed state.
to_json()

Returns the JSON representation of this instance.

Returns:dict – The JSON representation
validate()

Validates this instance is correctly specified.

Raises Exception with details of the error, if the state machine is incorrectly defined.