From 42cf3f75dc23e07a410622d1d0063bbd55ca7815 Mon Sep 17 00:00:00 2001 From: Abel Luck Date: Thu, 5 Mar 2026 16:03:34 +0100 Subject: [PATCH] handle missing assumed role in aws alerts --- ops_bot/aws.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ops_bot/aws.py b/ops_bot/aws.py index 5f2d7e7..ed8a1c6 100644 --- a/ops_bot/aws.py +++ b/ops_bot/aws.py @@ -92,7 +92,7 @@ def handle_cloudtrail_sts(payload: Any) -> List[Tuple[str, str]]: for x in [ f"**🚨 ALERT[{subject}]** : {title}", f"- **Region**: {region}", - f"- **Assumed Role**: {assumed_role}", + (f"- **Assumed Role**: {assumed_role}" if assumed_role else None), f"- **Event Time**: {event_time}", f"- **Account ID**: {account_id}", ]