I successfully set up AWS DocumentDB with a bastion server, and I can connect to it using MongoDB Compass. However, when attempting to access the resource programmatically, I encounter a timeout error

0

I employed this code from "https://docs.aws.amazon.com/documentdb/latest/developerguide/connect_programmatically.html#connect_programmatically-tls_disabled". It functioned correctly on the bastion server, but it isn't working on my local server and also I get this error "raise ServerSelectionTimeoutError( pymongo.errors.ServerSelectionTimeoutError:"

  • Hi,

    From your local, did you connect to the bastion first with an SSH tunnel as mentioned here?

    https://docs.aws.amazon.com/documentdb/latest/developerguide/connect-from-outside-a-vpc.html

  • Hi, Kyle_B I've successfully established a connection to the bastion server from my local machine, and it's functioning well. However, I encountered an issue when attempting to access the DocumentDB via programming from my local machine. While the AWS documentation outlines how to access DocumentDB programmatically, the same program that works on the Bastion server doesn't function on my local machine outside the VPC. My question is, how can I connect to DocumentDB programmatically from my local machine?

  • Karthik,

    Was the SSH tunnel created from the bastion?

  • Yes, if I follow this documentation, the program works correctly when executed on the Bastion server since both the AWS DocumentDB and the Bastion server exist in the same VPC. However, my concern is whether I am required to run the program exclusively on the Bastion server. Unlike with a MySQL cluster in RDS, where I can programmatically access it without needing jump server credentials, I wish to run the program solely on my local machine. The current documentation only provides the URI, and while adding SSH tunneling credentials establishes a connection, it does not reach the DocumentDB.

KARTHIK
질문됨 5달 전109회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