diff --git a/query/acm/acm_certificate_expires_30_days.sql b/query/acm/acm_certificate_expires_30_days.sql index 0d7abbe4..a4123ef2 100644 --- a/query/acm/acm_certificate_expires_30_days.sql +++ b/query/acm/acm_certificate_expires_30_days.sql @@ -3,16 +3,16 @@ select certificate_arn as resource, case when renewal_eligibility = 'INELIGIBLE' then 'skip' - when not_after <= (current_date - interval '30' day) then 'ok' + when date(not_after) - date(current_date) >= 30 then 'ok' else 'alarm' end as status, case when renewal_eligibility = 'INELIGIBLE' then title || ' not eligible for renewal.' else title || ' expires ' || to_char(not_after, 'DD-Mon-YYYY') || - ' (' || extract(day from not_after - current_timestamp) || ' days).' + ' (' || extract(day from not_after - current_date) || ' days).' end as reason, -- Additional Dimensions region, account_id from - aws_acm_certificate; + aws_acm_certificate; \ No newline at end of file