@altostra/core
Version:
Core library for shared types and logic
39 lines (38 loc) • 1.47 kB
TypeScript
import type { NonEmptyString } from "../../../common/CustomTypes/NonEmptyString";
import type { Arn } from "../../CustomTypes/Arn";
import type { AwsResourceCommon } from "../common";
import type { CloudFormationValue } from "../IntrinsicFunctions";
export declare type ApiType = 'AWS::ApiGatewayV2::Api';
export interface Api extends AwsResourceCommon {
Type: ApiType;
Properties: ApiProperties;
}
export declare type ApiProperties = HttpApiProperties | WebSocketApiProperties;
export interface HttpApiProperties extends ApiPropertiesBase {
ProtocolType?: 'HTTP';
BasePath?: BasePath;
Body?: object;
BodyS3Location?: string;
CorsConfiguration?: object;
RouteKey?: string;
RouteSelectionExpression?: '${request.method} ${request.path}';
}
export interface WebSocketApiProperties extends ApiPropertiesBase {
ProtocolType: 'WEBSOCKET';
ApiKeySelectionExpression?: NonEmptyString;
DisableSchemaValidation?: boolean;
Name: CloudFormationValue<NonEmptyString>;
RouteSelectionExpression: NonEmptyString;
}
export interface ApiPropertiesBase {
ProtocolType?: string;
CredentialsArn?: CloudFormationValue<Arn>;
Description?: string;
DisableExecuteApiEndpoint?: boolean;
FailOnWarnings?: boolean;
Name?: CloudFormationValue<NonEmptyString>;
Tags?: Record<string, string>;
Target?: CloudFormationValue;
Version?: string;
}
export declare type BasePath = 'ignore' | 'prepend' | 'split';