From dd9221cb3a139036c3eea61769b97c1e267663d6 Mon Sep 17 00:00:00 2001 From: Khushboo <46913995+khushboo9024@users.noreply.github.com> Date: Wed, 16 Nov 2022 17:09:38 +0530 Subject: [PATCH] ACM certificate expiry Closes #524 (#525) --- query/acm/acm_certificate_expires_30_days.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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