steampipe plugin install aws

Table: aws_sfn_state_machine_execution_history - Query AWS Step Functions State Machine Execution History using SQL

The AWS Step Functions State Machine Execution History is a feature of AWS Step Functions that allows you to track the execution history of your state machines. It provides a detailed, near real-time, view of the step-by-step progress of each execution. This helps in monitoring workflows, diagnosing issues, and understanding the state transitions in your applications.

Table Usage Guide

The aws_sfn_state_machine_execution_history table in Steampipe provides you with information about the execution history of a state machine within AWS Step Functions. This table allows you, as a DevOps engineer, to query execution-specific details, including execution status, start and end dates, input and output data, and associated metadata. You can utilize this table to gather insights on state machine executions, such as the status of executions, duration of executions, and verification of input and output data. The schema outlines the various attributes of the state machine execution history for you, including the execution ARN, state entered time, state exited time, and state name.

Examples

Basic info

Analyze the history of AWS Step Functions state machine executions to understand the sequence and timing of events. This can be useful for debugging purposes or gaining insights into workflow performance and efficiency.

select
id,
execution_arn,
previous_event_id,
timestamp,
type
from
aws_sfn_state_machine_execution_history;
select
id,
execution_arn,
previous_event_id,
timestamp,
type
from
aws_sfn_state_machine_execution_history;

List execution started event details

This query can be used to gain insights into the specific details of events that initiated the execution of a process in a state machine. It's particularly useful in monitoring and debugging scenarios, where understanding the input and role associated with the start of an execution can help identify potential issues or inefficiencies.

select
id,
execution_arn,
execution_started_event_details -> 'Input' as event_input,
execution_started_event_details -> 'InputDetails' as event_input_details,
execution_started_event_details ->> 'RoleArn' as event_role_arn
from
aws_sfn_state_machine_execution_history
where
type = 'ExecutionStarted';
select
id,
execution_arn,
json_extract(execution_started_event_details, '$.Input') as event_input,
json_extract(execution_started_event_details, '$.InputDetails') as event_input_details,
json_extract(execution_started_event_details, '$.RoleArn') as event_role_arn
from
aws_sfn_state_machine_execution_history
where
type = 'ExecutionStarted';

Schema for aws_sfn_state_machine_execution_history

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The AWS Account ID in which the resource is located.
activity_failed_event_detailsjsonbContains details about an activity that failed during an execution.
activity_schedule_failed_event_detailsjsonbContains details about an activity schedule event that failed during an execution.
activity_scheduled_event_detailsjsonbContains details about an activity scheduled during an execution.
activity_started_event_detailsjsonbContains details about the start of an activity during an execution.
activity_succeeded_event_detailsjsonbContains details about an activity that successfully terminated during an execution.
activity_timed_out_event_detailsjsonbContains details about an activity timeout that occurred during an execution.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
execution_aborted_event_detailsjsonbContains details about an abort of an execution.
execution_arntextThe Amazon Resource Name (ARN) that identifies the execution.
execution_failed_event_detailsjsonbContains details about an execution failure event.
execution_started_event_detailsjsonbContains details about the start of the execution.
execution_succeeded_event_detailsjsonbContains details about the successful termination of the execution.
execution_timed_out_event_detailsjsonbContains details about the execution timeout that occurred during the execution.
idtextThe id of the event.
lambda_function_failed_event_detailsjsonbContains details about a lambda function that failed during an execution.
lambda_function_schedule_failed_event_detailsjsonbContains details about a failed lambda function schedule event that occurred during an execution.
lambda_function_scheduled_event_detailsjsonbContains details about a lambda function scheduled during an execution.
lambda_function_start_failed_event_detailsjsonbContains details about a lambda function that failed to start during an execution.
lambda_function_succeeded_event_detailsjsonbContains details about a lambda function that terminated successfully during an execution.
lambda_function_timed_out_event_detailsjsonbContains details about a lambda function timeout that occurred during an execution.
map_iteration_aborted_event_detailsjsonbContains details about an iteration of a Map state that was aborted.
map_iteration_failed_event_detailsjsonbContains details about an iteration of a Map state that failed.
map_iteration_started_event_detailsjsonbContains details about an iteration of a Map state that was started.
map_iteration_succeeded_event_detailsjsonbContains details about an iteration of a Map state that succeeded.
map_state_started_event_detailsjsonbContains details about Map state that was started.
partitiontextThe AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov).
previous_event_idtextThe id of the previous event.
regiontextThe AWS Region in which the resource is located.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
state_entered_event_detailsjsonbContains details about a state entered during an execution.
state_exited_event_detailsjsonbContains details about an exit from a state during an execution.
task_failed_event_detailsjsonbContains details about the failure of a task.
task_scheduled_event_detailsjsonbContains details about a task that was scheduled.
task_start_failed_event_detailsjsonbContains details about a task that failed to start.
task_started_event_detailsjsonbContains details about a task that was started.
task_submit_failed_event_detailsjsonbContains details about a task that where the submit failed.
task_submitted_event_detailsjsonbContains details about a submitted task.
task_succeeded_event_detailsjsonbContains details about a task that succeeded.
task_timed_out_event_detailsjsonbContains details about a task that timed out.
timestamptimestamp with time zoneThe date and time the event occurred.
titletextTitle of the resource.
typetextThe type of the event.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws

You can pass the configuration to the command with the --config argument:

steampipe_export_aws --config '<your_config>' aws_sfn_state_machine_execution_history