Is there any good way to setup an API endpoint to ...
# help
k
Is there any good way to setup an API endpoint to directly push to SQS ?
s
I believe this is a REST API feature, and
sst.Api
uses HTTP API. so you would probably have to set up a REST API using CDK directly
s
Well, API Gateway offers a service integration that lets you skip Lambda and go direct to SQS (and lots of other service integrations). However, I do not believe SST does anything here
CDK Patterns has an example service integration between API GW and DynamoDB, you might want to check there for reference. https://github.com/cdk-patterns/serverless/tree/main/the-dynamo-streamer
k
Ah I see so the V2 API gateway does not support this
Thanks for the examples @Seth Geoghegan
s
Yup, which is a shame
s
HTTP API is intended to be more of a “lite” service 🙂 it’s cheaper, so the trade-off is on feature set
k
Yeah makes sense, one thing I could do is use v1 for only the endpoint I need to move to SQS so should not be a huge deal
d
Your guys' conclusions on v1 are right, and characterization of v2/http are right (faster, cheaper), but it actually DOES support this: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services.html
f
@Derek Kershner is right, HTTP API (v2) CAN integrate with a few AWS services, and SQS is one of them https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services-reference.html
CDK recently added support for this. However, high level support for HTTP API -> SQS is still work in progress.
If you want don’t to wait for high level support, it is already doable today using CDK.
s
oh nice! didn’t know that