Any way to do `Api` targets using <aws-proxy> ? so...
# help
d
Any way to do
Api
targets using aws-proxy ? so we can directly target services? SNS, EventBridge etc?
t
CDK actually doesn't support this yet
I've needed it as well
EventBridge -> API
d
Oh I'm looking for the opposite API -> EventBridge
I believe it's called a “Service Integration”
Still not possible with CDK?
@thdxr Looks like it is possible with L1 ?
t
Ah api to eventbridge is possible, we don't support it easily yet
I do believe there's an issue for it
d
@thdxr any reason why this would not be somone’s go-to for setting up a webhook -> EventBridge? I figured it could also be done with APIG -> Lambda -> EventBridge. But I think that is what Service Integrations are for…. to go directly to the service without the lambda middleman.
Also, if I stop using SST.Api and use core constructs for that… but I continue to use SST.Function…. do I loose anything local debugging related?
t
Yeah webhooks are great for a direct integration, I want this myself. I meant we can wrap that L2 compelxity with a simpler implementation on our end
and sst.Function is a normal lambda.Function so you can pass that anywhere in cdk
d
yup, it was more about whether I would loose that cool local function debugging / tracing in SST…. is that tied to Function so as long as I use that I’m good, even with other core Constructs?
f
@Dan Van Brunt yeah we are waiting for CDK to add L2 support for service integrations https://github.com/aws/aws-cdk/pull/16287
If you decide to give it a crack and wire it up urself using L1 constructs, you can still use
sst.Api
. No need to ditch it, b/c
sst.Api.httpApi
gives u the underlying
apigv2.HttpApi
.
d
ah… sweet… ya still getting the hang of L2/L1 stuff with CDK
f
For example:
Copy code
const api = new sst.Api(...);
api.httpApi.node.defaultChild <- CfnHttpApi object
d
sweeeet…. that would be great cause I REALLY like SST.Api
code is so concise