CDK - API Gateway Helper
This package is used as a helper for API Gateway, to easily add lambda functions to an API Gateway
API Reference
Classes
ApiGatewayHelper
Initializers
import { ApiGatewayHelper } from 'cdk-api-gateway-helper-lib'
new ApiGatewayHelper(stack: Stack, resourceName: string)
Name | Type | Description |
---|
stack | aws-cdk-lib.Stack | No description. |
resourceName | string | No description. |
stack
Required
resourceName
Required
Methods
Name | Description |
---|
addApiToGateway | No description. |
addDefaultAuthErrorResponse | No description. |
addUsagePlan | No description. |
returnGateway | No description. |
addApiToGateway
public addApiToGateway(params: IGatewayIF): Method
params
Required
addDefaultAuthErrorResponse
public addDefaultAuthErrorResponse(name: string): void
name
Required
addUsagePlan
public addUsagePlan(planName: string, defaultPlan: UsagePlanProps, throttlePerMethod?: ThrottlingPerMethod[], apiKey?: IApiKey): void
planName
Required
defaultPlan
Required
- Type: aws-cdk-lib.aws_apigateway.UsagePlanProps
throttlePerMethod
Optional
- Type: aws-cdk-lib.aws_apigateway.ThrottlingPerMethod[]
apiKey
Optional
returnGateway
public returnGateway(): RestApi
Properties
Name | Type | Description |
---|
gateway | aws-cdk-lib.aws_apigateway.RestApi | No description. |
resourceName | string | No description. |
stack | aws-cdk-lib.Stack | No description. |
throttlingArr | aws-cdk-lib.aws_apigateway.ThrottlingPerMethod[] | No description. |
gateway
Required
public readonly gateway: RestApi;
- Type: aws-cdk-lib.aws_apigateway.RestApi
resourceName
Required
public readonly resourceName: string;
stack
Required
public readonly stack: Stack;
throttlingArr
Required
public readonly throttlingArr: ThrottlingPerMethod[];
- Type: aws-cdk-lib.aws_apigateway.ThrottlingPerMethod[]
Protocols
IApiKey
Properties
Name | Type | Description |
---|
key | aws-cdk-lib.aws_apigateway.IApiKey | No description. |
overrideLogicalId | string | No description. |
key
Required
public readonly key: IApiKey;
- Type: aws-cdk-lib.aws_apigateway.IApiKey
overrideLogicalId
Required
public readonly overrideLogicalId: string;
IGatewayIF
- Implemented By: IGatewayIF
Properties
Name | Type | Description |
---|
lambdaFunction | aws-cdk-lib.aws_lambda.IFunction | No description. |
methodType | string | No description. |
resourceName | string | No description. |
resourceVersion | string | No description. |
useApiKey | boolean | No description. |
useAuthorizer | boolean | No description. |
userPoolID | string | No description. |
pathParams | string | No description. |
throttling | aws-cdk-lib.aws_apigateway.ThrottleSettings | No description. |
lambdaFunction
Required
public readonly lambdaFunction: IFunction;
- Type: aws-cdk-lib.aws_lambda.IFunction
methodType
Required
public readonly methodType: string;
resourceName
Required
public readonly resourceName: string;
resourceVersion
Required
public readonly resourceVersion: string;
useApiKey
Required
public readonly useApiKey: boolean;
useAuthorizer
Required
public readonly useAuthorizer: boolean;
userPoolID
Required
public readonly userPoolID: string;
pathParams
Optional
public readonly pathParams: string;
throttling
Optional
public readonly throttling: ThrottleSettings;
- Type: aws-cdk-lib.aws_apigateway.ThrottleSettings