I am setting up a WebSocket API in Api Gateway. I am currently using v1 of the SDK, and I want to move to V3. This is the code that I have attempted to use:

const apiGwManApiClient = new ApiGatewayManagementApiClient({
  region: process.env.AWS_REGION,
  endpoint: process.env.WS_API_ENDPOINT,
});

const postToConnectionCommandResp = await apiGwManApiClient.send(new 
  PostToConnectionCommand({
      ConnectionId: connectionItems[ind].connectionId,
      Data: textEncoder.encode('blah blah'),
   })
);

When I attempt to use the API Gateway endpoint or the Custom domain I have set up, I get an error complaining that the URL is not correct, or it can't connect to the endpoint etc. I would like to know what the format of the URL I need to use here for both the API Gateway endpoint (/^..execute-api...amazonaws.com$/) and for my custom domain I have set (e.g.: ws.acme.com)

In V1 of the SDK, using abc.execute-api.region.amazonaws.com/stage or ws.acme.com just works

0

There are 0 best solutions below