Accessing Amazon Timestream Using the AWS CLI - Amazon Timestream

Accessing Amazon Timestream Using the AWS CLI

You can use the AWS Command Line Interface (AWS CLI) to control multiple AWS services from the command line and automate them through scripts. You can use the AWS CLI for ad hoc operations. You can also use it to embed Amazon Timestream operations within utility scripts.

Before you can use the AWS CLI with Timestream, you must get an access key ID and secret access key. For more information, see Getting an AWS Access Key (not required for Console access).

For a complete listing of all the commands available for the Timestream Query API in the AWS CLI, see the AWS CLI Command Reference.

For a complete listing of all the commands available for the Timestream Write API in the AWS CLI, see the AWS CLI Command Reference.

Downloading and Configuring the AWS CLI

The AWS CLI runs on Windows, macOS, or Linux. To download, install, and configure it, follow these steps:

  1. Download the AWS CLI at http://aws.amazon.com/cli.

  2. Follow the instructions for Installing the AWS CLI and Configuring the AWS CLI in the AWS Command Line Interface User Guide.

Using the AWS CLI with Timestream

The command line format consists of an Amazon Timestream operation name, followed by the parameters for that operation. The AWS CLI supports a shorthand syntax for the parameter values, in addition to JSON.

Use help to list all available commands in Timestream. For example:

aws timestream-write help
aws timestream-query help

You can also use help to describe a specific command and learn more about its usage:

aws timestream-write create-database help

For example, to create a database:

aws timestream-write create-database --database-name myFirstDatabase