I need to create a APIGateway as a proxy for creat...
# help
a
I need to create a APIGateway as a proxy for creating a stream in a existing kinesis stream directly without any lambda, did anyone do it in sst and if so can you please help me with that?
f
Hey @Albert, just to clarify, are you looking to have API Gateway to put something into a stream or creating a new stream?
a
To put something in the stream
f
Gotcha. Yeah, CDK is adding support for it, and we will support it once it’s ready.
We’ve got an open issue with a link to the CDK’s PR https://github.com/serverless-stack/serverless-stack/issues/565
Btw, is it a blocking issue for you? You can do this today by writing some CloudFormation constructs in ur SST app. A bit cumbersome, but works.
If you want to give that a try, let me know and I can dig up some sample code.
r
As described, this is possible today! We're doing this to ingest logs from an external service, but as Frank noted official L2 support isn't there (yet) so you have to do a small workaround to make it work in the CDK
a
Yeah @Frank please send me the sample code because I did not know it is not possible for now even in CDK. And yes it is a blocking issue
f
Not sure if @Richard Simpson has something more readily usable. I looked at the CDK PR, and saw this is how they are creating the Kinesis PutRecord integration https://github.com/aws/aws-cdk/blob/1a9efabf2889f1e6cbbb6f3c0830e6fe08ea47c3/packages/%40aws-cdk/aws-apigatewayv2-integrations/lib/http/aws-proxy.ts#L429-L453 And this is how they are adding the integration to an Api https://github.com/aws/aws-cdk/pull/16287/files#diff-857eb32dec19ebc67f0650fe3044b3861171d9d78fff8dec142775f43c451ce3R25-R33
a
@Frank This is for V2 but we are Using V1 so is there anything else ?
r
This is basically the code we're using. Should work fine for v1 too, you'll just need to adapt the imports to their v1 versions. Don't forget to review the parameters being passed into to the stream and the API integration (like partition key)
a
Thank you 🙌
f
Thanks @Richard Simpson, added ur example to the GH issue.
r
The good news is this was inspired by the exact PR that Frank linked, so when it actually lands it shouldn't look much different 😁