Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const SiteCDN = (): cdn.CloudFrontWebDistributionProps => ({
aliasConfiguration: {
acmCertRef,
names: [ site(props) ],
securityPolicy: cdn.SecurityPolicyProtocol.TLS_V1_2_2018,
sslMethod: cdn.SSLMethod.SNI,
},
httpVersion: cdn.HttpVersion.HTTP1_1,
originConfigs: [
{
behaviors : [
{
defaultTtl: cdk.Duration.hours(24),
forwardedValues: {queryString: true},
isDefaultBehavior: true,
maxTtl: cdk.Duration.hours(24),
minTtl: cdk.Duration.seconds(0),
}
],
originPath: (!props.sites || props.sites.length === 0) ? '/' : props.sites[0].origin,
s3OriginSource: {
s3BucketSource
},
}