First of all, some context for other audience members : in the case it’s not clear what a VPC peering
is on AWS, it’s the act of matching two networks from two different AWS accounts, so you can have in the same region, two different VPCs from two different accounts talking together.
In my case I use MongoDB Atlas
that way, so I can access MongoDB Atlas locally, and not use the external network. It all stays internally in the AWS accounts from MongoDB and mine.
Let me show you some code :