Developing Solutions with AWS Step Functions Flashcards

1
Q

Which questions will have an answer with Step functions

A

I want to retry failed tasks.
I want to sequence tasks.
I want to try/catch/finally.
I want to select based on data.
I want to run tasks in parallel.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is AWS Step Functions

A

AWS Step Functions is a web service that enables you to coordinate the components of distributed applications and microservices using visual workflows.
It provides a way to coordinate components and step through the functions of your application.
It provides a graphical console to visualize the components of your applications as a series of steps.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The benefits of AWS Step Functions

A
  • Productivity => Build Applications Quickly
  • Agility => Scale and Recover Reliably
  • Adaptability => Evolve Applications Easily
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The words of Step Functions

A

State machine => Workflow template
Execution => Specific workflow based on a template
Task or State or State transition => Lambda function or activity
Activity => Handle for external output
Task token => ID for instance of activity
Heartbeat => Ping from task indicating that it is still running
Failure => When execution fails
Success => When execution succeeds

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What JSON tag specifies the starting state

A

“StartAt” tag

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can we identify a terminal state

A

A state with “Type”: “Succeed”, “Type”: “Fail”, or “End”: true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The requirements of states

A
  • They must have a Type field
  • They can have an optional Comment field
  • Each state (except a Succeed or Fail state) requires a Next field or, alternatively, can become a terminal state by specifying an End field.
  • A Choice state may have more than one Next but only one within each Choice Rule. A Choice state cannot use End.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The State types

A

Task => A single unit of work
Choice => Adds branching logic
Parallel => Fork and join the data across tasks
Wait => Delay for a specified time
Fail => Stops an execution and marks it as a failure
Succeed => Stops an execution successfully
Pass => Passes its input to its output
Map => Run a set of steps for each element of an input array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A task can be…

A
  • An activity consists of program code or a task that waits for an operator to perform an action or to provide input. You can host activities on Amazon EC2, on Amazon ECS, or even on mobile devices.
  • A Lambda function is a cloud-native task that runs on AWS Lambda.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The Control logic states

A
  • A Pass state (“Type”: “Pass”) simply passes its input to its output, performing no work. Pass states are useful when constructing and debugging state machines.
  • A Choice state (“Type”: “Choice”) adds branching logic to a state machine. A Choice state must have a Choices field whose value is a non-empty array, whose every element is an object called a Choice Rule.
  • The Parallel state (“Type”: “Parallel”) can be used to create parallel branches of implementation in your state machine.
  • A Wait state (“Type”: “Wait”) delays the state machine from continuing for a specified time.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Detail of Choice state

A

A Choice state must have a Choices field whose value is a non-empty array, whose every element is an object called a Choice Rule.

A Choice state may have more than one Next but only one within each Choice Rule. A Choice state cannot use End.

A Choice Rule contains the following:
• A comparison – Two fields that specify an input variable to compared, the type of comparison, and the value to compare the variable to.
• A Next field – The value of this field must match a state name in the state machine.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Fail and succeed state differences

A

A Fail state (“Type”: “Fail”) stops the run of the state machine and marks it as a failure.
The Fail state only allows the use of Type and Comment fields from the set of common state fields. In addition, the Fail state allows the following fields:
• Cause (Optional)Provides a custom failure string that can be used for operational or diagnostic purposes.
• Error (Optional)Provides an error name that can be used for error handling (Retry/Catch), operational or diagnostic purposes.

A Succeed state (“Type”: “Succeed”) stops a run successfully. The Succeed state is a useful target for Choice state branches that don’t do anything but stop the run.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly