Interface InternalAPIRequestParams

The parameters needed to invoke an internal API request.

don't run a Lambda from another Lambda (bad practice).

interface InternalAPIRequestParams {
    body?: any;
    eventBridge?: {
        bus?: string;
        target?: string;
    };
    httpMethod: string;
    lambda?: string;
    pathParams?: {
        [index: string]: string | number;
    };
    queryParams?: {
        [index: string]: string | number;
    };
    resource: string;
    stage?: string;
}

Properties

body?: any

The body of the request.

eventBridge?: {
    bus?: string;
    target?: string;
}

The EventBridge destination of the request. If the bus name or ARN isn't specified, the default one is used. The target maps into the DetailType of the event. Note: the invocation is always asyncronous. Either this attribute or lambda must be set.

httpMethod: string

The http method to use.

lambda?: string

The name of the Lambda function receiving the request; e.g. project_memberships. Note: the invocation is always syncronous. Either this attribute or eventBus must be set.

pathParams?: {
    [index: string]: string | number;
}

The parameters to substitute in the path.

queryParams?: {
    [index: string]: string | number;
}

The parameters to substitute in the path.

resource: string

The path (in the internal API) to the resource we need; e.g. teams/{teamId}/memberships/{userId}.

stage?: string

The alias of the lambda function to invoke. Default: the value of the current API stage.