A simple API Gateway in AWS that stores inbound HTTPS calls as SQS FIFO messages for asynchronous remote retrieval. If you need a way to get HTTP requests to a resource behind a firewall or NAT gateway, this might work.
The gateway exists as a Serverless project with AWS-specific resources. Once you have your API keys for an AWS account, the gateway can be deployed with:
npm ci
serverless deploy --aws-profile <PROFILE>
HTTP requests are sent to the SQS Gateway over HTTP POST with any content you wish in the body. An API key is expected as a query parameter in the URL, as in:
https://yourapi.execute-api.yourregion.amazonaws.com/stage/submit?apikey=LONGAUTOGENERATEDKEY
The API key is available in the AWS Secrets Manager and is autogenerated upon deployment.
A sample Node.JS script is located in the /scripts
directory as an example of how you could subscribe to the SQS queue receiving inbound requests. The remote gateway would intercept the request, store the contents as an SQS message, and then allow subscribers polling the queue to fetch them.
The default settings in serverless.yml
rate limit the API Gateway Stage to 1 request per second, with 1 concurrent request. Some default web application firewall rules are also applied to the gateway. To modify these settings, tweak serverless.yml
or resources/waf.yml
as needed.