@altostra/core
Version:
Core library for shared types and logic
56 lines (55 loc) • 2.6 kB
TypeScript
import type { NaturalNumber } from "../../../common/CustomTypes/Numerics";
import type { Arn } from "../../CustomTypes/Arn";
import type { AwsResourceCommon } from "../common";
import type { CloudFormationValue } from "../IntrinsicFunctions";
export declare type IntegrationType = 'AWS::ApiGatewayV2::Integration';
export interface Integration extends AwsResourceCommon {
Type: IntegrationType;
Properties: IntegrationProperties;
}
export declare type IntegrationProperties = HttpIntegrationProperties | WebSocketIntegrationProperties;
export declare type HttpIntegrationProperties = GenericHttpIntegrationProperties & HttpIntegrationTypes;
export declare type WebSocketIntegrationProperties = GenericWebSocketIntegrationProperties & WebSocketIntegrationTypes;
export interface GenericHttpIntegrationProperties extends GenericIntegrationPropertiesBase {
ConnectionId?: CloudFormationValue;
PayloadFormatVersion: PayloadFormatVersion;
ResponseParameters?: object;
TlsConfig?: object;
IntegrationMethod: string;
}
export interface GenericWebSocketIntegrationProperties extends GenericIntegrationPropertiesBase {
ContentHandlingStrategy?: 'CONVERT_TO_BINARY' | 'CONVERT_TO_TEXT';
PassthroughBehavior?: 'NEVER' | 'WHEN_NO_MATCH' | 'WHEN_NO_TEMPLATES';
RequestTemplates?: Record<string, string>;
TemplateSelectionExpression?: string;
}
export interface GenericIntegrationPropertiesBase {
ApiId: CloudFormationValue;
CredentialsArn?: CloudFormationValue<Arn>;
Description?: string;
ConnectionType?: 'INTERNET' | 'VPC_LINK';
IntegrationUri?: CloudFormationValue;
PayloadFormatVersion?: PayloadFormatVersion;
RequestParameters?: object;
TimeoutInMillis?: NaturalNumber;
}
export declare type HttpIntegrationTypes = CommonWebSocketIntegrations;
export declare type WebSocketIntegrationTypes = AWSIntegrationProperties | CommonWebSocketIntegrations | HttpTargetingIntegrationProperties | MockProxyIntegrationProperties;
export declare type CommonWebSocketIntegrations = AWSProxyIntegrationProperties | HttpProxyIntegrationProperties;
export interface AWSIntegrationProperties {
IntegrationType: 'AWS';
}
export interface AWSProxyIntegrationProperties {
IntegrationType: 'AWS_PROXY';
IntegrationSubtype?: string;
}
export interface HttpTargetingIntegrationProperties {
IntegrationType: 'HTTP';
}
export interface HttpProxyIntegrationProperties {
IntegrationType: 'HTTP_PROXY';
}
export interface MockProxyIntegrationProperties {
IntegrationType: 'MOCK';
}
export declare type PayloadFormatVersion = '1.0' | '2.0';