turbot/steampipe-mod-aws-compliance

Control: Ensure no AWS EC2 Instances are older than 180 days

Description

Identify any running AWS EC2 instances older than 180 days.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.ec2_instance_not_older_than_180_days

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_compliance.control.ec2_instance_not_older_than_180_days --share

SQL

This control uses a named query:

select
instance_id as resource,
launch_time,
case
when launch_time >= (current_date - interval '180 days') then 'ok'
else 'alarm'
end as status,
title || ' created ' || to_char(launch_time , 'DD-Mon-YYYY') || ' (' || extract(day from current_timestamp - launch_time) || ' days).' as reason
, region, account_id
from
aws_ec2_instance;

Tags