steampipe plugin install aws

Table: aws_rds_db_cluster_snapshot - Query AWS RDS DB Cluster Snapshots using SQL

The AWS RDS DB Cluster Snapshot is a feature of Amazon RDS that enables you to create a point-in-time snapshot of your database cluster. These snapshots are user-initiated backups of your entire DB Instance, capturing data at a particular moment in time. They can be used for backups, database replication, or for troubleshooting purposes.

Table Usage Guide

The aws_rds_db_cluster_snapshot table in Steampipe provides you with information about DB cluster snapshots within Amazon Relational Database Service (RDS). This table allows you, as a DevOps engineer or database administrator, to query snapshot-specific details, including snapshot status, creation time, engine version, and associated metadata. You can utilize this table to gather insights on snapshots, such as snapshot availability, storage used, and source DB cluster identifier. The schema outlines the various attributes of the DB cluster snapshot for you, including the snapshot ARN, snapshot type, VPC ID, and associated tags.

Examples

List of cluster snapshots which are not encrypted

Identify instances where your cluster snapshots are not encrypted. This is crucial to uncover potential security risks and ensure data protection compliance within your AWS RDS clusters.

select
db_cluster_snapshot_identifier,
type,
storage_encrypted,
split_part(kms_key_id, '/', 1) kms_key_id
from
aws_rds_db_cluster_snapshot
where
not storage_encrypted;
select
db_cluster_snapshot_identifier,
type,
storage_encrypted,
substr(kms_key_id, 1, instr(kms_key_id, '/') - 1) as kms_key_id
from
aws_rds_db_cluster_snapshot
where
not storage_encrypted;

Db cluster info of each snapshot

Discover the specifics of each database cluster snapshot, such as its creation time, engine type, version, and licensing model. This can be useful in understanding the historical configuration and performance of your database clusters.

select
db_cluster_snapshot_identifier,
cluster_create_time,
engine,
engine_version,
license_model
from
aws_rds_db_cluster_snapshot;
select
db_cluster_snapshot_identifier,
cluster_create_time,
engine,
engine_version,
license_model
from
aws_rds_db_cluster_snapshot;

Db cluster snapshot count per db cluster

Explore the distribution of snapshots across different database clusters. This can be useful for understanding backup habits and ensuring that data is being adequately protected across all clusters.

select
db_cluster_identifier,
count(db_cluster_snapshot_identifier) snapshot_count
from
aws_rds_db_cluster_snapshot
group by
db_cluster_identifier;
select
db_cluster_identifier,
count(db_cluster_snapshot_identifier) as snapshot_count
from
aws_rds_db_cluster_snapshot
group by
db_cluster_identifier;

List of manual db cluster snapshot

Explore which database cluster snapshots have been manually created within your AWS RDS service. This could be useful to track and manage backup strategies or to validate compliance with internal policies regarding data persistence.

select
db_cluster_snapshot_identifier,
engine,
type
from
aws_rds_db_cluster_snapshot
where
type = 'manual';
select
db_cluster_snapshot_identifier,
engine,
type
from
aws_rds_db_cluster_snapshot
where
type = 'manual';

Schema for aws_rds_db_cluster_snapshot

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The AWS Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
allocated_storagebigintSpecifies the allocated storage size in gibibytes (GiB).
arntextThe Amazon Resource Name (ARN) for the DB Cluster Snapshot.
availability_zonesjsonbA list of Availability Zones (AZs) where instances in the DB cluster snapshot can be restored.
cluster_create_timetimestamp with time zoneSpecifies the time when the DB cluster was created.
create_timetimestamp with time zoneThe time when the snapshot was taken.
db_cluster_identifiertext=The friendly name to identify the DB Cluster, that the snapshot snapshot was created from.
db_cluster_resource_idtextThe resource ID of the DB cluster that this DB cluster snapshot was created from.
db_cluster_snapshot_attributesjsonbA list of DB cluster snapshot attribute names and values for a manual DB cluster snapshot.
db_cluster_snapshot_identifiertext=The friendly name to identify the DB Cluster Snapshot.
enginetext=Specifies the name of the database engine.
engine_modetextThe engine mode of the database engine for this DB cluster snapshot.
engine_versiontextSpecifies the version of the database engine for this DB cluster snapshot.
iam_database_authentication_enabledbooleanSpecifies whether mapping of AWS Identity and Access Management (IAM) accounts to database accounts is enabled, or not.
kms_key_idtextThe AWS KMS key identifier for the AWS KMS customer master key (CMK).
license_modeltextProvides the license model information for this DB cluster snapshot.
master_user_nametextProvides the master username for the DB cluster snapshot.
partitiontextThe AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov).
percent_progressbigintSpecifies the percentage of the estimated data that has been transferred.
portbigintSpecifies the port that the DB cluster was listening on at the time of the snapshot.
regiontextThe AWS Region in which the resource is located.
snapshot_typetextThe type of the DB cluster snapshot.
source_db_cluster_snapshot_arntextThe Amazon Resource Name (ARN) for the source DB cluster snapshot, if the DB cluster snapshot was copied from a source DB cluster snapshot.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
statustextSpecifies the status of this DB Cluster Snapshot.
storage_encryptedbooleanSpecifies whether the DB cluster snapshot is encrypted, or not.
tagsjsonbA map of tags for the resource.
tags_srcjsonbA list of tags attached to the DB Cluster Snapshot.
titletextTitle of the resource.
typetext=The type of the DB Cluster Snapshot.
vpc_idtextProvides the VPC ID associated with the DB cluster snapshot.

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_db_cluster_snapshot