Skip to content

Commit e3c589f

Browse files
authored
add missing deprecation docs on global EndpointResolver interfaces (#2665)
1 parent 4d3e8fd commit e3c589f

File tree

3 files changed

+42
-5
lines changed

3 files changed

+42
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"id": "c97f23ee-44fe-4305-b699-c524e2f9fe19",
3+
"type": "documentation",
4+
"description": "Add deprecation docs to global endpoint resolution interfaces. These APIs were previously deprecated with the introduction of service-specific endpoint resolution (EndpointResolverV2 and BaseEndpoint on service client options).",
5+
"modules": [
6+
".",
7+
"config"
8+
]
9+
}

aws/endpoints.go

+22-4
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ func GetUseFIPSEndpoint(options ...interface{}) (value FIPSEndpointState, found
7070
// The SDK will automatically resolve these endpoints per API client using an
7171
// internal endpoint resolvers. If you'd like to provide custom endpoint
7272
// resolving behavior you can implement the EndpointResolver interface.
73+
//
74+
// Deprecated: This structure was used with the global [EndpointResolver]
75+
// interface, which has been deprecated in favor of service-specific endpoint
76+
// resolution. See the deprecation docs on that interface for more information.
7377
type Endpoint struct {
7478
// The base URL endpoint the SDK API clients will use to make API calls to.
7579
// The SDK will suffix URI path and query elements to this endpoint.
@@ -124,6 +128,8 @@ type Endpoint struct {
124128
}
125129

126130
// EndpointSource is the endpoint source type.
131+
//
132+
// Deprecated: The global [Endpoint] structure is deprecated.
127133
type EndpointSource int
128134

129135
const (
@@ -161,19 +167,25 @@ func (e *EndpointNotFoundError) Unwrap() error {
161167
// API clients will fallback to attempting to resolve the endpoint using its
162168
// internal default endpoint resolver.
163169
//
164-
// Deprecated: See EndpointResolverWithOptions
170+
// Deprecated: The global endpoint resolution interface is deprecated. The API
171+
// for endpoint resolution is now unique to each service and is set via the
172+
// EndpointResolverV2 field on service client options. Setting a value for
173+
// EndpointResolver on aws.Config or service client options will prevent you
174+
// from using any endpoint-related service features released after the
175+
// introduction of EndpointResolverV2. You may also encounter broken or
176+
// unexpected behavior when using the old global interface with services that
177+
// use many endpoint-related customizations such as S3.
165178
type EndpointResolver interface {
166179
ResolveEndpoint(service, region string) (Endpoint, error)
167180
}
168181

169182
// EndpointResolverFunc wraps a function to satisfy the EndpointResolver interface.
170183
//
171-
// Deprecated: See EndpointResolverWithOptionsFunc
184+
// Deprecated: The global endpoint resolution interface is deprecated. See
185+
// deprecation docs on [EndpointResolver].
172186
type EndpointResolverFunc func(service, region string) (Endpoint, error)
173187

174188
// ResolveEndpoint calls the wrapped function and returns the results.
175-
//
176-
// Deprecated: See EndpointResolverWithOptions.ResolveEndpoint
177189
func (e EndpointResolverFunc) ResolveEndpoint(service, region string) (Endpoint, error) {
178190
return e(service, region)
179191
}
@@ -184,11 +196,17 @@ func (e EndpointResolverFunc) ResolveEndpoint(service, region string) (Endpoint,
184196
// available. If the EndpointResolverWithOptions returns an EndpointNotFoundError error,
185197
// API clients will fallback to attempting to resolve the endpoint using its
186198
// internal default endpoint resolver.
199+
//
200+
// Deprecated: The global endpoint resolution interface is deprecated. See
201+
// deprecation docs on [EndpointResolver].
187202
type EndpointResolverWithOptions interface {
188203
ResolveEndpoint(service, region string, options ...interface{}) (Endpoint, error)
189204
}
190205

191206
// EndpointResolverWithOptionsFunc wraps a function to satisfy the EndpointResolverWithOptions interface.
207+
//
208+
// Deprecated: The global endpoint resolution interface is deprecated. See
209+
// deprecation docs on [EndpointResolver].
192210
type EndpointResolverWithOptionsFunc func(service, region string, options ...interface{}) (Endpoint, error)
193211

194212
// ResolveEndpoint calls the wrapped function and returns the results.

config/load_options.go

+11-1
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,14 @@ func (o LoadOptions) getEndpointResolver(ctx context.Context) (aws.EndpointResol
824824
// the EndpointResolver value is ignored. If multiple WithEndpointResolver calls
825825
// are made, the last call overrides the previous call values.
826826
//
827-
// Deprecated: See WithEndpointResolverWithOptions
827+
// Deprecated: The global endpoint resolution interface is deprecated. The API
828+
// for endpoint resolution is now unique to each service and is set via the
829+
// EndpointResolverV2 field on service client options. Use of
830+
// WithEndpointResolver or WithEndpointResolverWithOptions will prevent you
831+
// from using any endpoint-related service features released after the
832+
// introduction of EndpointResolverV2. You may also encounter broken or
833+
// unexpected behavior when using the old global interface with services that
834+
// use many endpoint-related customizations such as S3.
828835
func WithEndpointResolver(v aws.EndpointResolver) LoadOptionsFunc {
829836
return func(o *LoadOptions) error {
830837
o.EndpointResolver = v
@@ -844,6 +851,9 @@ func (o LoadOptions) getEndpointResolverWithOptions(ctx context.Context) (aws.En
844851
// that sets the EndpointResolverWithOptions on LoadOptions. If the EndpointResolverWithOptions is set to nil,
845852
// the EndpointResolver value is ignored. If multiple WithEndpointResolver calls
846853
// are made, the last call overrides the previous call values.
854+
//
855+
// Deprecated: The global endpoint resolution interface is deprecated. See
856+
// deprecation docs on [WithEndpointResolver].
847857
func WithEndpointResolverWithOptions(v aws.EndpointResolverWithOptions) LoadOptionsFunc {
848858
return func(o *LoadOptions) error {
849859
o.EndpointResolverWithOptions = v

0 commit comments

Comments
 (0)