Using the Console - Amazon Timestream

Using the Console

You can use the AWS Management Console for Timestream to create tables and databases, run queries and delete databases and tables.

Tutorial

This tutorial shows you how to create a database populated with sample data sets and run sample queries. The sample datasets used in this tutorial are frequently seen in IoT and DevOps scenarios. The IoT dataset contains time series data such as the speed, location, and load of a truck, to streamline fleet management and identify optimization opportunities. The DevOps dataset contains EC2 instance metrics such as CPU, network, and memory utilization to improve application performance and availability. Here’s a video tutorial for the instructions described in this section

Follow these steps to create a database populated with the sample data sets and run sample queries using the AWS Console:

  1. Open the AWS Console.

  2. In the navigation pane, choose Databases

  3. Click on Create database.

  4. On the create database page, enter the following:

    • Choose configuration – Select Sample database.

    • Name – Enter a database name of your choice.

    • Choose sample datasets – Select IoT and DevOps.

    • Click on Create database to create a database containing two tables – IoT and DevOps populated with sample data.

  5. In the navigation pane, choose Query editor

  6. Select Sample queries from the top menu.

  7. Click on one of the sample queries. This will take you back to the query editor with the editor populated with the sample query.

  8. Click Run to run the query and see query results.

Create a database

Follow these steps to create a database using the AWS Console:

  1. Open the AWS Console.

  2. In the navigation pane, choose Databases

  3. Click on Create database.

  4. On the create database page, enter the following:

    • Choose configuration – Select Standard database.

    • Name – Enter a database name of your choice.

    • Encryption – Choose a KMS key or use the default option, where Timestream will create a KMS key in your account if one does not already exist.

  5. Click on Create database to create a database.

Create a table

Follow these steps to create a table using the AWS Console:

  1. Open the AWS Console.

  2. In the navigation pane, choose Tables

  3. Click on Create table.

  4. On the create table page, enter the following:

    • Database name – Select the name of the database created in Create a database.

    • Table name – Enter a table name of your choice.

    • Memory store retention – Specify how long you want to retain data in the memory store. The memory store processes incoming data, including late arriving data (data with a timestamp earlier than the current time) and is optimized for fast point-in-time queries.

    • Magnetic store retention – Specify how long you want to retain data in the magnetic store. The magnetic store is meant for long term storage and is optimized for fast analytical queries.

  5. Click on Create table.

Run a query

Follow these steps to run queries using the AWS Console:

  1. Open the AWS Console.

  2. In the navigation pane, choose Query editor

  3. In the left pane, select the database created in Create a database.

  4. In the left pane, select the database created in Create a table.

  5. In the query editor, you can run a query. To see the latest 10 rows in the table, run:

    SELECT * FROM <database_name>.<table_name> ORDER BY time DESC LIMIT 10

Create a scheduled query

Follow these steps to create a scheduled query using the AWS Console:

  1. Open the AWS Console.

  2. In the navigation pane, choose Scheduled queries.

  3. Click on Create scheduled query.

  4. On the select destination table and query name page, enter the following:

    • Database name – Select the name of the database created in Create a database.

    • Table name – Select the name of the table created in Create a table.

    • Query name – Enter a query name.

  5. Click on Next.

  6. On the configure query statement and table schema page, enter the following:

    • Enter a valid Query statement, then choose Validate.

    • Set the Destination table schema for any underfined attributes.

  7. Click on Next.

  8. On the configure query query settings page, enter the following:

    • A Run schedule. Refer to Schedule Expressions for Scheduled Queries for more details on schedule expressions.

    • The IAM role that Timestream will use to run the scheduled query. Refer to the IAM policy examples for scheduled queries for details on the required permissions and trust relationship for the role.

    • The optional customer managed KMS key that will be used to encrypt the query statment.

    • The SNS Topic that will be used to for notification.

    • The Error report logging S3 location that will be used to report errors.

  9. Click on Next.

  10. Click on Create.

Delete a scheduled query

Follow these steps to delete or disable a scheduled query using the AWS Console:

  1. Open the AWS Console.

  2. In the navigation pane, choose Scheduled queries

  3. Select the scheduled query created in Create a scheduled query.

  4. Select Actions.

  5. Choose Disable or Delete.

  6. If you selected Delete, confirm the action and select Delete .

Delete a table

Follow these steps to delete a database using the AWS Console:

  1. Open the AWS Console.

  2. In the navigation pane, choose Tables

  3. Select the table that you created in Create a table.

  4. Click Delete

  5. Type delete in the confirmation box.

Delete a database

Follow these steps to delete a database using the AWS Console:

  1. Open the AWS Console.

  2. In the navigation pane, choose Databases

  3. Select the table that you created in Create a database.

  4. Click Delete

  5. Type delete in the confirmation box.