You can enable private communication between the serverless runtime environment and MongoDB endpoint hosted on the AWS platform.
To configure AWS PrivateLink using a serverless runtime environment, specify the direct node address in the Advanced Custom Properties field in the serverless runtime environment properties. Then, specify the same direct node address as the host name in the Host field in the MongoDB V2 connection, instead of entering the MongoDB cluster name, which is the primary node.
For more information about configuring a serverless runtime environment using AWS PrivateLink, see Serverless runtime environments.