Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/spa-deploy/spa-deploy-construct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
OriginAccessIdentity,
Behavior,
SSLMethod,
SecurityPolicyProtocol,
SecurityPolicyProtocol, ResponseCustomHeader
} from 'aws-cdk-lib/aws-cloudfront';
import { PolicyStatement, Role, AnyPrincipal, Effect } from 'aws-cdk-lib/aws-iam';
import { HostedZone, ARecord, RecordTarget } from 'aws-cdk-lib/aws-route53';
Expand All @@ -29,6 +29,7 @@ export interface SPADeployConfig {
readonly sslMethod?: SSLMethod,
readonly securityPolicy?: SecurityPolicyProtocol,
readonly role?:Role,
readonly responseCustomHeader?: ResponseCustomHeader,
}

export interface HostedZoneConfig {
Expand Down Expand Up @@ -179,6 +180,10 @@ export class SPADeploy extends Construct {
cfConfig.aliasConfiguration.securityPolicy = config.securityPolicy;
}

if (typeof config.responseCustomHeader !== 'undefined') {
cfConfig.aliasConfiguration.responseCustomHeader = config.responseCustomHeader;
}

if (typeof config.zoneName !== 'undefined' && typeof cert !== 'undefined') {
cfConfig.viewerCertificate = ViewerCertificate.fromAcmCertificate(cert, {
aliases: [config.subdomain ? `${config.subdomain}.${config.zoneName}` : config.zoneName],
Expand Down