From 17ae48d420ca2cd115845a001586beecc1731031 Mon Sep 17 00:00:00 2001 From: rjulian Date: Mon, 21 Sep 2020 00:32:21 -0700 Subject: [PATCH] Fix for event payload parsing --- source/reflex_aws_config_rule_deleted.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/reflex_aws_config_rule_deleted.py b/source/reflex_aws_config_rule_deleted.py index 64a3666..e8410ac 100644 --- a/source/reflex_aws_config_rule_deleted.py +++ b/source/reflex_aws_config_rule_deleted.py @@ -34,8 +34,9 @@ def get_remediation_message(self): def lambda_handler(event, _): """ Handles the incoming event """ print(event) - if subscription_confirmation.is_subscription_confirmation(event): - subscription_confirmation.confirm_subscription(event) + event_payload = json.loads(event["Records"][0]["body"]) + if subscription_confirmation.is_subscription_confirmation(event_payload): + subscription_confirmation.confirm_subscription(event_payload) return - rule = ConfigRuleDeleted(json.loads(event["Records"][0]["body"])) + rule = ConfigRuleDeleted(event_payload) rule.run_compliance_rule()