I setup my lambda in AWS in the following way:
There is an API Gateway trigger which triggers a Lambda, which in turn is supposed to write to SQS.
The last part doesn't happen. From what I've read, this is because API Gateway invokes lambdas synchronously by default since calling it async-ly sacrifices the ability to return a response from the lambda.
I have also read that nonetheless, it is possible to configure API Gateway to call lambas async: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-integration-async.html
However, it is unclear how to do this when the API Gateway is created by Lambda, as is the case with triggers. There is no clear way of adding additional headers to them.
Is it possible make it do an async invocation?
After digging into it, it seems that API Gateway does not (yet) support async invocations for lambdas in any way for HTTP APIs, it is possible REST APIs.
Step 1: Create a trigger using the REST configuration
Step 2: Disable proxy integration
Async is explicitly not supported for proxies.
Step 3: Add magic header to make lambda async
Step 4: Confirm
To confirm if it worked, look into your destination (in my case SQS) to confirm.
Additionally, your API (when called via API Gateway) should now return an empty page.