Is there a way to add an integration response to the AWS WebSocket API using AWS CDK with the aws-apigatewayv2 package? This answer shows a great way to achieve just that using CloudFormation. But I haven't been able to translate it into the AWS CDK. Thanks!
EDIT:
Sorry, I should have clarified how I am trying to add the integration response now:
const webSocketApi = new WebSocketApi(this, 'Api', {
defaultRouteOptions: {
integration: new LambdaWebSocketIntegration({ handler: lambdaFn }),
},
})
new CfnIntegrationResponse(this, 'response', {
apiId: webSocketApi.apiId,
integrationId: /* ? */,
integrationResponseKey: '$default',
})
const stage = new WebSocketStage(this, 'Stage', {
webSocketApi,
stageName: 'dev',
autoDeploy: true,
})
I could add the integration response using CfnIntegrationResponse but I don't have a way to access the integration id of the LambdaWebSocketIntegration.