A library to provide the ApiGatewayManagementApi
module from [email protected]
for AWS Lambda container that has only [email protected]
library. It is highly inspired from guerrerocarlos/AWS-ApiGatewayManagementApi.
Now, AWS Lambda for JavaScript runtime has [email protected]
that already includes a basic ApiGatewayManagementApi
module but there is a missing useful API such as DeleteConnection
. This library will patch your aws-sdk
as possible as small.
Please see aws-sdk-js/CHANGELOG with a search of apigatewaymanagementapi
. Now, there is the only change for DeleteConnection
API.
yarn add @yingyeothon/aws-apigateway-management-api
import { newApiGatewayManagementApi } from "@yingyeothon/aws-apigateway-management-api";
const dropConnection = (event: APIGatewayProxyEvent) =>
newApiGatewayManagementApi({
endpoint: event.requestContext.domainName + "/" + event.requestContext.stage
})
.deleteConnection({
ConnectionId: event.requestContext.connectionId
})
.promise();
This code is copied from aws-sdk-js.
Unlike guerrerocarlos/AWS-ApiGatewayManagementApi, it will patch anyway if there is a newly module in your aws-sdk
so please be careful.