Does SST support API construct to be connected to ...
# sst
a
Does SST support API construct to be connected to SQS directly?
o
I managed to figure out how to do this between APIG V1 and eventbridge in the AWS console, but for the life of me couldn’t figure out the cloudformation YAML syntax do it in in SLS. So I ended up using a lambda to do the forwarding instead. Have notes somewhere on how to configure the headers and mapping templates if anyone wants
a
😞
Trying to figure out how to do with API GW v2.
I mean, HTTP API. Looks like it’s easy with SLS.
But can’t find how to do with SST/CDK yet.
o
But I figured better to use a solution that looks like the rest of the codebase for other people on my team
a
Looks like this is common with HTTP API integrations.
o
I think this post has an approach that could be adapted to work for you: https://github.com/aws/aws-cdk/issues/10497#issuecomment-760125780
a
Oh interesting.
This uses low level CFN classes.
Makes sense.
o
And this PR to add it as a higher level construct is in process: https://github.com/aws/aws-cdk/pull/16287
a
Amazing!
I was looking for that 😍
f
Hey guys, yeah, we have an open issue for this.. waiting for CDK to add high level support for it - https://github.com/serverless-stack/serverless-stack/issues/565
a
Thanks @Frank.
Going to try the low level stuff.
I’m using this..
Copy code
new CfnIntegration(this, 'yabbleSurveyResponsesApiIntegration', {
      apiId: surveyResponsesApi.httpApiId,
      integrationType: 'AWS_PROXY',
      integrationSubtype: 'SQS-SendMessage',
      //   credentialsArn: role.roleArn,
      requestParameters: {
        Source: 'Gateway',
        Detail: '$request.body',
        DetailType: 'api-call',
        QueueUrl: surveyResponsesToProcessQueue.sqsQueue.queueUrl,
      },
      payloadFormatVersion: '1.0',
      timeoutInMillis: 10000,
    });
Do you see anything wrong?
Not sure about the parameters for SQS.