diff --git a/packages/static-hosting/lib/static-hosting.ts b/packages/static-hosting/lib/static-hosting.ts index 7f52862b..acf36069 100644 --- a/packages/static-hosting/lib/static-hosting.ts +++ b/packages/static-hosting/lib/static-hosting.ts @@ -144,7 +144,7 @@ export interface StaticHostingProps { * * @default none */ - staticFileRemapOptions?: BehaviorOptions; + staticFileRemapOptions?: Partial; /** * Paths to remap on the default behaviour. For example you might remap deployed_sitemap.xml -> sitemap.xml @@ -295,6 +295,7 @@ export interface StaticHostingProps { interface remapPath { from: string; to?: string; + behaviour?: Partial; } export interface ResponseHeaderMappings { @@ -530,6 +531,7 @@ export class StaticHosting extends Construct { origin: backendOrigin, viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS, edgeLambdas: this.createRemapBehavior(path.from, path.to), + ...path.behaviour, }; } } @@ -553,6 +555,7 @@ export class StaticHosting extends Construct { origin: s3Origin, viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS, edgeLambdas: this.createRemapBehavior(path.from, path.to), + ...path.behaviour, }; } }