awscdk-construct-scte-scheduler
Version:
AWS CDK Construct for scheduling SCTE-35 events using the MediaLive schedule API
27 lines (26 loc) • 866 B
JavaScript
import { bindEndpointMiddleware } from "./endpointMiddleware";
const serializerMiddlewareOption = {
name: "serializerMiddleware",
step: "serialize",
tags: ["SERIALIZER"],
override: true,
};
export const endpointMiddlewareOptions = {
step: "serialize",
tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"],
name: "endpointV2Middleware",
override: true,
relation: "before",
toMiddleware: serializerMiddlewareOption.name,
};
export function bindGetEndpointPlugin(getEndpointFromConfig) {
const endpointMiddleware = bindEndpointMiddleware(getEndpointFromConfig);
return (config, instructions) => ({
applyToStack: (clientStack) => {
clientStack.addRelativeTo(endpointMiddleware({
config,
instructions,
}), endpointMiddlewareOptions);
},
});
}