connection issue to aws neptune in nodejs

i am trying to implement aws neptune in my nodejs application. i’ve successfully created the database, and i have written the code for connection with neptune. i am unable to connect. following error appears:

ERROR Error: connect ETIMEDOUT 172.31.23.182:8182
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) {
  errno: -4039,
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: '172.31.23.182',
  port: 8182
}

i am using npm i gremline, in nodejs to establish a connection with aws neptune

following is my code for it

const gremlin = require("gremlin");
const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection;
const Graph = gremlin.structure.Graph;

dc = new DriverRemoteConnection(
  "wss://db-neptune-1-instance-1.crgy0cuiqvqy.ap-southeast-2.neptune.amazonaws.com:8182",
  {}
);
// console.log(process.env.wws_connection_PORT);

const graph = new Graph();
const g = graph.traversal().withRemote(dc);

g.V()
  .limit(1)
  .count()
  .next()
  .then((data) => {
    console.log(data);
    dc.close();
  })
  .catch((error) => {
    console.log("inside catch")
    console.log("ERROR", error);
    dc.close();
  });