25 lines
729 B
JavaScript
25 lines
729 B
JavaScript
import { awsEndpointFunctions } from "@aws-sdk/core/client";
|
|||
|
|
import { customEndpointFunctions, decideEndpoint, EndpointCache } from "@smithy/core/endpoints";
|
||
|
|
import { bdd } from "./bdd";
|
||
|
|
const cache = new EndpointCache({
|
||
|
|
size: 50,
|
||
|
|
params: [
|
||
|
|
"ConsumerARN",
|
||
|
|
"Endpoint",
|
||
|
|
"OperationType",
|
||
|
|
"Region",
|
||
|
|
"ResourceARN",
|
||
|
|
"StreamARN",
|
||
|
|
"StreamId",
|
||
|
|
"UseDualStack",
|
||
|
|
"UseFIPS",
|
||
|
|
],
|
||
|
|
});
|
||
|
|
export const defaultEndpointResolver = (endpointParams, context = {}) => {
|
||
|
|
return cache.get(endpointParams, () => decideEndpoint(bdd, {
|
||
|
|
endpointParams: endpointParams,
|
||
|
|
logger: context.logger,
|
||
|
|
}));
|
||
|
|
};
|
||
|
|
customEndpointFunctions.aws = awsEndpointFunctions;
|