import * as cloudfront from 'aws-cdk-lib/aws-cloudfront'; import * as route53 from 'aws-cdk-lib/aws-route53'; import { Construct } from 'constructs'; import { CspDirectives } from './contentSecurityPolicy'; /** Properties for defining a RioCloudfrontDistribution. */ export interface RioCloudfrontDistributionProps { /** The reference to the S3 bucket containing the files to serve. */ readonly contentBucketName: string; /** * The subdomain where the content should be served. * * If not given, an empty string, i.e. no subDomain will be used. Instead, the name of the hosted zone will be used * directly. */ readonly subDomain?: string; /** * The hosted zone of the domain under which the content will be served. * * If not given, the default hosted Zone provided by RIO setup will be used. */ readonly hostedZone?: route53.IHostedZone; /** * Allows declaratively defining your desired CSP. * * The RIO defaults are always included, and you can choose which services you want to include (e.g. ConfigCat) or * not. You can also provide custom directives / values using the "custom" key. */ readonly cspConfig?: CspConfig; /** * The list of functions to be associated with the default behaviour of the distribution. * * If not given, no functions will be assigned. */ readonly functionAssociations?: cloudfront.FunctionAssociation[]; /** * The frame options to be used in the response headers policy. * * If not given, the default value will be `DENY` & override: true. */ readonly frameOptions?: cloudfront.ResponseHeadersFrameOptions; } export interface CspConfig { /** Include Google Analytics / Google Tag manager. */ readonly googleAnalytics?: boolean; /** Include Sentry. */ readonly sentry?: boolean; /** Include Split.io. */ readonly split?: boolean; /** Include Datadog. */ readonly datadog?: boolean; /** Include ConfigCat. */ readonly configCat?: boolean; /** Include Here Maps. */ readonly here?: boolean; /** Include Intercom. */ readonly intercom?: boolean; /** Prints the generated CSP to the console. */ readonly logOutput?: boolean; /** You can define custom values for any CSP directive with this. */ readonly customDirectives?: CspDirectives; } /** * A Construct which creates a default cloudfront distribution using a s3 bucket as origin. * * Intended for delivery of html documents. It sets some defaults a recommended by AWS and provides CSP settings. */ export declare class RioCloudfrontDistribution extends Construct { readonly distribution: cloudfront.IDistribution; constructor(scope: Construct, id: string, props: RioCloudfrontDistributionProps); private generateCsp; } export declare const createCspFromConfig: (cspConfig?: CspConfig) => string;