Update endpoint discovery resolver to handle explicit service URLs #3367
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3349
Motivation and Context
Timestream is one of two services (along with DynamoDB - see notes below) where the SDK attempts to perform dynamic endpoint discovery (important: this is not related to the endpoint resolution change introduced in version
3.7.100
). A longer explanation is available in the developer guide, but in summary endpoint discovery works like this:DescribeEndpoints
API to fetch which endpoints customers should use (Timestream uses a cellular architecture so each customer is mapped to a specific cell)One unusual thing about Timestream is that the
DescribeEndpoints
API can only be invoked via the regional endpoints (from usage notes). If customers create a VPC endpoint for Timestream and try to use its URL in the service client the operation fails (as the SDK attempts to perform endpoint discovery against an endpoint that doesn't support it).This PR updates the
EndpointDiscoveryResolver
not to attempt endpoint discovery if there's a service URL set in the current client config.Testing
de91537f-92a8-4cc2-ba8a-2a93653ff0dd
Before:
After (connection succeeded without attempting to call
DescribeEndpoints
):Notes
aws-sdk-net/sdk/src/Core/Amazon.Runtime/Internal/EndpointDiscoveryResolver.cs
Lines 94 to 100 in 0d195b2
aws-sdk-net/generator/ServiceModels/dynamodb/dynamodb-2012-08-10.api.json
Lines 489 to 490 in 0d195b2
I couldn't find reports of the same issue happening with DynamoDB, my assumption is that endpoint discovery just isn't a common setup. DynamoDB also supports gateway endpoints, which in addition to being free of charge don't require setting a custom service URL (traffic is routed using prefix lists instead).
Types of changes
Checklist
License