aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
3.11k stars 578 forks source link

Endpoint discovery not working for Timestream #2211

Closed AllanZhengYP closed 3 years ago

AllanZhengYP commented 3 years ago

Is your feature request related to a problem? Please describe.

Timestream is a cellular service and as such requires discovering cell endpoint to call before executing request. It is done by calling the DescribeEndpoints API in our discovery service (which has DNS name ingest.timestream.{region}.amazonaws.com and similar for query). The response contains cell endpoint in format ingest-cell{x}.timestream.{region}.amazonaws.com which should be used for all subsequent calls.

Currently only the DescribeEndpoints API is working in V3 SDK and everything else fails with com.amazon.coral.service#UnknownOperationException. Because other APIs are expect to use the endpoints returned from DescribeEndpoints API. However, the SDK only supports making request with default endpoint ingest.timestream.{region}.amazonaws.com.

Describe the solution you'd like

SDK should call DescribeEndpoints API automatically prior to make other API calls, and use the returned endpoint for following calls. This feature is implemented in V2 SDK but not supported V3 yet.

Additional context

To workaround the issue, users need to implement the logic to call DescribeEndpoints by themselves. After endpoint is returned, they can create a separate client with returned endpoint and call the intended API.

// Got endpoints from DescribeEndpoints()
const regionalizedClient = new TimeStreamWriteClient({ region, endpoint: /**returned endpoint**/ });
await regionalizedClient.send(new CreateDatabaseCommand(params));
github-actions[bot] commented 3 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.