serverless-spy
Version:
CDK-based library for writing elegant integration tests on AWS serverless architecture and an additional web console to monitor events in real time.
18 lines (17 loc) • 837 B
JavaScript
import { S3ExpressIdentityProviderImpl } from "./s3-express";
export const resolveS3Config = (input, { session, }) => {
const [s3ClientProvider, CreateSessionCommandCtor] = session;
return {
...input,
forcePathStyle: input.forcePathStyle ?? false,
useAccelerateEndpoint: input.useAccelerateEndpoint ?? false,
disableMultiregionAccessPoints: input.disableMultiregionAccessPoints ?? false,
followRegionRedirects: input.followRegionRedirects ?? false,
s3ExpressIdentityProvider: input.s3ExpressIdentityProvider ??
new S3ExpressIdentityProviderImpl(async (key) => s3ClientProvider().send(new CreateSessionCommandCtor({
Bucket: key,
SessionMode: "ReadWrite",
}))),
bucketEndpoint: input.bucketEndpoint ?? false,
};
};