import BaseModule, { BaseDefaults, BaseSettings } from './base-module'; import { App } from 'aws-cdk-lib'; import ConvertivBaseStack from '../stacks/base-stack'; import { IGroup, IUser } from 'aws-cdk-lib/aws-iam'; import { BehaviorOptions, FunctionAssociation, IDistribution, FunctionAttributes } from 'aws-cdk-lib/aws-cloudfront'; import { IHostedZone, IRecordSet } from 'aws-cdk-lib/aws-route53'; import { IBucket } from 'aws-cdk-lib/aws-s3'; /** * A Fargate service running on an ECS cluster fronted by an application load balancer. */ export interface HandoffSettings extends BaseSettings { /** * Define an application name */ name: string; /** * Define the environment (prod, staging) */ env: string; /** * Define a region */ region: string; /** * Is the domain hosted on route 53. If not hosted here, the dns and cert will be skipped and must be manually supplied */ route53: boolean | null; /** * The hosted zone name */ domainName: string; /** * The third level domain being pointed. If undefined or null the root domain will be pointed */ subDomainName?: string | null; /** * The ARN of a cert in the account. If this is left null or undefined, one will be generated from the domain name */ certificateARN?: string | null; /** * Deploy directory */ deployDirectory?: string | null; /** * Deploy directory */ deployUser?: IUser | null; /** * Deploy directory */ deployGroup?: IGroup | null; /** * If this is set, create a deploy user, group and policy. If not * we'll assume you are using assume role */ createDeployPermissions?: boolean; /** * PRovide SAN names for the cert if required */ subjectAlternativeNames?: string[] | null; /** * Allow stacks to provide request/response functions */ requestFunction?: FunctionAttributes; /** * Allow stacks to provide request/response functions */ responseFunction?: FunctionAttributes; /** * Allow stacks to provide custom request/response functions */ customRequestFunction?: string; /** * Allow stacks to provide request/response functions */ customResponseFunction?: string; /** * Allow stacks to provide a basic auth string */ basicAuth?: string; } export interface HandoffDefaults extends BaseDefaults { } export declare class Handoff extends BaseModule { scope: App; stack: ConvertivBaseStack; name: string; env: string; deployUser: IUser; deployGroup: IGroup; distribution: IDistribution; zone: IHostedZone; defaultBehavior: BehaviorOptions; dnsRecord: IRecordSet; bucket: IBucket; validate(settings: HandoffSettings): void; /** * Constructs a new instance of the ApplicationLoadBalancedFargateService class. */ constructor(scope: ConvertivBaseStack, settings: HandoffSettings); /** * Generate a default request header with basic auth if desired * @param auth * @returns string */ createDefaultRequest(auth: string | null): string; /** * Default a default response header */ defaultResponse: string; /** * Generate the functional association required * @param settings * @returns */ getFunctionalAssociation(settings: HandoffSettings): FunctionAssociation[]; }