SageMaker connecting with other resources than S3

Hello, everyone.

I’m finishing the Practical Data Science on the AWS Cloud Specialization. Yet, there is one thing that was not covered that I’m struggling with.

In the courses, all resources are in S3 buckets. Yet, in my job, we have a DocumentDB (a Mongo database) which contains our data, and I’d like to connect to it using SageMaker, i.e. pymongo from within a notebook in SageMaker Studio. I was wondering if anyone has done something like this. I’ve tried some of the tutorials from AWS, but it did not work! The tutorials were from 2020, so I wonder if things changed since then.

I’d love some help on how to setup SageMaker in order to connect to not only DocumentDB, but any other resource that is not an S3 bucket.