-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
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