turbot/aws_thrifty
Loading controls...

Control: EC2 reserved instances scheduled for expiration should be reviewed

Description

EC2 reserved instances that are scheduled for expiration or have expired in the preceding 30 days should be reviewed.

Usage

Run the control in your terminal:

powerpipe control run aws_thrifty.control.ec2_reserved_instance_lease_expiration_days

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_thrifty.control.ec2_reserved_instance_lease_expiration_days --share

Steampipe Tables

Params

ArgsNameDefaultDescriptionVariable
$1ec2_reserved_instance_expiration_warning_days
30
The number of days reserved instances can be running before sending a warning.

SQL

select
reserved_instance_id as resource,
case
when date_part('day', end_time - now()) <= $1 then 'alarm'
else 'ok'
end as status,
title || ' lease expires in ' || date_part('day', end_time - now()) || ' days.' as reason,
region,
account_id
from
aws_ec2_reserved_instance;

Tags