Created
July 6, 2018 22:39
-
-
Save xbrianh/f0acb4086e03696f6df44ab66315873c to your computer and use it in GitHub Desktop.
Search for Visitation Lambda service errors
This file contains 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
#!/usr/bin/env python | |
import boto3 | |
sf = boto3.client("stepfunctions") | |
failed = sf.list_executions( | |
stateMachineArn="arn:aws:states:us-east-1:861229788715:stateMachine:dss-visitation-dev", | |
statusFilter="FAILED", | |
)['executions'] | |
def events(execution_arn): | |
for page in sf.get_paginator("get_execution_history").paginate(executionArn=execution_arn): | |
for e in page['events']: | |
yield e | |
for ex in failed: | |
print(ex['startDate'], ex['executionArn']) | |
for e in events(ex['executionArn']): | |
try: | |
print(e['timestamp'], e['lambdaFunctionFailedEventDetails']) | |
except KeyError: | |
continue | |
print() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment