Loading Posts...

How To Create A VPC Peering In MongoDB Atlas Cloud And AWS

How To Create A VPC Peering In MongoDB Atlas Cloud And AWS

I have been working in with MongoDB Atlas Cloud, and involved with few configurations, I thought to bring up this article to show how to create a VPC Peering in MongoDB Atlas and AWS cloud. If you are new for MongoDB Atlas Cloud please feel free to go through my previous post.

To work with MongoDB VPC peering MongoDB Atlas cluster should be built with M10 or higher Tier. Still You can create the VPC Peering with the Free Tier Sandbox and the VPC peering functionality would not succeeded with that. MongoDB Atlas M10 Tier will give you 2GB of RAM and 10GB of Storage, along with 100 IOPS and 350 Maximum connections up to 5 Gigabit Network Performance.

Create A VPC Peering In MongoDB Atlas M10 Tier

Creating cluster would take few minutes, and allow sometime to complete the creation process. After the completion of the cluster creation, go to the “Network Access“.

Create A VPC Peering In MongoDB Atlas Network Access

Click on “Peering” and “+NEW PEERING CONNECTION” button to create the peering connection

Create A VPC Peering In MongoDB Atlas VPC Peering

Select the cloud provider, I’m not quite sure of the purpose of this step as other cloud providers grayed out. Also, I’m not quite sure whether MongoDB Atlas can make cross cloud platform peering for the connectivity. Go to the next step.

Create A VPC Peering In MongoDB Atlas Select Cloud

Provide the Approver VPC details in the next step, including, AWS account ID, VPC ID, CIDR Block, Regions and MongoDB Atlas CIDR.

Create A VPC Peering In MongoDB Atlas VPC details

It will initialize the VPC Peering connection to the AWS account, and its time to approve the VPC Peering request from the AWS VPC.

VPC Peering request will appear in the AWS VPC, and it will be awaiting for the approval

Create A VPC Peering In MongoDB Atlas Pending

Approve the Peering request

Create A VPC Peering In MongoDB Atlas accept request
Create A VPC Peering In MongoDB Atlas say yes

AWS VPC CIDR will show as “Active” after the successful VPC Peering connection

Create A VPC Peering In MongoDB Atlas active state

VPC Connection shows as “Available”, for me it took a while to reflect it here even though connection established

Create A VPC Peering In MongoDB Atlas available state

Edit the AWS Route table to route MongoDB CIDR block traffic through the peering connection

Create A VPC Peering In MongoDB Atlas edit route table

I had few connectivity issues, and I had to enable the “DNS resolution from requester VPC to private IP” option in order to fix them.

Create A VPC Peering In MongoDB Atlas more settings

I have installed the “MongoShell” on my EC2 instance and copied the connection url from the MongoDB Atlas console. If you want to know how to install the Mongo shell follow my previous article.

Create A VPC Peering In MongoDB Atlas copy connection

I was able to connect to the MongoDB Cluster without an issue from my EC2 instance

Create A VPC Peering In MongoDB Atlas connected

Verified the connectivity to the local IP through the VPC Peering Connection

Create A VPC Peering In MongoDB Atlas confirm connection

 Create A VPC Peering In MongoDB Atlas Cloud to AWS was quite easy and it is the way to access the MongoDB Atlas Cloud from EC2 instances securely and efficiently in the cloud.

Click to rate this post!
[Total: 5 Average: 5]

Aruna Fernando

"Sharing knowledge doesn't put your job at risk - iron sharpen iron" I heard this and it's true.

Get Updates Directly To Your Inbox!

   

Leave a Comment

Loading Posts...