30 lines
922 B
JavaScript
30 lines
922 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: [
|
|
"Accelerate",
|
|
"Bucket",
|
|
"DisableAccessPoints",
|
|
"DisableMultiRegionAccessPoints",
|
|
"DisableS3ExpressSessionAuth",
|
|
"Endpoint",
|
|
"ForcePathStyle",
|
|
"Region",
|
|
"UseArnRegion",
|
|
"UseDualStack",
|
|
"UseFIPS",
|
|
"UseGlobalEndpoint",
|
|
"UseObjectLambdaEndpoint",
|
|
"UseS3ExpressControlEndpoint",
|
|
],
|
|
});
|
|
export const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
return cache.get(endpointParams, () => decideEndpoint(bdd, {
|
|
endpointParams: endpointParams,
|
|
logger: context.logger,
|
|
}));
|
|
};
|
|
customEndpointFunctions.aws = awsEndpointFunctions;
|