AWS Lambda Finite State Machines

A Python framework for developing finite state machine-based workflows on AWS Lambda.

View project on GitHub
« Justification Chaos »

Settings

The behaviour of the framework is controlled by a few important settings

Event Streaming

It is valid, but not useful, to specify the same value for each.

AWS ARN for AWS Kinesis is the preferred value since it

  1. keeps a record of the entire history of the state machine
  2. allows a stalled state machine to be restored from a checkpoint and replayed
  3. append-only logs and state machines are very, very related logs & fsm

Checkpointing

  • settings.PRIMARY_CHECKPOINT_SOURCE controls the primary location for checkpoint messages. Valid values are AWS ARNs for AWS DynamoDB.
  • settings.SECONDARY_CHECKPOINT_SOURCE controls the secondary/failover location for checkpoint messages. Valid values are AWS ARNs for AWS DynamoDB.

It is valid, but not useful, to specify the same value for each.

AWS ARN for AWS DynamoDB is the preferred value since it

  1. persists even when the state machine dies

Retries

It is valid, but not useful, to specify the same value for each.

AWS ARNs for AWS DynamoDB and AWS SQS are the preferred value since they

  1. enable retry with backoff
  2. other settings kick off retries, but with no backoff, since there is not way to delay a AWS Kinesis or AWS SNS message.

Environment

  • settings.PRIMARY_ENVIRONMENT_SOURCE controls the primary location for environment messages. Valid values are AWS ARNs for AWS DynamoDB.
  • settings.SECONDARY_ENVIRONMENT_SOURCE controls the secondary/failover location for environment messages. Valid values are AWS ARNs for AWS DynamoDB.

It is valid, but not useful, to specify the same value for each.

AWS ARN for AWS DynamoDB is the preferred value since it

  1. persists even when the state machine dies

Cache

  • settings.PRIMARY_CACHE_SOURCE controls the primary location for cache messages. Valid values are AWS ARNs for Elasticache and AWS DynamoDB.
  • settings.SECONDARY_CACHE_SOURCE controls the secondary/failover location for cache messages. Valid values are AWS ARNs for Elasticache and AWS DynamoDB.

It is valid, but not useful, to specify the same value for each.

AWS ARN for AWS DynamoDB is the preferred value since it

  1. persists even when the state machine dies

Metrics

  • settings.PRIMARY_METRICS_SOURCE controls the primary location for metrics messages. Valid values are AWS ARNs for AWS CloudWatch.
  • settings.SECONDARY_METRICS_SOURCE metrics failover is currently NOT SUPPORTED

AWS ARN for AWS CloudWatch is the preferred value since it

  1. is a tightly integrated AWS custom metrics solution
« Justification Chaos »