diff --git a/cloud_governance/policy/common_policies/send_aggregated_alerts.py b/cloud_governance/policy/common_policies/send_aggregated_alerts.py index 3be205cf..e65732ce 100644 --- a/cloud_governance/policy/common_policies/send_aggregated_alerts.py +++ b/cloud_governance/policy/common_policies/send_aggregated_alerts.py @@ -141,7 +141,7 @@ def __update_delete_days(self, policy_es_data: list): days = int(days) if not days: days = 0 - alert_user = False + alert_user = True if self.__alert_dry_run else False delete_date = 'dry_run=yes' if not record.get('Skip'): record['Skip'] = 'NA' @@ -165,7 +165,7 @@ def __update_delete_days(self, policy_es_data: list): delete_date = 'dry_run=yes' alert_user = True if alert_user: - if delete_date != 'skip_delete' and (delete_date != 'dry_run=yes' and self.__alert_dry_run): + if (delete_date != 'skip_delete' and delete_date != 'dry_run=yes') or self.__alert_dry_run: record['DeleteDate'] = delete_date.__str__() if record.get('policy') in ['empty_roles', 's3_inactive']: record['RegionName'] = 'us-east-1'