Table: aws_rds_reserved_db_instance - Query AWS RDS Reserved DB Instances using SQL
The AWS RDS Reserved DB Instance is a reservation of resources within the Amazon Relational Database Service. This reservation allows you to receive a significant discount, compared to the on-demand instance pricing, by committing to a one or three year term for using DB Instances. It provides a cost-effective solution to reserve capacity for your Amazon RDS instances in a specific region.
Table Usage Guide
The aws_rds_reserved_db_instance
table in Steampipe provides you with information about Reserved DB Instances within Amazon Relational Database Service (RDS). This table enables you, as a database administrator or DevOps engineer, to query detailed information about reserved instances, including the reservation identifier, instance type, duration, and associated costs. You can utilize this table to gather insights on your reserved instances, such as understanding cost allocation, planning capacity, and managing reservations. The schema outlines the various attributes of the Reserved DB Instance for you, including the reservation ARN, offering type, recurring charges, and associated tags.
Examples
Basic info
Explore the status and details of your reserved database instances in AWS RDS to better manage your database resources and costs.
select reserved_db_instance_id, arn, reserved_db_instances_offering_id, state, classfrom aws_rds_reserved_db_instance;
select reserved_db_instance_id, arn, reserved_db_instances_offering_id, state, classfrom aws_rds_reserved_db_instance;
List reserved DB instances with multi-AZ disabled
Identify instances where the database instances reserved on AWS RDS do not have the multi-Availability Zone feature enabled. This is useful to pinpoint potential areas of vulnerability in your database architecture, as disabling multi-AZ can impact data redundancy and failover support.
select reserved_db_instance_id, arn, reserved_db_instances_offering_id, state, classfrom aws_rds_reserved_db_instancewhere not multi_az;
select reserved_db_instance_id, arn, reserved_db_instances_offering_id, state, classfrom aws_rds_reserved_db_instancewhere multi_az = 0;
List reserved DB instances with offering type All Upfront
Identify instances where database reservations have been made with an 'All Upfront' offering type in AWS RDS. This can be useful for cost analysis and budgeting as it highlights where upfront payments have been made for database services.
select reserved_db_instance_id, arn, reserved_db_instances_offering_id, state, classfrom aws_rds_reserved_db_instancewhere offering_type = 'All Upfront';
select reserved_db_instance_id, arn, reserved_db_instances_offering_id, state, classfrom aws_rds_reserved_db_instancewhere offering_type = 'All Upfront';
List reserved DB instances order by duration
Discover the segments that have reserved database instances, organized by their duration. This can be particularly useful for prioritizing and managing resources effectively within your AWS RDS environment.
select reserved_db_instance_id, arn, reserved_db_instances_offering_id, state, classfrom aws_rds_reserved_db_instanceorder by duration desc;
select reserved_db_instance_id, arn, reserved_db_instances_offering_id, state, classfrom aws_rds_reserved_db_instanceorder by duration desc;
List reserved DB instances order by usage price
Identify the most expensive reserved database instances in your AWS RDS service. This can help prioritize cost management efforts and optimize your cloud resource allocation.
select reserved_db_instance_id, arn, reserved_db_instances_offering_id, state, class, usage_pricefrom aws_rds_reserved_db_instanceorder by usage_price desc;
select reserved_db_instance_id, arn, reserved_db_instances_offering_id, state, class, usage_pricefrom aws_rds_reserved_db_instanceorder by usage_price desc;
List reserved DB instances which are not active
Explore which reserved database instances are not currently active. This can help in managing resources and costs by identifying unused or underutilized instances.
select reserved_db_instance_id, arn, reserved_db_instances_offering_id, state, class, usage_pricefrom aws_rds_reserved_db_instancewhere state <> 'active';
select reserved_db_instance_id, arn, reserved_db_instances_offering_id, state, class, usage_pricefrom aws_rds_reserved_db_instancewhere state != 'active';
Schema for aws_rds_reserved_db_instance
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
arn | text | The Amazon Resource Name (ARN) for the reserved DB Instance. | |
class | text | = | The DB instance class for the reserved DB instance. |
currency_code | text | The currency code for the reserved DB instance. | |
db_instance_count | bigint | The number of reserved DB instances. | |
duration | bigint | = | The duration of the reservation in seconds. |
fixed_price | double precision | The fixed price charged for this reserved DB instance. | |
lease_id | text | = | The unique identifier for the lease associated with the reserved DB instance. |
multi_az | boolean | = | Indicates if the reservation applies to Multi-AZ deployments. |
offering_type | text | = | The offering type of this reserved DB instance. |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
product_description | text | The description of the reserved DB instance. | |
recurring_charges | jsonb | The recurring price charged to run this reserved DB instance. | |
region | text | The AWS Region in which the resource is located. | |
reserved_db_instance_id | text | = | The unique identifier for the reservation. |
reserved_db_instances_offering_id | text | = | The offering identifier. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
start_time | timestamp with time zone | The time the reservation started. | |
state | text | The state of the reserved DB instance. | |
title | text | Title of the resource. | |
usage_price | double precision | The hourly price charged for this reserved DB instance. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_rds_reserved_db_instance