AWS Step Functions

  • Written in JSON
  • Visualization of the workflow and the execution of the workflow, as well as history
  • Start workflow with SDK call, API Gateway, Event Bridge (CloudWatch Event)

Step Function — Task States

  • Do some work in your state machine
  • Invoke one AWS service
    💎 Can invoke a Lambda function
    💎 Run an AWS Batch job
    💎 Run an ECS task and wait for it to complete
    💎 Insert an item from DynamoDB
    💎 Publish message to SNS, SQS
    💎 Launch another Step Function workflow…
  • Run an Activity
    💎 EC2, Amazon ECS, on-premises
    💎 Activities poll the Step Functions for work
    💎 Activities send results to Step Functions

Step Function — States

  • Choice State — Test for a condition to send to a branch
  • Fail or Succeed State — Stop execution with failure or success
  • Pass State —Simply pass its input to its output or inject some fixed data, without performing work
  • Wait State — Provide a delay for a certain amount of time or until a specified time/date
  • Map State — Dynamically iterate steps
  • Parallel State — Begin parallel branches of execution

Error Handling in Step Functions

  • Any state can encounter runtime errors for various reasons:
    👺 State machine definition issues (for example, no matching rule in a Choice state)
    👺 Task failures (for example, an exception in a Lambda function)
    👺 Transient issues (for example, network partition events)
  • Use Retry (to retry failed state) and Catch (transition to failure path) in the State MAchine to handle the errors instead of inside the Application Code
  • Predefined error codes:
    🚌 States.All: matches any error name
    🚌 States.Timeout: Task ran longer than TimeoutSeconds or no heartbeat received
    🚌 States.TaskFailed: execution failure
    🚌 States.Permissions: insufficient privileges to execute code
  • The state may report its own errors

AWS AppSync Overview

  • AppSync is a managed service that uses GraphQL
  • GraphQL makes it easy for application to get exactly the data they need
  • This includes combining data from one or more sources
    🏎 NoSQL data stores, Relational databases, HTTP APIs…
    🏎 Integrates with DynamoDB, Aurora, Elastisearch & others
    🏎 Custom sources with AWS Lambda
  • Retrieve data in real-time with WebSocket or MQTT on WebSocket
  • For mobile apps: local data access & data synchronization
  • It all starts with uploading one GraphQL schema

AppSync Security

  • There are four ways you can authorize applications to interact with your AWS AppSync GraphQL API:
  • API_KEY
  • AWS_IAM
  • OPENID_CONNECT
  • AMAZON_COGNITO_USER_POOLS
  • For custom domain & HTTPS, use CloudFront in front of AppSync

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store