feat(aws): resolve endpoints by service - #415
Open
aryasaatvik wants to merge 2 commits into
Open
Conversation
Add `ServiceEndpoint`, a resolver keyed by the SDK service ID exactly as it appears in the model's `aws.api#service` trait (`"S3"`, `"SESv2"`, `"S3 Control"`), and `Endpoint.resolve(service)` which layers it under the existing `Endpoint` override: 1. an explicit operation-scoped `Endpoint` wins, 2. then the `ServiceEndpoint` resolver, 3. otherwise `undefined`, leaving the generated Smithy endpoint rules to select the AWS endpoint as before. `protocol.ts` and `presign.ts` now go through `Endpoint.resolve` instead of reading `Endpoint` directly, so a process-wide per-service policy (local emulator, private endpoints) applies without every call site providing an `Endpoint`. The key is the SDK service ID rather than the SigV4 signing name because signing names collide (SES and SESv2 both sign as `ses`); SDK IDs keep every service independently routable, and they are the identifier AWS's own service-specific endpoint configuration (`AWS_ENDPOINT_URL_<SERVICE>`, `~/.aws/config` `services` sections) is derived from.
aryasaatvik
force-pushed
the
feat/aws-service-endpoints-upstream
branch
from
August 4, 2026 20:22
f25e582 to
df5b912
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Endpointoverrides the endpoint for every operation in context — the right shape for a full local gateway (AWS_ENDPOINT_URL, LocalStack convention). But the AWS SDKs also specify service-specific endpoints —AWS_ENDPOINT_URL_<SERVICE>and per-serviceservicessections in~/.aws/config— for routing only some services elsewhere: an emulator that implements a subset, a private interface endpoint for s3 only. Distilled can't express that: the operation's service is only known at request time, inside the protocol layer.Add
ServiceEndpoint, a resolver keyed by the SDK service ID exactly as it appears in the model'saws.api#servicetrait:protocol.tsandpresign.tsnow resolve throughEndpoint.resolve(service):Endpointwins,ServiceEndpointresolver,undefinedfalls through to the generated Smithy endpoint rules, selecting the AWS endpoint as before.An absent
ServiceEndpointbehaves exactly as today.The key is the SDK service ID rather than the SigV4 signing name because signing names collide — SES and SESv2 both sign as
ses— while SDK IDs keep every service independently routable, and they are the identifier AWS's own service-specific endpoint configuration is derived from. Two natural follow-ups: a generatedServiceNameunion (from the models' sdkIds) to tighten thestringkey, and aServiceEndpoint.fromEnvlayer honoringAWS_ENDPOINT_URL_<SERVICE>/AWS_IGNORE_CONFIGURED_ENDPOINT_URLS.