cdk-cloudfront-plus
CDK constructs library that allows you to build AWS CloudFront Extensions in JavaScript, TypeScript or Python.
Sample
import * as cfplus from 'cdk-cloudfront-plus';
const app = new cdk.App();
const stack = new cdk.Stack(app, 'demo-stack');
const modifyRespHeader = new extensions.ModifyResponseHeader(stack, 'ModifyResp');
const antiHotlinking = new extensions.AntiHotlinking(stack, 'AntiHotlink', {
referer: [
'example.com',
'exa?ple.*',
],
});
new Distribution(stack, 'dist', {
defaultBehavior: {
origin: new origins.HttpOrigin('aws.amazon.com'),
edgeLambdas: [
modifyRespHeader,
antiHotlinking,
],
},
});
Available Extensions in AWS CDK