@liflig/cdk
    Preparing search index...

    Type Alias ApiGatewayProps<AuthScopesT>

    Props for the ApiGateway construct.

    Kristian Rekstad kre@capraconsulting.no

    Hermann Mørkrid hem@liflig.no

    type ApiGatewayProps<AuthScopesT extends string = string> = {
        accessLogs?: ApiGatewayAccessLogsProps;
        corsAllowAll?: boolean;
        defaultAuthorization?: AuthorizationProps<AuthScopesT>;
        defaultIntegration?: IntegrationProps;
        detailedMetrics?: boolean;
        dns: ApiGatewayDnsProps;
        propsOverride?: { httpApi?: Partial<apigw.HttpApiProps> };
        routes: ApiGatewayRoute<AuthScopesT>[];
        throttling?: { burst?: number; rate?: number };
    }

    Type Parameters

    • AuthScopesT extends string = string
    Index

    Properties

    The API-GW access logs for the $default stage are kept. This has options for the logs.

    corsAllowAll?: boolean

    Sets CORS headers on responses from the API Gateway to allow all origins, headers and methods. Useful if your API should be accessed by any browser.

    defaultAuthorization?: AuthorizationProps<AuthScopesT>

    If no authorization is specified for a route, this authorization is used.

    See AuthorizationProps for the available options.

    defaultIntegration?: IntegrationProps

    If no integration is specified for a route, this integration is used.

    See IntegrationProps for the available options.

    detailedMetrics?: boolean

    Set to false to disable route-level metrics. This can increase CloudWatch costs when not disabled.

    See AWS: Working with metrics for HTTP APIs for more info.

    true
    

    Settings for the external-facing part of the API-GW.

    propsOverride?: { httpApi?: Partial<apigw.HttpApiProps> }

    If some settings in this construct do not work for you, this is an escape hatch mechanism to override anything.

    Type declaration

    • OptionalhttpApi?: Partial<apigw.HttpApiProps>

      Override settings for the apigw.HttpApi (accessible in ApiGateway.httpApi).

      For example, if you have a frontend accessing this API, you might want to set CORS preflight settings.

    throttling?: { burst?: number; rate?: number }

    Throttling of requests. If not set, the AWS default of 5000 burst and 10000 rate is used.

    The default throttling is per-account, and counts all APIs in the account and region. If you have another API in this region getting 10_000 request rate, it may impact this API as well.

    Type declaration

    • Optionalburst?: number

      Going over 5_000 may require you to contact AWS Support - they are account bound.

    • Optionalrate?: number

      Going over 10_000 may require you to contact AWS Support - they are account bound.