Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Future Consideration
Created by Mikko Caldara
Created on Apr 28, 2026

Automate Inbound VPC Peering in Terraform

What problem are you trying to solve?

Focus on the what and why of the need you have, not the how you'd like it solved.

Automating the creation of Inbound VPC Peerings, where Atlas is the accepter

What would you like to see happen?

Describe the desired outcome or enhancement.

Expose the necessary information as Terraform Data source:

  • Atlas AWS Account ID

  • Atlas VPC ID

  • Atlas VPC CIDR

This information is currently exposed in the UI, under Network Peering -> Learn how to connect inbound peers.

After the VPC Peering request has been created, another Atlas Terraform resource could be needed to automate the acceptance of such Peering request.

Why is this important to you or your team?

Explain how the request adds value or solves a business need.

Automating with Infrastructure as Code and avoding manual steps.

What steps, if any, are you taking today to manage this problem?

Doing this manually.


  • Admin
    Alexander Johansson
    May 13, 2026

    acknowledged, sorry for the mix up. Let me get back with the team and advised

  • Mikko Caldara
    May 13, 2026

    Hello Alex, the link you posted provide an example for PrivateLink.

    My request is specifically targeted to Inbound VPC Peering requests (not Outbound, i.e. initiated by Atlas). Background: https://www.mongodb.com/docs/atlas/atlas-stream-processing/manage-vpc-peering-connections/


    The current flow is:

    1) (Terraform) create the VPC Peering/Request from a 3rd party AWS Account (i.e. Confluent, Aiven, etc)

    2) (Manual Atlas UI) create a dummy/test Stream Processing instance in Atlas - without this the VPC Peering Request will never be visible in Atlas UI

    3) (Manual Atlas UI) Wait a few minutes and populate the inbound connection requests (see screenshot)

    4) (Manual Atlas UI) Accept the Incoming VPC request

    5) (Manual Atlas UI) Delete the dummy/test Stream Processing instance


    I would expect steps 3 and 4 to be easily doable in Terraform, given we know the AWS Account ID of the requester. In pure Terraform this resource is used: https://registry.terraform.io/providers/-/aws/6.44.0/docs/resources/vpc_peering_connection_accepter


    I have also raised a ticket to remove the need for Step 2 all together, but that is still being worked on as far as I know. "Hiding" the Inbound VPC Peering feature behind Atlas Stream Processing makes no sense... We need the VPC Peering without using Stream Processing.



  • Admin
    Alexander Johansson
    May 12, 2026

    Hello - Thank you for the feedback. One hard limit is that the AWS side of the creation requires AWS credentials into your AWS account - its outside of our immediate control.

    We have a solution (and recommended approach) use this official Terraform module that combines both the AWS and Atlas resource deployments
    https://github.com/terraform-mongodbatlas-modules/terraform-mongodbatlas-atlas-aws/blob/main/examples/privatelink/main.tf


    One small adjustment - a subnet (versus CIDR) is required. The module requires a VPC and subnet (along with an authenticated AWS profile which provides the AWS account).