Amazon Timestream Query

2024/11/20 - Amazon Timestream Query - 2 updated api methods

Changes  This release adds support for Provisioning Timestream Compute Units (TCUs), a new feature that allows provisioning dedicated compute resources for your queries, providing predictable and cost-effective query performance.

DescribeAccountSettings (updated) Link ¶
Changes (response)
{'QueryCompute': {'ComputeMode': 'ON_DEMAND | PROVISIONED',
                  'ProvisionedCapacity': {'ActiveQueryTCU': 'integer',
                                          'LastUpdate': {'Status': 'PENDING | '
                                                                   'FAILED | '
                                                                   'SUCCEEDED',
                                                         'StatusMessage': 'string',
                                                         'TargetQueryTCU': 'integer'},
                                          'NotificationConfiguration': {'RoleArn': 'string',
                                                                        'SnsConfiguration': {'TopicArn': 'string'}}}}}

Describes the settings for your account that include the query pricing model and the configured maximum TCUs the service can use for your query workload.

You're charged only for the duration of compute units used for your workloads.

See also: AWS API Documentation

Request Syntax

client.describe_account_settings()
rtype:

dict

returns:

Response Syntax

{
    'MaxQueryTCU': 123,
    'QueryPricingModel': 'BYTES_SCANNED'|'COMPUTE_UNITS',
    'QueryCompute': {
        'ComputeMode': 'ON_DEMAND'|'PROVISIONED',
        'ProvisionedCapacity': {
            'ActiveQueryTCU': 123,
            'NotificationConfiguration': {
                'SnsConfiguration': {
                    'TopicArn': 'string'
                },
                'RoleArn': 'string'
            },
            'LastUpdate': {
                'TargetQueryTCU': 123,
                'Status': 'PENDING'|'FAILED'|'SUCCEEDED',
                'StatusMessage': 'string'
            }
        }
    }
}

Response Structure

  • (dict) --

    • MaxQueryTCU (integer) --

      The maximum number of Timestream compute units (TCUs) the service will use at any point in time to serve your queries. To run queries, you must set a minimum capacity of 4 TCU. You can set the maximum number of TCU in multiples of 4, for example, 4, 8, 16, 32, and so on. This configuration is applicable only for on-demand usage of (TCUs).

    • QueryPricingModel (string) --

      The pricing model for queries in your account.

    • QueryCompute (dict) --

      An object that contains the usage settings for Timestream Compute Units (TCUs) in your account for the query workload.

      • ComputeMode (string) --

        The mode in which Timestream Compute Units (TCUs) are allocated and utilized within an account. Note that in the Asia Pacific (Mumbai) region, the API operation only recognizes the value PROVISIONED.

      • ProvisionedCapacity (dict) --

        Configuration object that contains settings for provisioned Timestream Compute Units (TCUs) in your account.

        • ActiveQueryTCU (integer) --

          The number of Timestream Compute Units (TCUs) provisioned in the account. This field is only visible when the compute mode is PROVISIONED.

        • NotificationConfiguration (dict) --

          An object that contains settings for notifications that are sent whenever the provisioned capacity settings are modified. This field is only visible when the compute mode is PROVISIONED.

          • SnsConfiguration (dict) --

            Details on SNS that are required to send the notification.

            • TopicArn (string) --

              SNS topic ARN that the scheduled query status notifications will be sent to.

          • RoleArn (string) --

            An Amazon Resource Name (ARN) that grants Timestream permission to publish notifications. This field is only visible if SNS Topic is provided when updating the account settings.

        • LastUpdate (dict) --

          Information about the last update to the provisioned capacity settings.

          • TargetQueryTCU (integer) --

            The number of TimeStream Compute Units (TCUs) requested in the last account settings update.

          • Status (string) --

            The status of the last update. Can be either PENDING, FAILED, or SUCCEEDED.

          • StatusMessage (string) --

            Error message describing the last account settings update status, visible only if an error occurred.

UpdateAccountSettings (updated) Link ¶
Changes (request, response)
Request
{'QueryCompute': {'ComputeMode': 'ON_DEMAND | PROVISIONED',
                  'ProvisionedCapacity': {'NotificationConfiguration': {'RoleArn': 'string',
                                                                        'SnsConfiguration': {'TopicArn': 'string'}},
                                          'TargetQueryTCU': 'integer'}}}
Response
{'QueryCompute': {'ComputeMode': 'ON_DEMAND | PROVISIONED',
                  'ProvisionedCapacity': {'ActiveQueryTCU': 'integer',
                                          'LastUpdate': {'Status': 'PENDING | '
                                                                   'FAILED | '
                                                                   'SUCCEEDED',
                                                         'StatusMessage': 'string',
                                                         'TargetQueryTCU': 'integer'},
                                          'NotificationConfiguration': {'RoleArn': 'string',
                                                                        'SnsConfiguration': {'TopicArn': 'string'}}}}}

Transitions your account to use TCUs for query pricing and modifies the maximum query compute units that you've configured. If you reduce the value of MaxQueryTCU to a desired configuration, the new value can take up to 24 hours to be effective.

