Table: aws_timestreamwrite_database - Query AWS Timestream Databases using SQL
AWS Timestream is a fast, scalable, and fully managed time-series database service for IoT and operational applications. It is designed to store and analyze trillions of events per day at a fraction of the cost of relational databases. The aws_timestreamwrite_database
table in Steampipe allows you to query information about Timestream databases in your AWS environment. This includes details like database creation time, encryption settings, table count, and more.
Table Usage Guide
The aws_timestreamwrite_database
table enables DevOps engineers, cloud administrators, and data analysts to gather detailed insights on their Timestream databases. You can query various aspects of the database, such as its KMS encryption key, number of tables, and creation time. This table is particularly useful for monitoring database health, ensuring security compliance, and managing database configurations.
Examples
Basic database information
Retrieve basic information about your AWS Timestream databases, including their name, ARN, creation time, and region. This can be useful for getting an overview of the databases deployed in your AWS account.
select database_name, arn, creation_time, region, kms_key_idfrom aws_timestreamwrite_database;
select database_name, arn, creation_time, region, kms_key_idfrom aws_timestreamwrite_database;
List databases with a specific KMS key
Identify databases that are encrypted with a specific KMS key. This can help in ensuring that your data is secured according to your organization’s encryption policies.
select database_name, arn, kms_key_idfrom aws_timestreamwrite_databasewhere kms_key_id = 'your-kms-key-id';
select database_name, arn, kms_key_idfrom aws_timestreamwrite_databasewhere kms_key_id = 'your-kms-key-id';
List databases by creation date
Retrieve databases ordered by their creation date, which can be useful for auditing purposes or understanding the lifecycle of your Timestream databases.
select database_name, arn, creation_timefrom aws_timestreamwrite_databaseorder by creation_time desc;
select database_name, arn, creation_timefrom aws_timestreamwrite_databaseorder by creation_time desc;
List databases with the most tables
Identify the databases that contain the most tables, which can help in understanding data distribution and load across your Timestream environment.
select database_name, arn, table_countfrom aws_timestreamwrite_databaseorder by table_count desc;
select database_name, arn, table_countfrom aws_timestreamwrite_databaseorder by table_count desc;
Get database details with last updated time
Retrieve detailed information about your databases, including when they were last updated, to monitor changes and updates over time.
select database_name, arn, last_updated_time, regionfrom aws_timestreamwrite_database;
select database_name, arn, last_updated_time, regionfrom aws_timestreamwrite_database;
Schema for aws_timestreamwrite_database
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 that uniquely identifies this database. | |
creation_time | timestamp with time zone | The time when the database was created, calculated from the Unix epoch time. | |
database_name | text | = | The name of the Timestream database. |
kms_key_id | text | The identifier of the KMS key used to encrypt the data stored in the database. | |
last_updated_time | timestamp with time zone | The last time that this database was updated. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
region | text | The AWS Region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
table_count | bigint | The total number of tables found within a Timestream database. | |
title | text | Title of the resource. |
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_timestreamwrite_database