1. Packages
  2. Mongodbatlas Provider
  3. API Docs
  4. getNetworkPeerings
MongoDB Atlas v3.30.0 published on Friday, Mar 21, 2025 by Pulumi

mongodbatlas.getNetworkPeerings

Explore with Pulumi AI

# Data Source: mongodbatlas.getNetworkPeerings

mongodbatlas.getNetworkPeerings describes all Network Peering Connections.

NOTE: Groups and projects are synonymous terms. You may find group_id in the official documentation.

Example Usage

Basic Example (AWS).

import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";

const testNetworkPeering = new mongodbatlas.NetworkPeering("test", {
    accepterRegionName: "us-east-1",
    projectId: "<YOUR-PROJEC-ID>",
    containerId: "507f1f77bcf86cd799439011",
    providerName: "AWS",
    routeTableCidrBlock: "192.168.0.0/24",
    vpcId: "vpc-abc123abc123",
    awsAccountId: "abc123abc123",
});
const test = mongodbatlas.getNetworkPeeringsOutput({
    projectId: testNetworkPeering.projectId,
});
Copy
import pulumi
import pulumi_mongodbatlas as mongodbatlas

test_network_peering = mongodbatlas.NetworkPeering("test",
    accepter_region_name="us-east-1",
    project_id="<YOUR-PROJEC-ID>",
    container_id="507f1f77bcf86cd799439011",
    provider_name="AWS",
    route_table_cidr_block="192.168.0.0/24",
    vpc_id="vpc-abc123abc123",
    aws_account_id="abc123abc123")
test = mongodbatlas.get_network_peerings_output(project_id=test_network_peering.project_id)
Copy
package main

import (
	"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		testNetworkPeering, err := mongodbatlas.NewNetworkPeering(ctx, "test", &mongodbatlas.NetworkPeeringArgs{
			AccepterRegionName:  pulumi.String("us-east-1"),
			ProjectId:           pulumi.String("<YOUR-PROJEC-ID>"),
			ContainerId:         pulumi.String("507f1f77bcf86cd799439011"),
			ProviderName:        pulumi.String("AWS"),
			RouteTableCidrBlock: pulumi.String("192.168.0.0/24"),
			VpcId:               pulumi.String("vpc-abc123abc123"),
			AwsAccountId:        pulumi.String("abc123abc123"),
		})
		if err != nil {
			return err
		}
		_ = mongodbatlas.LookupNetworkPeeringsOutput(ctx, mongodbatlas.GetNetworkPeeringsOutputArgs{
			ProjectId: testNetworkPeering.ProjectId,
		}, nil)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