See also: AWS API Documentation

Request Syntax

client.update_account_settings(
    MaxQueryTCU=123,
    QueryPricingModel='BYTES_SCANNED'|'COMPUTE_UNITS',
    QueryCompute={
        'ComputeMode': 'ON_DEMAND'|'PROVISIONED',
        'ProvisionedCapacity': {
            'TargetQueryTCU': 123,
            'NotificationConfiguration': {
                'SnsConfiguration': {
                    'TopicArn': 'string'
                },
                'RoleArn': 'string'
            }
        }
    }
)
type MaxQueryTCU:

integer

param MaxQueryTCU:

The maximum number of compute units the service will use at any point in time to serve your queries. To run queries, you must set a minimum capacity of 4 TCU. You can set the maximum number of TCU in multiples of 4, for example, 4, 8, 16, 32, and so on. The maximum value supported for MaxQueryTCU is 1000. To request an increase to this soft limit, contact Amazon Web Services Support. For information about the default quota for maxQueryTCU, see Default quotas. This configuration is applicable only for on-demand usage of Timestream Compute Units (TCUs).

The maximum value supported for MaxQueryTCU is 1000. To request an increase to this soft limit, contact Amazon Web Services Support. For information about the default quota for maxQueryTCU, see Default quotas.

type QueryPricingModel:

string

param QueryPricingModel:

The pricing model for queries in an account.

type QueryCompute:

dict

param QueryCompute:

Modifies the query compute settings configured in your account, including the query pricing model and provisioned Timestream Compute Units (TCUs) in your account.

  • ComputeMode (string) --

    The mode in which Timestream Compute Units (TCUs) are allocated and utilized within an account. Note that in the Asia Pacific (Mumbai) region, the API operation only recognizes the value PROVISIONED.

  • ProvisionedCapacity (dict) --

    Configuration object that contains settings for provisioned Timestream Compute Units (TCUs) in your account.

    • TargetQueryTCU (integer) -- [REQUIRED]

      The target compute capacity for querying data, specified in Timestream Compute Units (TCUs).

    • NotificationConfiguration (dict) --

      Configuration settings for notifications related to the provisioned capacity update.

      • SnsConfiguration (dict) --

        Details on SNS that are required to send the notification.

        • TopicArn (string) -- [REQUIRED]

          SNS topic ARN that the scheduled query status notifications will be sent to.

      • RoleArn (string) -- [REQUIRED]

        An Amazon Resource Name (ARN) that grants Timestream permission to publish notifications. This field is only visible if SNS Topic is provided when updating the account settings.

rtype:

dict

returns:

Response Syntax

{
    'MaxQueryTCU': 123,
    'QueryPricingModel': 'BYTES_SCANNED'|'COMPUTE_UNITS',
    'QueryCompute': {
        'ComputeMode': 'ON_DEMAND'|'PROVISIONED',
        'ProvisionedCapacity': {
            'ActiveQueryTCU': 123,
            'NotificationConfiguration': {
                'SnsConfiguration': {
                    'TopicArn': 'string'
                },
                'RoleArn': 'string'
            },
            'LastUpdate': {
                'TargetQueryTCU': 123,
                'Status': 'PENDING'|'FAILED'|'SUCCEEDED',
                'StatusMessage': 'string'
            }
        }
    }
}

Response Structure

  • (dict) --

    • MaxQueryTCU (integer) --

      The configured maximum number of compute units the service will use at any point in time to serve your queries.

    • QueryPricingModel (string) --

      The pricing model for an account.

    • QueryCompute (dict) --

      Confirms the updated account settings for querying data in your account.

      • ComputeMode (string) --

        The mode in which Timestream Compute Units (TCUs) are allocated and utilized within an account. Note that in the Asia Pacific (Mumbai) region, the API operation only recognizes the value PROVISIONED.

      • ProvisionedCapacity (dict) --

        Configuration object that contains settings for provisioned Timestream Compute Units (TCUs) in your account.

        • ActiveQueryTCU (integer) --

          The number of Timestream Compute Units (TCUs) provisioned in the account. This field is only visible when the compute mode is PROVISIONED.

        • NotificationConfiguration (dict) --

          An object that contains settings for notifications that are sent whenever the provisioned capacity settings are modified. This field is only visible when the compute mode is PROVISIONED.

          • SnsConfiguration (dict) --

            Details on SNS that are required to send the notification.

            • TopicArn (string) --

              SNS topic ARN that the scheduled query status notifications will be sent to.

          • RoleArn (string) --

            An Amazon Resource Name (ARN) that grants Timestream permission to publish notifications. This field is only visible if SNS Topic is provided when updating the account settings.

        • LastUpdate (dict) --

          Information about the last update to the provisioned capacity settings.

          • TargetQueryTCU (integer) --

            The number of TimeStream Compute Units (TCUs) requested in the last account settings update.

          • Status (string) --

            The status of the last update. Can be either PENDING, FAILED, or SUCCEEDED.

          • StatusMessage (string) --

            Error message describing the last account settings update status, visible only if an error occurred.