Created
August 2, 2024 23:13
-
-
Save ataylor284/482ac72e6a9862a61e24b8ed65106223 to your computer and use it in GitHub Desktop.
Redrive failed AWS state machines in FAILED state
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
THREADS=4 | |
STATE_MACHINE_ARN="$1" | |
FILE=failed_arns.txt | |
REGION=us-west-2 | |
echo "writing failed execution arns to $FILE" | |
aws stepfunctions list-executions --state-machine-arn=$STATE_MACHINE_ARN --status-filter FAILED --region $REGION --query 'executions[].[executionArn]' --output=text > $FILE | |
wc -l $FILE | |
# use xargs to do multiple in parallel | |
cat $FILE | xargs -L 1 -P $THREADS aws stepfunctions redrive-execution --output=text --execution-arn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment