Skip to content

Timestream Query endpoint override fails #3568

@trevorbonas

Description

@trevorbonas

Describe the bug

Attempts to override the endpoint used with Timestream for LiveAnalytics fail.

Timestream for LiveAnalytics uses a cellular architecture. In order to function, the SDK must use dynamic endpoint discovery. For every action, such as executing a query, the SDK calls DescribeEndpoints, which returns endpoints the SDK can use at that moment. Periodically, DescribeEndpoints is called to make sure the SDK continues to use a valid endpoint.

However, VPC endpoints don't support DescribeEndpoints calls. If an endpoint override is set, the Timestream Query client will internally disable endpoint discovery and then fail, since endpoint discovery is always required for all actions.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

An endpoint override can be provided and all Timestream for LiveAnalytics actions succeed. The AWS CLI demonstrates expected behaviour.

Current Behavior

If an endpoint override value is provided, endpoint discovery will be disabled internally and all actions fail with Unable to perform "Query" without endpoint discovery. Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY", your config file's variable "endpoint_discovery_enabled" and ClientConfiguration's "enableEndpointDiscovery" are explicitly set to true or not set at all.

Reproduction Steps

#include <aws/core/Aws.h>
#include <aws/timestream-query/TimestreamQueryClient.h>
#include <aws/timestream-query/model/QueryRequest.h>
#include <aws/timestream-query/model/QueryResult.h>
#include <iostream>

int main() {
    Aws::SDKOptions options;
    Aws::InitAPI(options);
    int result = 0;
    {
        Aws::Client::ClientConfiguration config;

        // Setting this will internally disable endpoint discovery, which Timestream requires.
        // See TimestreamQueryClientConfiguration::IsEndpointDiscoveryEnabled().
        config.endpointOverride = "https://query-cell1.timestream.us-west-2.amazonaws.com";
        config.region = "us-west-2";
        config.enableEndpointDiscovery = true;
        Aws::TimestreamQuery::TimestreamQueryClient client(config);
        Aws::TimestreamQuery::Model::QueryRequest request;
        request.SetQueryString("SELECT 1");

        std::cout << "Running query: " << request.GetQueryString() << " with endpoint: " << config.endpointOverride << std::endl;
        auto outcome = client.Query(request);

        if (outcome.IsSuccess()) {
            auto result = outcome.GetResult();
            std::cout << "Query succeeded, got " 
                      << result.GetRows().size() 
                      << " rows." << std::endl;
        } else {
            std::cerr << "Query failed: "
                      << outcome.GetError().GetMessage()
                      << std::endl;
        }
    }
    Aws::ShutdownAPI(options);
    return result;
}

Possible Solution

Skip endpoint discovery when an endpoint override value has been set. This is the solution that was implemented for the AWS SDK for .NET. Or, remove the requirement for all Timestream for LiveAnalytics actions to have endpoint discovery enabled.

Additional Information/Context

AWS CPP SDK version used

1.11.644

Compiler and Version used

gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0

Operating System and version

Ubuntu 24.04.3 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-reviewThis issue or pull request needs review from a core team member.p2This is a standard priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions