diff --git a/.changes/next-release/aws-feature-1611348426115463000.json b/.changes/next-release/aws-feature-1611348426115463000.json new file mode 100644 index 00000000000..8ff7ad9a5f5 --- /dev/null +++ b/.changes/next-release/aws-feature-1611348426115463000.json @@ -0,0 +1,9 @@ +{ + "ID": "aws-feature-1611348426115463000", + "SchemaVersion": 1, + "Module": "aws", + "Type": "feature", + "Description": "updates aws module to include endpoint source for aws Endpoint", + "MinVersion": "", + "AffectedModules": null +} \ No newline at end of file diff --git a/aws/endpoints.go b/aws/endpoints.go index fdea51add19..dadb2b407e4 100644 --- a/aws/endpoints.go +++ b/aws/endpoints.go @@ -54,8 +54,27 @@ type Endpoint struct { // The signing method that should be used for signing the requests to the // endpoint. SigningMethod string + + // The source of the Endpoint. By default, this will be EndpointSourceServiceMetadata. + // When providing a custom endpoint, you should set the source as EndpointSourceCustom. + // If source is not provided when providing a custom endpoint, the SDK may not + // perform required host mutations correctly. Source should be used along with + // HostnameImmutable property as per the usage requirement. + Source EndpointSource } +// EndpointSource is the endpoint source type. +type EndpointSource int + +const ( + // EndpointSourceServiceMetadata denotes service modeled endpoint metadata is used as Endpoint Source. + EndpointSourceServiceMetadata EndpointSource = iota + + // EndpointSourceCustom denotes endpoint is a custom endpoint. This source should be used when + // user provides a custom endpoint to be used by the SDK. + EndpointSourceCustom +) + // EndpointNotFoundError is a sentinel error to indicate that the // EndpointResolver implementation was unable to resolve an endpoint for the // given service and region. Resolvers should use this to indicate that an API