return await Deployment.RunAsync(() => 
{
    var testNetworkPeering = new Mongodbatlas.NetworkPeering("test", new()
    {
        AccepterRegionName = "us-east-1",
        ProjectId = "<YOUR-PROJEC-ID>",
        ContainerId = "507f1f77bcf86cd799439011",
        ProviderName = "AWS",
        RouteTableCidrBlock = "192.168.0.0/24",
        VpcId = "vpc-abc123abc123",
        AwsAccountId = "abc123abc123",
    });

    var test = Mongodbatlas.GetNetworkPeerings.Invoke(new()
    {
        ProjectId = testNetworkPeering.ProjectId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.NetworkPeering;
import com.pulumi.mongodbatlas.NetworkPeeringArgs;
import com.pulumi.mongodbatlas.MongodbatlasFunctions;
import com.pulumi.mongodbatlas.inputs.GetNetworkPeeringsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var testNetworkPeering = new NetworkPeering("testNetworkPeering", NetworkPeeringArgs.builder()
            .accepterRegionName("us-east-1")
            .projectId("<YOUR-PROJEC-ID>")
            .containerId("507f1f77bcf86cd799439011")
            .providerName("AWS")
            .routeTableCidrBlock("192.168.0.0/24")
            .vpcId("vpc-abc123abc123")
            .awsAccountId("abc123abc123")
            .build());

        final var test = MongodbatlasFunctions.getNetworkPeerings(GetNetworkPeeringsArgs.builder()
            .projectId(testNetworkPeering.projectId())
            .build());

    }
}
Copy
resources:
  testNetworkPeering:
    type: mongodbatlas:NetworkPeering
    name: test
    properties:
      accepterRegionName: us-east-1
      projectId: <YOUR-PROJEC-ID>
      containerId: 507f1f77bcf86cd799439011
      providerName: AWS
      routeTableCidrBlock: 192.168.0.0/24
      vpcId: vpc-abc123abc123
      awsAccountId: abc123abc123
variables:
  test:
    fn::invoke:
      function: mongodbatlas:getNetworkPeerings
      arguments:
        projectId: ${testNetworkPeering.projectId}
Copy

Using getNetworkPeerings

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getNetworkPeerings(args: GetNetworkPeeringsArgs, opts?: InvokeOptions): Promise<GetNetworkPeeringsResult>
function getNetworkPeeringsOutput(args: GetNetworkPeeringsOutputArgs, opts?: InvokeOptions): Output<GetNetworkPeeringsResult>
Copy
def get_network_peerings(project_id: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetNetworkPeeringsResult
def get_network_peerings_output(project_id: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetNetworkPeeringsResult]
Copy
func LookupNetworkPeerings(ctx *Context, args *LookupNetworkPeeringsArgs, opts ...InvokeOption) (*LookupNetworkPeeringsResult, error)
func LookupNetworkPeeringsOutput(ctx *Context, args *LookupNetworkPeeringsOutputArgs, opts ...InvokeOption) LookupNetworkPeeringsResultOutput
Copy

> Note: This function is named LookupNetworkPeerings in the Go SDK.

public static class GetNetworkPeerings 
{
    public static Task<GetNetworkPeeringsResult> InvokeAsync(GetNetworkPeeringsArgs args, InvokeOptions? opts = null)
    public static Output<GetNetworkPeeringsResult> Invoke(GetNetworkPeeringsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetNetworkPeeringsResult> getNetworkPeerings(GetNetworkPeeringsArgs args, InvokeOptions options)
public static Output<GetNetworkPeeringsResult> getNetworkPeerings(GetNetworkPeeringsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: mongodbatlas:index/getNetworkPeerings:getNetworkPeerings
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ProjectId This property is required. string
The unique ID for the project.
ProjectId This property is required. string
The unique ID for the project.
projectId This property is required. String
The unique ID for the project.
projectId This property is required. string
The unique ID for the project.
project_id This property is required. str
The unique ID for the project.
projectId This property is required. String
The unique ID for the project.

getNetworkPeerings Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
ProjectId string
Results List<GetNetworkPeeringsResult>
A list where each represents a Network Peering Connection.
Id string
The provider-assigned unique ID for this managed resource.
ProjectId string
Results []GetNetworkPeeringsResult
A list where each represents a Network Peering Connection.
id String
The provider-assigned unique ID for this managed resource.
projectId String
results List<GetNetworkPeeringsResult>
A list where each represents a Network Peering Connection.
id string
The provider-assigned unique ID for this managed resource.
projectId string
results GetNetworkPeeringsResult[]
A list where each represents a Network Peering Connection.
id str
The provider-assigned unique ID for this managed resource.
project_id str
results Sequence[GetNetworkPeeringsResult]
A list where each represents a Network Peering Connection.
id String
The provider-assigned unique ID for this managed resource.
projectId String
results List<Property Map>
A list where each represents a Network Peering Connection.

Supporting Types

GetNetworkPeeringsResult

AccepterRegionName This property is required. string
Specifies the region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
AtlasCidrBlock This property is required. string
AwsAccountId This property is required. string
Account ID of the owner of the peer VPC.
AzureDirectoryId This property is required. string
Unique identifier for an Azure AD directory.
AzureSubscriptionId This property is required. string
Unique identifer of the Azure subscription in which the VNet resides.
ConnectionId This property is required. string
Unique identifier for the peering connection.
ContainerId This property is required. string
ErrorMessage This property is required. string
When "status" : "FAILED", Atlas provides a description of the error.
ErrorState This property is required. string
Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
ErrorStateName This property is required. string
Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
GcpProjectId This property is required. string
GCP project ID of the owner of the network peer.
NetworkName This property is required. string
Name of the network peer to which Atlas connects.
PeeringId This property is required. string
Atlas assigned unique ID for the peering connection.
ProviderName This property is required. string
Cloud provider for this VPC peering connection. If omitted, Atlas sets this parameter to AWS. (Possible Values AWS, AZURE, GCP).
ResourceGroupName This property is required. string
Name of your Azure resource group.
RouteTableCidrBlock This property is required. string
Peer VPC CIDR block or subnet.
Status This property is required. string
Status of the Atlas network peering connection: ADDING_PEER, AVAILABLE, FAILED, DELETING, WAITING_FOR_USER.
StatusName This property is required. string
The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
VnetName This property is required. string
Name of your Azure VNet.
VpcId This property is required. string
Unique identifier of the peer VPC.
AccepterRegionName This property is required. string
Specifies the region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
AtlasCidrBlock This property is required. string
AwsAccountId This property is required. string
Account ID of the owner of the peer VPC.
AzureDirectoryId This property is required. string
Unique identifier for an Azure AD directory.
AzureSubscriptionId This property is required. string
Unique identifer of the Azure subscription in which the VNet resides.
ConnectionId This property is required. string
Unique identifier for the peering connection.
ContainerId This property is required. string
ErrorMessage This property is required. string
When "status" : "FAILED", Atlas provides a description of the error.
ErrorState This property is required. string
Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
ErrorStateName This property is required. string
Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
GcpProjectId This property is required. string
GCP project ID of the owner of the network peer.
NetworkName This property is required. string
Name of the network peer to which Atlas connects.
PeeringId This property is required. string
Atlas assigned unique ID for the peering connection.
ProviderName This property is required. string
Cloud provider for this VPC peering connection. If omitted, Atlas sets this parameter to AWS. (Possible Values AWS, AZURE, GCP).
ResourceGroupName This property is required. string
Name of your Azure resource group.
RouteTableCidrBlock This property is required. string
Peer VPC CIDR block or subnet.
Status This property is required. string
Status of the Atlas network peering connection: ADDING_PEER, AVAILABLE, FAILED, DELETING, WAITING_FOR_USER.
StatusName This property is required. string
The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
VnetName This property is required. string
Name of your Azure VNet.
VpcId This property is required. string
Unique identifier of the peer VPC.
accepterRegionName This property is required. String
Specifies the region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
atlasCidrBlock This property is required. String
awsAccountId This property is required. String
Account ID of the owner of the peer VPC.
azureDirectoryId This property is required. String
Unique identifier for an Azure AD directory.
azureSubscriptionId This property is required. String
Unique identifer of the Azure subscription in which the VNet resides.
connectionId This property is required. String
Unique identifier for the peering connection.
containerId This property is required. String
errorMessage This property is required. String
When "status" : "FAILED", Atlas provides a description of the error.
errorState This property is required. String
Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
errorStateName This property is required. String
Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
gcpProjectId This property is required. String
GCP project ID of the owner of the network peer.
networkName This property is required. String
Name of the network peer to which Atlas connects.
peeringId This property is required. String
Atlas assigned unique ID for the peering connection.
providerName This property is required. String
Cloud provider for this VPC peering connection. If omitted, Atlas sets this parameter to AWS. (Possible Values AWS, AZURE, GCP).
resourceGroupName This property is required. String
Name of your Azure resource group.
routeTableCidrBlock This property is required. String
Peer VPC CIDR block or subnet.
status This property is required. String
Status of the Atlas network peering connection: ADDING_PEER, AVAILABLE, FAILED, DELETING, WAITING_FOR_USER.
statusName This property is required. String
The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
vnetName This property is required. String
Name of your Azure VNet.
vpcId This property is required. String
Unique identifier of the peer VPC.
accepterRegionName This property is required. string
Specifies the region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
atlasCidrBlock This property is required. string
awsAccountId This property is required. string
Account ID of the owner of the peer VPC.
azureDirectoryId This property is required. string
Unique identifier for an Azure AD directory.
azureSubscriptionId This property is required. string
Unique identifer of the Azure subscription in which the VNet resides.
connectionId This property is required. string
Unique identifier for the peering connection.
containerId This property is required. string
errorMessage This property is required. string
When "status" : "FAILED", Atlas provides a description of the error.
errorState This property is required. string
Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
errorStateName This property is required. string
Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
gcpProjectId This property is required. string
GCP project ID of the owner of the network peer.
networkName This property is required. string
Name of the network peer to which Atlas connects.
peeringId This property is required. string
Atlas assigned unique ID for the peering connection.
providerName This property is required. string
Cloud provider for this VPC peering connection. If omitted, Atlas sets this parameter to AWS. (Possible Values AWS, AZURE, GCP).
resourceGroupName This property is required. string
Name of your Azure resource group.
routeTableCidrBlock This property is required. string
Peer VPC CIDR block or subnet.
status This property is required. string
Status of the Atlas network peering connection: ADDING_PEER, AVAILABLE, FAILED, DELETING, WAITING_FOR_USER.
statusName This property is required. string
The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
vnetName This property is required. string
Name of your Azure VNet.
vpcId This property is required. string
Unique identifier of the peer VPC.
accepter_region_name This property is required. str
Specifies the region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
atlas_cidr_block This property is required. str
aws_account_id This property is required. str
Account ID of the owner of the peer VPC.
azure_directory_id This property is required. str
Unique identifier for an Azure AD directory.
azure_subscription_id This property is required. str
Unique identifer of the Azure subscription in which the VNet resides.
connection_id This property is required. str
Unique identifier for the peering connection.
container_id This property is required. str
error_message This property is required. str
When "status" : "FAILED", Atlas provides a description of the error.
error_state This property is required. str
Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
error_state_name This property is required. str
Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
gcp_project_id This property is required. str
GCP project ID of the owner of the network peer.
network_name This property is required. str
Name of the network peer to which Atlas connects.
peering_id This property is required. str
Atlas assigned unique ID for the peering connection.
provider_name This property is required. str
Cloud provider for this VPC peering connection. If omitted, Atlas sets this parameter to AWS. (Possible Values AWS, AZURE, GCP).
resource_group_name This property is required. str
Name of your Azure resource group.
route_table_cidr_block This property is required. str
Peer VPC CIDR block or subnet.
status This property is required. str
Status of the Atlas network peering connection: ADDING_PEER, AVAILABLE, FAILED, DELETING, WAITING_FOR_USER.
status_name This property is required. str
The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
vnet_name This property is required. str
Name of your Azure VNet.
vpc_id This property is required. str
Unique identifier of the peer VPC.
accepterRegionName This property is required. String
Specifies the region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
atlasCidrBlock This property is required. String
awsAccountId This property is required. String
Account ID of the owner of the peer VPC.
azureDirectoryId This property is required. String
Unique identifier for an Azure AD directory.
azureSubscriptionId This property is required. String
Unique identifer of the Azure subscription in which the VNet resides.
connectionId This property is required. String
Unique identifier for the peering connection.
containerId This property is required. String
errorMessage This property is required. String
When "status" : "FAILED", Atlas provides a description of the error.
errorState This property is required. String
Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
errorStateName This property is required. String
Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
gcpProjectId This property is required. String
GCP project ID of the owner of the network peer.
networkName This property is required. String
Name of the network peer to which Atlas connects.
peeringId This property is required. String
Atlas assigned unique ID for the peering connection.
providerName This property is required. String
Cloud provider for this VPC peering connection. If omitted, Atlas sets this parameter to AWS. (Possible Values AWS, AZURE, GCP).
resourceGroupName This property is required. String
Name of your Azure resource group.
routeTableCidrBlock This property is required. String
Peer VPC CIDR block or subnet.
status This property is required. String
Status of the Atlas network peering connection: ADDING_PEER, AVAILABLE, FAILED, DELETING, WAITING_FOR_USER.
statusName This property is required. String
The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
vnetName This property is required. String
Name of your Azure VNet.
vpcId This property is required. String
Unique identifier of the peer VPC.

Package Details

Repository
MongoDB Atlas pulumi/pulumi-mongodbatlas
License
Apache-2.0
Notes
This Pulumi package is based on the mongodbatlas Terraform Provider.