@Nghia_Nguyen looking at the ssh2promise docs, addTunnel() accepts localPort not localHost for configuration. tunnelX.localHost returns undefined when I try it. It could be that you are using an older version of the package that did support that. So maybe the connection string is incorrect? The connection string should be:

const url = `mongodb://${mongoUsername}:${mongoPassword}@localhost:${tunnel1.localPort},localhost:${tunnel2.localPort},localhost:${tunnel3.localPort}/${database}?ssl=true&replicaSet=atlas-<cluster>-shard-0&authSource=admin&retryWrites=true&w=majority`