Closed XaeroDegreaz closed 1 month ago
you can specify the lambda handlers like this
api.route( "$connect", { handler: "lambda/handler.connect", link: [api] } );
I tried that before, and it still said the function was unlinked when attempting to access Resources.MyApi.managementEndpoint
.
@thdxr
sst.config.ts
handler.ts
Error:
i'm not sure yet - i implemented this exact thing a few days ago and it worked
Is there some special directory structure required in order for resources to be able to be passed, and a link recognized?
sst: ion (3.0.15)
I have an
ApiGatewayWebSocket
component defined:And a default handler:
managementEndpoint
. Simply usingResource.MyApi.managementResource
inside the handler doesn't work because the componenent isn't 'linked' with itself.execute-api:ManageConnections
permission so that it can send messages to clients.I had to manually define the
$default
handler to include the permission, as well as an environment variable pointing to themanagementEndpoint
:Documentation for the
managementEndpoint
does not seem to be correct:I always get the error:
in my terminal when running
npm run dev