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_idfrom aws_rds_db_cluster_snapshotwhere not storage_encrypted;
select db_cluster_snapshot_identifier, type, storage_encrypted, substr(kms_key_id, 1, instr(kms_key_id, '/') - 1) as kms_key_idfrom aws_rds_db_cluster_snapshotwhere 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_modelfrom aws_rds_db_cluster_snapshot;
select db_cluster_snapshot_identifier, cluster_create_time, engine, engine_version, license_modelfrom 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_countfrom aws_rds_db_cluster_snapshotgroup by db_cluster_identifier;
select db_cluster_identifier, count(db_cluster_snapshot_identifier) as snapshot_countfrom aws_rds_db_cluster_snapshotgroup 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, typefrom aws_rds_db_cluster_snapshotwhere type = 'manual';
select db_cluster_snapshot_identifier, engine, typefrom aws_rds_db_cluster_snapshotwhere type = 'manual';
Schema for aws_rds_db_cluster_snapshot
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. | |
allocated_storage | bigint | Specifies the allocated storage size in gibibytes (GiB). | |
arn | text | The Amazon Resource Name (ARN) for the DB Cluster Snapshot. | |
availability_zones | jsonb | A list of Availability Zones (AZs) where instances in the DB cluster snapshot can be restored. | |
cluster_create_time | timestamp with time zone | Specifies the time when the DB cluster was created. | |
create_time | timestamp with time zone | The time when the snapshot was taken. | |
db_cluster_identifier | text | = | The friendly name to identify the DB Cluster, that the snapshot snapshot was created from. |
db_cluster_resource_id | text | The resource ID of the DB cluster that this DB cluster snapshot was created from. | |
db_cluster_snapshot_attributes | jsonb | A list of DB cluster snapshot attribute names and values for a manual DB cluster snapshot. | |
db_cluster_snapshot_identifier | text | = | The friendly name to identify the DB Cluster Snapshot. |
engine | text | = | Specifies the name of the database engine. |
engine_mode | text | The engine mode of the database engine for this DB cluster snapshot. | |
engine_version | text | Specifies the version of the database engine for this DB cluster snapshot. | |
iam_database_authentication_enabled | boolean | Specifies whether mapping of AWS Identity and Access Management (IAM) accounts to database accounts is enabled, or not. | |
kms_key_id | text | The AWS KMS key identifier for the AWS KMS customer master key (CMK). | |
license_model | text | Provides the license model information for this DB cluster snapshot. | |
master_user_name | text | Provides the master username for the DB cluster snapshot. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
percent_progress | bigint | Specifies the percentage of the estimated data that has been transferred. | |
port | bigint | Specifies the port that the DB cluster was listening on at the time of the snapshot. | |
region | text | The AWS Region in which the resource is located. | |
snapshot_type | text | The type of the DB cluster snapshot. | |
source_db_cluster_snapshot_arn | text | The 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_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
status | text | Specifies the status of this DB Cluster Snapshot. | |
storage_encrypted | boolean | Specifies whether the DB cluster snapshot is encrypted, or not. | |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | A list of tags attached to the DB Cluster Snapshot. | |
title | text | Title of the resource. | |
type | text | = | The type of the DB Cluster Snapshot. |
vpc_id | text | Provides 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