Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Add support for asynchronous lambda invocation with integration type AWS #4862
This is a Feature Proposal
API Gateway supports asynchronous lambda invocation when integration type is AWS. Described here:
Asynchronous lambda invocation allows for a quick response back (e.g. 202 Accepted) while allowing the lambda to continue running. This would be desired if you wish to kick off a lambda that runs longer then the API GW 30 second timeout, or if the application needs a quick response without the need for direct success for failure of the longer running lambda.
Add new integration type
lambda: handler: index.handler events: - http: path: users method: post integration: AWS_ASYNC
@jjkirby Developed the following resource override to use as a work-around until the feature proposal is complete:
resources: Resources: ApiGatewayMethodUsersPost: Type: AWS::ApiGateway::Method Properties: HttpMethod: POST Integration: IntegrationHttpMethod: POST Type: "AWS" RequestParameters: "integration.request.header.X-Amz-Invocation-Type": "'Event'"
@jjkirby If you find there is a need for additional resource overrides please add that information here. Thanks
Hi @defionscode. I wrote the feature proposal after helping jjkirby on slack with how to figure out what resource override was needed to get this to work. I am not currently using asynchronous lambda's and wont have time to implement this, but thought it would be helpful to the community to document the current work-around and propose how to get this integrated.
What is needed now is someone to develop the feature with the unit tests and documentation and then make a pull request for review.
@scott2b Here are my snippets:
One of the keys is double quote around single quote on request parameter Event and WHEN-NO _MATCH on pass through
Then my resources:
Is there anyway to override the resource while still keeping the very easy to use Api object in the events of the lambda functions that use that specific API gateway?