1. Packages
  2. MongoDB Atlas
  3. API Docs
  4. NetworkPeering
MongoDB Atlas v3.14.2 published on Monday, Mar 18, 2024 by Pulumi

mongodbatlas.NetworkPeering

Explore with Pulumi AI

mongodbatlas logo
MongoDB Atlas v3.14.2 published on Monday, Mar 18, 2024 by Pulumi

    mongodbatlas.NetworkPeering provides a Network Peering Connection resource. The resource lets you create, edit and delete network peering connections. The resource requires your Project ID.

    Ensure you have first created a network container if it is required for your configuration. See the network_container resource documentation to determine if you need a network container first. Examples for creating both container and peering resource are shown below as well as examples for creating the peering connection only.

    GCP AND AZURE ONLY: Connect via Peering Only mode is deprecated, so no longer needed. See disable Peering Only mode for details

    AZURE ONLY: To create the peering request with an Azure VNET, you must grant Atlas the following permissions on the virtual network. Microsoft.Network/virtualNetworks/virtualNetworkPeerings/read Microsoft.Network/virtualNetworks/virtualNetworkPeerings/write Microsoft.Network/virtualNetworks/virtualNetworkPeerings/delete Microsoft.Network/virtualNetworks/peer/action For more information see https://docs.atlas.mongodb.com/security-vpc-peering/ and https://docs.atlas.mongodb.com/reference/api/vpc-create-peering-connection/

    Create a Whitelist: Ensure you whitelist the private IP ranges of the subnets in which your application is hosted in order to connect to your Atlas cluster. See the project_ip_whitelist resource.

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

    Example Usage

    Container & Peering Connection

    Example with AWS

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    // Container example provided but not always required, 
    // see network_container documentation for details. 
    const testNetworkContainer = new mongodbatlas.NetworkContainer("testNetworkContainer", {
        projectId: local.project_id,
        atlasCidrBlock: "10.8.0.0/21",
        providerName: "AWS",
        regionName: "US_EAST_1",
    });
    // Create the peering connection request
    const testNetworkPeering = new mongodbatlas.NetworkPeering("testNetworkPeering", {
        accepterRegionName: "us-east-1",
        projectId: local.project_id,
        containerId: "507f1f77bcf86cd799439011",
        providerName: "AWS",
        routeTableCidrBlock: "192.168.0.0/24",
        vpcId: "vpc-abc123abc123",
        awsAccountId: "abc123abc123",
    });
    // the following assumes an AWS provider is configured
    // Accept the peering connection request
    const peer = new aws.ec2.VpcPeeringConnectionAccepter("peer", {
        vpcPeeringConnectionId: testNetworkPeering.connectionId,
        autoAccept: true,
    });
    
    import pulumi
    import pulumi_aws as aws
    import pulumi_mongodbatlas as mongodbatlas
    
    # Container example provided but not always required, 
    # see network_container documentation for details. 
    test_network_container = mongodbatlas.NetworkContainer("testNetworkContainer",
        project_id=local["project_id"],
        atlas_cidr_block="10.8.0.0/21",
        provider_name="AWS",
        region_name="US_EAST_1")
    # Create the peering connection request
    test_network_peering = mongodbatlas.NetworkPeering("testNetworkPeering",
        accepter_region_name="us-east-1",
        project_id=local["project_id"],
        container_id="507f1f77bcf86cd799439011",
        provider_name="AWS",
        route_table_cidr_block="192.168.0.0/24",
        vpc_id="vpc-abc123abc123",
        aws_account_id="abc123abc123")
    # the following assumes an AWS provider is configured
    # Accept the peering connection request
    peer = aws.ec2.VpcPeeringConnectionAccepter("peer",
        vpc_peering_connection_id=test_network_peering.connection_id,
        auto_accept=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
    	"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 {
    		// Container example provided but not always required,
    		// see network_container documentation for details.
    		_, err := mongodbatlas.NewNetworkContainer(ctx, "testNetworkContainer", &mongodbatlas.NetworkContainerArgs{
    			ProjectId:      pulumi.Any(local.Project_id),
    			AtlasCidrBlock: pulumi.String("10.8.0.0/21"),
    			ProviderName:   pulumi.String("AWS"),
    			RegionName:     pulumi.String("US_EAST_1"),
    		})
    		if err != nil {
    			return err
    		}
    		// Create the peering connection request
    		testNetworkPeering, err := mongodbatlas.NewNetworkPeering(ctx, "testNetworkPeering", &mongodbatlas.NetworkPeeringArgs{
    			AccepterRegionName:  pulumi.String("us-east-1"),
    			ProjectId:           pulumi.Any(local.Project_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
    		}
    		// the following assumes an AWS provider is configured
    		// Accept the peering connection request
    		_, err = ec2.NewVpcPeeringConnectionAccepter(ctx, "peer", &ec2.VpcPeeringConnectionAccepterArgs{
    			VpcPeeringConnectionId: testNetworkPeering.ConnectionId,
    			AutoAccept:             pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        // Container example provided but not always required, 
        // see network_container documentation for details. 
        var testNetworkContainer = new Mongodbatlas.NetworkContainer("testNetworkContainer", new()
        {
            ProjectId = local.Project_id,
            AtlasCidrBlock = "10.8.0.0/21",
            ProviderName = "AWS",
            RegionName = "US_EAST_1",
        });
    
        // Create the peering connection request
        var testNetworkPeering = new Mongodbatlas.NetworkPeering("testNetworkPeering", new()
        {
            AccepterRegionName = "us-east-1",
            ProjectId = local.Project_id,
            ContainerId = "507f1f77bcf86cd799439011",
            ProviderName = "AWS",
            RouteTableCidrBlock = "192.168.0.0/24",
            VpcId = "vpc-abc123abc123",
            AwsAccountId = "abc123abc123",
        });
    
        // the following assumes an AWS provider is configured
        // Accept the peering connection request
        var peer = new Aws.Ec2.VpcPeeringConnectionAccepter("peer", new()
        {
            VpcPeeringConnectionId = testNetworkPeering.ConnectionId,
            AutoAccept = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mongodbatlas.NetworkContainer;
    import com.pulumi.mongodbatlas.NetworkContainerArgs;
    import com.pulumi.mongodbatlas.NetworkPeering;
    import com.pulumi.mongodbatlas.NetworkPeeringArgs;
    import com.pulumi.aws.ec2.VpcPeeringConnectionAccepter;
    import com.pulumi.aws.ec2.VpcPeeringConnectionAccepterArgs;
    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 testNetworkContainer = new NetworkContainer("testNetworkContainer", NetworkContainerArgs.builder()        
                .projectId(local.project_id())
                .atlasCidrBlock("10.8.0.0/21")
                .providerName("AWS")
                .regionName("US_EAST_1")
                .build());
    
            var testNetworkPeering = new NetworkPeering("testNetworkPeering", NetworkPeeringArgs.builder()        
                .accepterRegionName("us-east-1")
                .projectId(local.project_id())
                .containerId("507f1f77bcf86cd799439011")
                .providerName("AWS")
                .routeTableCidrBlock("192.168.0.0/24")
                .vpcId("vpc-abc123abc123")
                .awsAccountId("abc123abc123")
                .build());
    
            var peer = new VpcPeeringConnectionAccepter("peer", VpcPeeringConnectionAccepterArgs.builder()        
                .vpcPeeringConnectionId(testNetworkPeering.connectionId())
                .autoAccept(true)
                .build());
    
        }
    }
    
    resources:
      # Container example provided but not always required, 
      # see network_container documentation for details.
      testNetworkContainer:
        type: mongodbatlas:NetworkContainer
        properties:
          projectId: ${local.project_id}
          atlasCidrBlock: 10.8.0.0/21
          providerName: AWS
          regionName: US_EAST_1
      # Create the peering connection request
      testNetworkPeering:
        type: mongodbatlas:NetworkPeering
        properties:
          accepterRegionName: us-east-1
          projectId: ${local.project_id}
          containerId: 507f1f77bcf86cd799439011
          providerName: AWS
          routeTableCidrBlock: 192.168.0.0/24
          vpcId: vpc-abc123abc123
          awsAccountId: abc123abc123
      # the following assumes an AWS provider is configured
      # Accept the peering connection request
      peer:
        type: aws:ec2:VpcPeeringConnectionAccepter
        properties:
          vpcPeeringConnectionId: ${testNetworkPeering.connectionId}
          autoAccept: true
    

    Example with GCP

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    // Container example provided but not always required, 
    // see network_container documentation for details. 
    const testNetworkContainer = new mongodbatlas.NetworkContainer("testNetworkContainer", {
        projectId: local.project_id,
        atlasCidrBlock: "10.8.0.0/21",
        providerName: "GCP",
    });
    // Create the peering connection request
    const testNetworkPeering = new mongodbatlas.NetworkPeering("testNetworkPeering", {
        projectId: local.project_id,
        containerId: testNetworkContainer.containerId,
        providerName: "GCP",
        gcpProjectId: local.GCP_PROJECT_ID,
        networkName: "default",
    });
    const default = gcp.compute.getNetwork({
        name: "default",
    });
    // Create the GCP peer
    const peering = new gcp.compute.NetworkPeering("peering", {
        network: _default.then(_default => _default.selfLink),
        peerNetwork: pulumi.interpolate`https://www.googleapis.com/compute/v1/projects/${testNetworkPeering.atlasGcpProjectId}/global/networks/${testNetworkPeering.atlasVpcName}`,
    });
    // Create the cluster once the peering connection is completed
    const testCluster = new mongodbatlas.Cluster("testCluster", {
        projectId: local.project_id,
        numShards: 1,
        clusterType: "REPLICASET",
        replicationSpecs: [{
            numShards: 1,
            regionsConfigs: [{
                regionName: "US_EAST_4",
                electableNodes: 3,
                priority: 7,
                readOnlyNodes: 0,
            }],
        }],
        autoScalingDiskGbEnabled: true,
        mongoDbMajorVersion: "4.2",
        providerName: "GCP",
        providerInstanceSizeName: "M10",
    }, {
        dependsOn: ["google_compute_network_peering.peering"],
    });
    //  Private connection strings are not available w/ GCP until the reciprocal
    //  connection changes to available (i.e. when the status attribute changes
    //  to AVAILABLE on the 'mongodbatlas_network_peering' resource, which
    //  happens when the google_compute_network_peering and and
    //  mongodbatlas_network_peering make a reciprocal connection).  Hence
    //  since the cluster can be created before this connection completes
    //  you may need to run `terraform refresh` to obtain the private connection strings.
    
    import pulumi
    import pulumi_gcp as gcp
    import pulumi_mongodbatlas as mongodbatlas
    
    # Container example provided but not always required, 
    # see network_container documentation for details. 
    test_network_container = mongodbatlas.NetworkContainer("testNetworkContainer",
        project_id=local["project_id"],
        atlas_cidr_block="10.8.0.0/21",
        provider_name="GCP")
    # Create the peering connection request
    test_network_peering = mongodbatlas.NetworkPeering("testNetworkPeering",
        project_id=local["project_id"],
        container_id=test_network_container.container_id,
        provider_name="GCP",
        gcp_project_id=local["GCP_PROJECT_ID"],
        network_name="default")
    default = gcp.compute.get_network(name="default")
    # Create the GCP peer
    peering = gcp.compute.NetworkPeering("peering",
        network=default.self_link,
        peer_network=pulumi.Output.all(test_network_peering.atlas_gcp_project_id, test_network_peering.atlas_vpc_name).apply(lambda atlas_gcp_project_id, atlas_vpc_name: f"https://www.googleapis.com/compute/v1/projects/{atlas_gcp_project_id}/global/networks/{atlas_vpc_name}"))
    # Create the cluster once the peering connection is completed
    test_cluster = mongodbatlas.Cluster("testCluster",
        project_id=local["project_id"],
        num_shards=1,
        cluster_type="REPLICASET",
        replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(
            num_shards=1,
            regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(
                region_name="US_EAST_4",
                electable_nodes=3,
                priority=7,
                read_only_nodes=0,
            )],
        )],
        auto_scaling_disk_gb_enabled=True,
        mongo_db_major_version="4.2",
        provider_name="GCP",
        provider_instance_size_name="M10",
        opts=pulumi.ResourceOptions(depends_on=["google_compute_network_peering.peering"]))
    #  Private connection strings are not available w/ GCP until the reciprocal
    #  connection changes to available (i.e. when the status attribute changes
    #  to AVAILABLE on the 'mongodbatlas_network_peering' resource, which
    #  happens when the google_compute_network_peering and and
    #  mongodbatlas_network_peering make a reciprocal connection).  Hence
    #  since the cluster can be created before this connection completes
    #  you may need to run `terraform refresh` to obtain the private connection strings.
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-gcp/sdk/v5/go/gcp/compute"
    	"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 {
    		// Container example provided but not always required,
    		// see network_container documentation for details.
    		testNetworkContainer, err := mongodbatlas.NewNetworkContainer(ctx, "testNetworkContainer", &mongodbatlas.NetworkContainerArgs{
    			ProjectId:      pulumi.Any(local.Project_id),
    			AtlasCidrBlock: pulumi.String("10.8.0.0/21"),
    			ProviderName:   pulumi.String("GCP"),
    		})
    		if err != nil {
    			return err
    		}
    		// Create the peering connection request
    		testNetworkPeering, err := mongodbatlas.NewNetworkPeering(ctx, "testNetworkPeering", &mongodbatlas.NetworkPeeringArgs{
    			ProjectId:    pulumi.Any(local.Project_id),
    			ContainerId:  testNetworkContainer.ContainerId,
    			ProviderName: pulumi.String("GCP"),
    			GcpProjectId: pulumi.Any(local.GCP_PROJECT_ID),
    			NetworkName:  pulumi.String("default"),
    		})
    		if err != nil {
    			return err
    		}
    		_default, err := compute.LookupNetwork(ctx, &compute.LookupNetworkArgs{
    			Name: "default",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Create the GCP peer
    		_, err = compute.NewNetworkPeering(ctx, "peering", &compute.NetworkPeeringArgs{
    			Network: *pulumi.String(_default.SelfLink),
    			PeerNetwork: pulumi.All(testNetworkPeering.AtlasGcpProjectId, testNetworkPeering.AtlasVpcName).ApplyT(func(_args []interface{}) (string, error) {
    				atlasGcpProjectId := _args[0].(string)
    				atlasVpcName := _args[1].(string)
    				return fmt.Sprintf("https://www.googleapis.com/compute/v1/projects/%v/global/networks/%v", atlasGcpProjectId, atlasVpcName), nil
    			}).(pulumi.StringOutput),
    		})
    		if err != nil {
    			return err
    		}
    		// Create the cluster once the peering connection is completed
    		_, err = mongodbatlas.NewCluster(ctx, "testCluster", &mongodbatlas.ClusterArgs{
    			ProjectId:   pulumi.Any(local.Project_id),
    			NumShards:   pulumi.Int(1),
    			ClusterType: pulumi.String("REPLICASET"),
    			ReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{
    				&mongodbatlas.ClusterReplicationSpecArgs{
    					NumShards: pulumi.Int(1),
    					RegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{
    						&mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{
    							RegionName:     pulumi.String("US_EAST_4"),
    							ElectableNodes: pulumi.Int(3),
    							Priority:       pulumi.Int(7),
    							ReadOnlyNodes:  pulumi.Int(0),
    						},
    					},
    				},
    			},
    			AutoScalingDiskGbEnabled: pulumi.Bool(true),
    			MongoDbMajorVersion:      pulumi.String("4.2"),
    			ProviderName:             pulumi.String("GCP"),
    			ProviderInstanceSizeName: pulumi.String("M10"),
    		}, pulumi.DependsOn([]pulumi.Resource{
    			pulumi.Resource("google_compute_network_peering.peering"),
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        // Container example provided but not always required, 
        // see network_container documentation for details. 
        var testNetworkContainer = new Mongodbatlas.NetworkContainer("testNetworkContainer", new()
        {
            ProjectId = local.Project_id,
            AtlasCidrBlock = "10.8.0.0/21",
            ProviderName = "GCP",
        });
    
        // Create the peering connection request
        var testNetworkPeering = new Mongodbatlas.NetworkPeering("testNetworkPeering", new()
        {
            ProjectId = local.Project_id,
            ContainerId = testNetworkContainer.ContainerId,
            ProviderName = "GCP",
            GcpProjectId = local.GCP_PROJECT_ID,
            NetworkName = "default",
        });
    
        var @default = Gcp.Compute.GetNetwork.Invoke(new()
        {
            Name = "default",
        });
    
        // Create the GCP peer
        var peering = new Gcp.Compute.NetworkPeering("peering", new()
        {
            Network = @default.Apply(@default => @default.Apply(getNetworkResult => getNetworkResult.SelfLink)),
            PeerNetwork = Output.Tuple(testNetworkPeering.AtlasGcpProjectId, testNetworkPeering.AtlasVpcName).Apply(values =>
            {
                var atlasGcpProjectId = values.Item1;
                var atlasVpcName = values.Item2;
                return $"https://www.googleapis.com/compute/v1/projects/{atlasGcpProjectId}/global/networks/{atlasVpcName}";
            }),
        });
    
        // Create the cluster once the peering connection is completed
        var testCluster = new Mongodbatlas.Cluster("testCluster", new()
        {
            ProjectId = local.Project_id,
            NumShards = 1,
            ClusterType = "REPLICASET",
            ReplicationSpecs = new[]
            {
                new Mongodbatlas.Inputs.ClusterReplicationSpecArgs
                {
                    NumShards = 1,
                    RegionsConfigs = new[]
                    {
                        new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs
                        {
                            RegionName = "US_EAST_4",
                            ElectableNodes = 3,
                            Priority = 7,
                            ReadOnlyNodes = 0,
                        },
                    },
                },
            },
            AutoScalingDiskGbEnabled = true,
            MongoDbMajorVersion = "4.2",
            ProviderName = "GCP",
            ProviderInstanceSizeName = "M10",
        }, new CustomResourceOptions
        {
            DependsOn = new[]
            {
                "google_compute_network_peering.peering",
            },
        });
    
        //  Private connection strings are not available w/ GCP until the reciprocal
        //  connection changes to available (i.e. when the status attribute changes
        //  to AVAILABLE on the 'mongodbatlas_network_peering' resource, which
        //  happens when the google_compute_network_peering and and
        //  mongodbatlas_network_peering make a reciprocal connection).  Hence
        //  since the cluster can be created before this connection completes
        //  you may need to run `terraform refresh` to obtain the private connection strings.
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mongodbatlas.NetworkContainer;
    import com.pulumi.mongodbatlas.NetworkContainerArgs;
    import com.pulumi.mongodbatlas.NetworkPeering;
    import com.pulumi.mongodbatlas.NetworkPeeringArgs;
    import com.pulumi.gcp.compute.ComputeFunctions;
    import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
    import com.pulumi.gcp.compute.NetworkPeering;
    import com.pulumi.gcp.compute.NetworkPeeringArgs;
    import com.pulumi.mongodbatlas.Cluster;
    import com.pulumi.mongodbatlas.ClusterArgs;
    import com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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 testNetworkContainer = new NetworkContainer("testNetworkContainer", NetworkContainerArgs.builder()        
                .projectId(local.project_id())
                .atlasCidrBlock("10.8.0.0/21")
                .providerName("GCP")
                .build());
    
            var testNetworkPeering = new NetworkPeering("testNetworkPeering", NetworkPeeringArgs.builder()        
                .projectId(local.project_id())
                .containerId(testNetworkContainer.containerId())
                .providerName("GCP")
                .gcpProjectId(local.GCP_PROJECT_ID())
                .networkName("default")
                .build());
    
            final var default = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
                .name("default")
                .build());
    
            var peering = new NetworkPeering("peering", NetworkPeeringArgs.builder()        
                .network(default_.selfLink())
                .peerNetwork(Output.tuple(testNetworkPeering.atlasGcpProjectId(), testNetworkPeering.atlasVpcName()).applyValue(values -> {
                    var atlasGcpProjectId = values.t1;
                    var atlasVpcName = values.t2;
                    return String.format("https://www.googleapis.com/compute/v1/projects/%s/global/networks/%s", atlasGcpProjectId,atlasVpcName);
                }))
                .build());
    
            var testCluster = new Cluster("testCluster", ClusterArgs.builder()        
                .projectId(local.project_id())
                .numShards(1)
                .clusterType("REPLICASET")
                .replicationSpecs(ClusterReplicationSpecArgs.builder()
                    .numShards(1)
                    .regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()
                        .regionName("US_EAST_4")
                        .electableNodes(3)
                        .priority(7)
                        .readOnlyNodes(0)
                        .build())
                    .build())
                .autoScalingDiskGbEnabled(true)
                .mongoDbMajorVersion("4.2")
                .providerName("GCP")
                .providerInstanceSizeName("M10")
                .build(), CustomResourceOptions.builder()
                    .dependsOn("google_compute_network_peering.peering")
                    .build());
    
        }
    }
    
    resources:
      # Container example provided but not always required, 
      # see network_container documentation for details.
      testNetworkContainer:
        type: mongodbatlas:NetworkContainer
        properties:
          projectId: ${local.project_id}
          atlasCidrBlock: 10.8.0.0/21
          providerName: GCP
      # Create the peering connection request
      testNetworkPeering:
        type: mongodbatlas:NetworkPeering
        properties:
          projectId: ${local.project_id}
          containerId: ${testNetworkContainer.containerId}
          providerName: GCP
          gcpProjectId: ${local.GCP_PROJECT_ID}
          networkName: default
      # Create the GCP peer
      peering:
        type: gcp:compute:NetworkPeering
        properties:
          network: ${default.selfLink}
          peerNetwork: https://www.googleapis.com/compute/v1/projects/${testNetworkPeering.atlasGcpProjectId}/global/networks/${testNetworkPeering.atlasVpcName}
      # Create the cluster once the peering connection is completed
      testCluster: #  Private connection strings are not available w/ GCP until the reciprocal
      #  connection changes to available (i.e. when the status attribute changes
      #  to AVAILABLE on the 'mongodbatlas_network_peering' resource, which
      #  happens when the google_compute_network_peering and and
      #  mongodbatlas_network_peering make a reciprocal connection).  Hence
      #  since the cluster can be created before this connection completes
      #  you may need to run `terraform refresh` to obtain the private connection strings.
        type: mongodbatlas:Cluster
        properties:
          projectId: ${local.project_id}
          numShards: 1
          clusterType: REPLICASET
          replicationSpecs:
            - numShards: 1
              regionsConfigs:
                - regionName: US_EAST_4
                  electableNodes: 3
                  priority: 7
                  readOnlyNodes: 0
          autoScalingDiskGbEnabled: true
          mongoDbMajorVersion: '4.2'
          # Provider Settings "block"
          providerName: GCP
          providerInstanceSizeName: M10
        options:
          dependson:
            - google_compute_network_peering.peering
    variables:
      default:
        fn::invoke:
          Function: gcp:compute:getNetwork
          Arguments:
            name: default
    

    Example with Azure

    import * as pulumi from "@pulumi/pulumi";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    // Ensure you have created the required Azure service principal first, see
    // see https://docs.atlas.mongodb.com/security-vpc-peering/
    // Container example provided but not always required, 
    // see network_container documentation for details. 
    const testNetworkContainer = new mongodbatlas.NetworkContainer("testNetworkContainer", {
        projectId: local.project_id,
        atlasCidrBlock: local.ATLAS_CIDR_BLOCK,
        providerName: "AZURE",
        region: "US_EAST_2",
    });
    // Create the peering connection request
    const testNetworkPeering = new mongodbatlas.NetworkPeering("testNetworkPeering", {
        projectId: local.project_id,
        containerId: testNetworkContainer.containerId,
        providerName: "AZURE",
        azureDirectoryId: local.AZURE_DIRECTORY_ID,
        azureSubscriptionId: local.AZURE_SUBSCRIPTION_ID,
        resourceGroupName: local.AZURE_RESOURCES_GROUP_NAME,
        vnetName: local.AZURE_VNET_NAME,
    });
    // Create the cluster once the peering connection is completed
    const testCluster = new mongodbatlas.Cluster("testCluster", {
        projectId: local.project_id,
        clusterType: "REPLICASET",
        replicationSpecs: [{
            numShards: 1,
            regionsConfigs: [{
                regionName: "US_EAST_2",
                electableNodes: 3,
                priority: 7,
                readOnlyNodes: 0,
            }],
        }],
        autoScalingDiskGbEnabled: true,
        mongoDbMajorVersion: "4.2",
        providerName: "AZURE",
        providerDiskTypeName: "P4",
        providerInstanceSizeName: "M10",
    }, {
        dependsOn: ["mongodbatlas_network_peering.test"],
    });
    
    import pulumi
    import pulumi_mongodbatlas as mongodbatlas
    
    # Ensure you have created the required Azure service principal first, see
    # see https://docs.atlas.mongodb.com/security-vpc-peering/
    # Container example provided but not always required, 
    # see network_container documentation for details. 
    test_network_container = mongodbatlas.NetworkContainer("testNetworkContainer",
        project_id=local["project_id"],
        atlas_cidr_block=local["ATLAS_CIDR_BLOCK"],
        provider_name="AZURE",
        region="US_EAST_2")
    # Create the peering connection request
    test_network_peering = mongodbatlas.NetworkPeering("testNetworkPeering",
        project_id=local["project_id"],
        container_id=test_network_container.container_id,
        provider_name="AZURE",
        azure_directory_id=local["AZURE_DIRECTORY_ID"],
        azure_subscription_id=local["AZURE_SUBSCRIPTION_ID"],
        resource_group_name=local["AZURE_RESOURCES_GROUP_NAME"],
        vnet_name=local["AZURE_VNET_NAME"])
    # Create the cluster once the peering connection is completed
    test_cluster = mongodbatlas.Cluster("testCluster",
        project_id=local["project_id"],
        cluster_type="REPLICASET",
        replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(
            num_shards=1,
            regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(
                region_name="US_EAST_2",
                electable_nodes=3,
                priority=7,
                read_only_nodes=0,
            )],
        )],
        auto_scaling_disk_gb_enabled=True,
        mongo_db_major_version="4.2",
        provider_name="AZURE",
        provider_disk_type_name="P4",
        provider_instance_size_name="M10",
        opts=pulumi.ResourceOptions(depends_on=["mongodbatlas_network_peering.test"]))
    
    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 {
    		// Ensure you have created the required Azure service principal first, see
    		// see https://docs.atlas.mongodb.com/security-vpc-peering/
    		// Container example provided but not always required,
    		// see network_container documentation for details.
    		testNetworkContainer, err := mongodbatlas.NewNetworkContainer(ctx, "testNetworkContainer", &mongodbatlas.NetworkContainerArgs{
    			ProjectId:      pulumi.Any(local.Project_id),
    			AtlasCidrBlock: pulumi.Any(local.ATLAS_CIDR_BLOCK),
    			ProviderName:   pulumi.String("AZURE"),
    			Region:         pulumi.String("US_EAST_2"),
    		})
    		if err != nil {
    			return err
    		}
    		// Create the peering connection request
    		_, err = mongodbatlas.NewNetworkPeering(ctx, "testNetworkPeering", &mongodbatlas.NetworkPeeringArgs{
    			ProjectId:           pulumi.Any(local.Project_id),
    			ContainerId:         testNetworkContainer.ContainerId,
    			ProviderName:        pulumi.String("AZURE"),
    			AzureDirectoryId:    pulumi.Any(local.AZURE_DIRECTORY_ID),
    			AzureSubscriptionId: pulumi.Any(local.AZURE_SUBSCRIPTION_ID),
    			ResourceGroupName:   pulumi.Any(local.AZURE_RESOURCES_GROUP_NAME),
    			VnetName:            pulumi.Any(local.AZURE_VNET_NAME),
    		})
    		if err != nil {
    			return err
    		}
    		// Create the cluster once the peering connection is completed
    		_, err = mongodbatlas.NewCluster(ctx, "testCluster", &mongodbatlas.ClusterArgs{
    			ProjectId:   pulumi.Any(local.Project_id),
    			ClusterType: pulumi.String("REPLICASET"),
    			ReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{
    				&mongodbatlas.ClusterReplicationSpecArgs{
    					NumShards: pulumi.Int(1),
    					RegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{
    						&mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{
    							RegionName:     pulumi.String("US_EAST_2"),
    							ElectableNodes: pulumi.Int(3),
    							Priority:       pulumi.Int(7),
    							ReadOnlyNodes:  pulumi.Int(0),
    						},
    					},
    				},
    			},
    			AutoScalingDiskGbEnabled: pulumi.Bool(true),
    			MongoDbMajorVersion:      pulumi.String("4.2"),
    			ProviderName:             pulumi.String("AZURE"),
    			ProviderDiskTypeName:     pulumi.String("P4"),
    			ProviderInstanceSizeName: pulumi.String("M10"),
    		}, pulumi.DependsOn([]pulumi.Resource{
    			pulumi.Resource("mongodbatlas_network_peering.test"),
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        // Ensure you have created the required Azure service principal first, see
        // see https://docs.atlas.mongodb.com/security-vpc-peering/
        // Container example provided but not always required, 
        // see network_container documentation for details. 
        var testNetworkContainer = new Mongodbatlas.NetworkContainer("testNetworkContainer", new()
        {
            ProjectId = local.Project_id,
            AtlasCidrBlock = local.ATLAS_CIDR_BLOCK,
            ProviderName = "AZURE",
            Region = "US_EAST_2",
        });
    
        // Create the peering connection request
        var testNetworkPeering = new Mongodbatlas.NetworkPeering("testNetworkPeering", new()
        {
            ProjectId = local.Project_id,
            ContainerId = testNetworkContainer.ContainerId,
            ProviderName = "AZURE",
            AzureDirectoryId = local.AZURE_DIRECTORY_ID,
            AzureSubscriptionId = local.AZURE_SUBSCRIPTION_ID,
            ResourceGroupName = local.AZURE_RESOURCES_GROUP_NAME,
            VnetName = local.AZURE_VNET_NAME,
        });
    
        // Create the cluster once the peering connection is completed
        var testCluster = new Mongodbatlas.Cluster("testCluster", new()
        {
            ProjectId = local.Project_id,
            ClusterType = "REPLICASET",
            ReplicationSpecs = new[]
            {
                new Mongodbatlas.Inputs.ClusterReplicationSpecArgs
                {
                    NumShards = 1,
                    RegionsConfigs = new[]
                    {
                        new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs
                        {
                            RegionName = "US_EAST_2",
                            ElectableNodes = 3,
                            Priority = 7,
                            ReadOnlyNodes = 0,
                        },
                    },
                },
            },
            AutoScalingDiskGbEnabled = true,
            MongoDbMajorVersion = "4.2",
            ProviderName = "AZURE",
            ProviderDiskTypeName = "P4",
            ProviderInstanceSizeName = "M10",
        }, new CustomResourceOptions
        {
            DependsOn = new[]
            {
                "mongodbatlas_network_peering.test",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mongodbatlas.NetworkContainer;
    import com.pulumi.mongodbatlas.NetworkContainerArgs;
    import com.pulumi.mongodbatlas.NetworkPeering;
    import com.pulumi.mongodbatlas.NetworkPeeringArgs;
    import com.pulumi.mongodbatlas.Cluster;
    import com.pulumi.mongodbatlas.ClusterArgs;
    import com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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 testNetworkContainer = new NetworkContainer("testNetworkContainer", NetworkContainerArgs.builder()        
                .projectId(local.project_id())
                .atlasCidrBlock(local.ATLAS_CIDR_BLOCK())
                .providerName("AZURE")
                .region("US_EAST_2")
                .build());
    
            var testNetworkPeering = new NetworkPeering("testNetworkPeering", NetworkPeeringArgs.builder()        
                .projectId(local.project_id())
                .containerId(testNetworkContainer.containerId())
                .providerName("AZURE")
                .azureDirectoryId(local.AZURE_DIRECTORY_ID())
                .azureSubscriptionId(local.AZURE_SUBSCRIPTION_ID())
                .resourceGroupName(local.AZURE_RESOURCES_GROUP_NAME())
                .vnetName(local.AZURE_VNET_NAME())
                .build());
    
            var testCluster = new Cluster("testCluster", ClusterArgs.builder()        
                .projectId(local.project_id())
                .clusterType("REPLICASET")
                .replicationSpecs(ClusterReplicationSpecArgs.builder()
                    .numShards(1)
                    .regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()
                        .regionName("US_EAST_2")
                        .electableNodes(3)
                        .priority(7)
                        .readOnlyNodes(0)
                        .build())
                    .build())
                .autoScalingDiskGbEnabled(true)
                .mongoDbMajorVersion("4.2")
                .providerName("AZURE")
                .providerDiskTypeName("P4")
                .providerInstanceSizeName("M10")
                .build(), CustomResourceOptions.builder()
                    .dependsOn("mongodbatlas_network_peering.test")
                    .build());
    
        }
    }
    
    resources:
      # Ensure you have created the required Azure service principal first, see
      # see https://docs.atlas.mongodb.com/security-vpc-peering/
    
      # Container example provided but not always required, 
      # see network_container documentation for details.
      testNetworkContainer:
        type: mongodbatlas:NetworkContainer
        properties:
          projectId: ${local.project_id}
          atlasCidrBlock: ${local.ATLAS_CIDR_BLOCK}
          providerName: AZURE
          region: US_EAST_2
      # Create the peering connection request
      testNetworkPeering:
        type: mongodbatlas:NetworkPeering
        properties:
          projectId: ${local.project_id}
          containerId: ${testNetworkContainer.containerId}
          providerName: AZURE
          azureDirectoryId: ${local.AZURE_DIRECTORY_ID}
          azureSubscriptionId: ${local.AZURE_SUBSCRIPTION_ID}
          resourceGroupName: ${local.AZURE_RESOURCES_GROUP_NAME}
          vnetName: ${local.AZURE_VNET_NAME}
      # Create the cluster once the peering connection is completed
      testCluster:
        type: mongodbatlas:Cluster
        properties:
          projectId: ${local.project_id}
          clusterType: REPLICASET
          replicationSpecs:
            - numShards: 1
              regionsConfigs:
                - regionName: US_EAST_2
                  electableNodes: 3
                  priority: 7
                  readOnlyNodes: 0
          autoScalingDiskGbEnabled: true
          mongoDbMajorVersion: '4.2'
          # Provider Settings "block"
          providerName: AZURE
          providerDiskTypeName: P4
          providerInstanceSizeName: M10
        options:
          dependson:
            - mongodbatlas_network_peering.test
    

    Peering Connection Only, Container Exists

    You can create a peering connection if an appropriate container for your cloud provider already exists in your project (see the network_container resource for more information). A container may already exist if you have already created a cluster in your project, if so you may obtain the container_id from the cluster resource as shown in the examples below.

    Example with AWS

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    // Create an Atlas cluster, this creates a container if one
    // does not yet exist for this AWS region
    const test = new mongodbatlas.Cluster("test", {
        projectId: local.project_id,
        clusterType: "REPLICASET",
        replicationSpecs: [{
            numShards: 1,
            regionsConfigs: [{
                regionName: "US_EAST_2",
                electableNodes: 3,
                priority: 7,
                readOnlyNodes: 0,
            }],
        }],
        autoScalingDiskGbEnabled: false,
        mongoDbMajorVersion: "4.2",
        providerName: "AWS",
        providerInstanceSizeName: "M10",
    });
    // the following assumes an AWS provider is configured
    const _default = new aws.ec2.DefaultVpc("default", {tags: {
        Name: "Default VPC",
    }});
    // Create the peering connection request
    const mongoPeer = new mongodbatlas.NetworkPeering("mongoPeer", {
        accepterRegionName: "us-east-2",
        projectId: local.project_id,
        containerId: test.containerId,
        providerName: "AWS",
        routeTableCidrBlock: "172.31.0.0/16",
        vpcId: _default.id,
        awsAccountId: local.AWS_ACCOUNT_ID,
    });
    // Accept the connection 
    const awsPeer = new aws.ec2.VpcPeeringConnectionAccepter("awsPeer", {
        vpcPeeringConnectionId: mongoPeer.connectionId,
        autoAccept: true,
        tags: {
            Side: "Accepter",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    import pulumi_mongodbatlas as mongodbatlas
    
    # Create an Atlas cluster, this creates a container if one
    # does not yet exist for this AWS region
    test = mongodbatlas.Cluster("test",
        project_id=local["project_id"],
        cluster_type="REPLICASET",
        replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(
            num_shards=1,
            regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(
                region_name="US_EAST_2",
                electable_nodes=3,
                priority=7,
                read_only_nodes=0,
            )],
        )],
        auto_scaling_disk_gb_enabled=False,
        mongo_db_major_version="4.2",
        provider_name="AWS",
        provider_instance_size_name="M10")
    # the following assumes an AWS provider is configured
    default = aws.ec2.DefaultVpc("default", tags={
        "Name": "Default VPC",
    })
    # Create the peering connection request
    mongo_peer = mongodbatlas.NetworkPeering("mongoPeer",
        accepter_region_name="us-east-2",
        project_id=local["project_id"],
        container_id=test.container_id,
        provider_name="AWS",
        route_table_cidr_block="172.31.0.0/16",
        vpc_id=default.id,
        aws_account_id=local["AWS_ACCOUNT_ID"])
    # Accept the connection 
    aws_peer = aws.ec2.VpcPeeringConnectionAccepter("awsPeer",
        vpc_peering_connection_id=mongo_peer.connection_id,
        auto_accept=True,
        tags={
            "Side": "Accepter",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
    	"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 {
    		// Create an Atlas cluster, this creates a container if one
    		// does not yet exist for this AWS region
    		test, err := mongodbatlas.NewCluster(ctx, "test", &mongodbatlas.ClusterArgs{
    			ProjectId:   pulumi.Any(local.Project_id),
    			ClusterType: pulumi.String("REPLICASET"),
    			ReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{
    				&mongodbatlas.ClusterReplicationSpecArgs{
    					NumShards: pulumi.Int(1),
    					RegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{
    						&mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{
    							RegionName:     pulumi.String("US_EAST_2"),
    							ElectableNodes: pulumi.Int(3),
    							Priority:       pulumi.Int(7),
    							ReadOnlyNodes:  pulumi.Int(0),
    						},
    					},
    				},
    			},
    			AutoScalingDiskGbEnabled: pulumi.Bool(false),
    			MongoDbMajorVersion:      pulumi.String("4.2"),
    			ProviderName:             pulumi.String("AWS"),
    			ProviderInstanceSizeName: pulumi.String("M10"),
    		})
    		if err != nil {
    			return err
    		}
    		// the following assumes an AWS provider is configured
    		_, err = ec2.NewDefaultVpc(ctx, "default", &ec2.DefaultVpcArgs{
    			Tags: pulumi.StringMap{
    				"Name": pulumi.String("Default VPC"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Create the peering connection request
    		mongoPeer, err := mongodbatlas.NewNetworkPeering(ctx, "mongoPeer", &mongodbatlas.NetworkPeeringArgs{
    			AccepterRegionName:  pulumi.String("us-east-2"),
    			ProjectId:           pulumi.Any(local.Project_id),
    			ContainerId:         test.ContainerId,
    			ProviderName:        pulumi.String("AWS"),
    			RouteTableCidrBlock: pulumi.String("172.31.0.0/16"),
    			VpcId:               _default.ID(),
    			AwsAccountId:        pulumi.Any(local.AWS_ACCOUNT_ID),
    		})
    		if err != nil {
    			return err
    		}
    		// Accept the connection
    		_, err = ec2.NewVpcPeeringConnectionAccepter(ctx, "awsPeer", &ec2.VpcPeeringConnectionAccepterArgs{
    			VpcPeeringConnectionId: mongoPeer.ConnectionId,
    			AutoAccept:             pulumi.Bool(true),
    			Tags: pulumi.StringMap{
    				"Side": pulumi.String("Accepter"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        // Create an Atlas cluster, this creates a container if one
        // does not yet exist for this AWS region
        var test = new Mongodbatlas.Cluster("test", new()
        {
            ProjectId = local.Project_id,
            ClusterType = "REPLICASET",
            ReplicationSpecs = new[]
            {
                new Mongodbatlas.Inputs.ClusterReplicationSpecArgs
                {
                    NumShards = 1,
                    RegionsConfigs = new[]
                    {
                        new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs
                        {
                            RegionName = "US_EAST_2",
                            ElectableNodes = 3,
                            Priority = 7,
                            ReadOnlyNodes = 0,
                        },
                    },
                },
            },
            AutoScalingDiskGbEnabled = false,
            MongoDbMajorVersion = "4.2",
            ProviderName = "AWS",
            ProviderInstanceSizeName = "M10",
        });
    
        // the following assumes an AWS provider is configured
        var @default = new Aws.Ec2.DefaultVpc("default", new()
        {
            Tags = 
            {
                { "Name", "Default VPC" },
            },
        });
    
        // Create the peering connection request
        var mongoPeer = new Mongodbatlas.NetworkPeering("mongoPeer", new()
        {
            AccepterRegionName = "us-east-2",
            ProjectId = local.Project_id,
            ContainerId = test.ContainerId,
            ProviderName = "AWS",
            RouteTableCidrBlock = "172.31.0.0/16",
            VpcId = @default.Id,
            AwsAccountId = local.AWS_ACCOUNT_ID,
        });
    
        // Accept the connection 
        var awsPeer = new Aws.Ec2.VpcPeeringConnectionAccepter("awsPeer", new()
        {
            VpcPeeringConnectionId = mongoPeer.ConnectionId,
            AutoAccept = true,
            Tags = 
            {
                { "Side", "Accepter" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mongodbatlas.Cluster;
    import com.pulumi.mongodbatlas.ClusterArgs;
    import com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;
    import com.pulumi.aws.ec2.DefaultVpc;
    import com.pulumi.aws.ec2.DefaultVpcArgs;
    import com.pulumi.mongodbatlas.NetworkPeering;
    import com.pulumi.mongodbatlas.NetworkPeeringArgs;
    import com.pulumi.aws.ec2.VpcPeeringConnectionAccepter;
    import com.pulumi.aws.ec2.VpcPeeringConnectionAccepterArgs;
    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 test = new Cluster("test", ClusterArgs.builder()        
                .projectId(local.project_id())
                .clusterType("REPLICASET")
                .replicationSpecs(ClusterReplicationSpecArgs.builder()
                    .numShards(1)
                    .regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()
                        .regionName("US_EAST_2")
                        .electableNodes(3)
                        .priority(7)
                        .readOnlyNodes(0)
                        .build())
                    .build())
                .autoScalingDiskGbEnabled(false)
                .mongoDbMajorVersion("4.2")
                .providerName("AWS")
                .providerInstanceSizeName("M10")
                .build());
    
            var default_ = new DefaultVpc("default", DefaultVpcArgs.builder()        
                .tags(Map.of("Name", "Default VPC"))
                .build());
    
            var mongoPeer = new NetworkPeering("mongoPeer", NetworkPeeringArgs.builder()        
                .accepterRegionName("us-east-2")
                .projectId(local.project_id())
                .containerId(test.containerId())
                .providerName("AWS")
                .routeTableCidrBlock("172.31.0.0/16")
                .vpcId(default_.id())
                .awsAccountId(local.AWS_ACCOUNT_ID())
                .build());
    
            var awsPeer = new VpcPeeringConnectionAccepter("awsPeer", VpcPeeringConnectionAccepterArgs.builder()        
                .vpcPeeringConnectionId(mongoPeer.connectionId())
                .autoAccept(true)
                .tags(Map.of("Side", "Accepter"))
                .build());
    
        }
    }
    
    resources:
      # Create an Atlas cluster, this creates a container if one
      # does not yet exist for this AWS region
      test:
        type: mongodbatlas:Cluster
        properties:
          projectId: ${local.project_id}
          clusterType: REPLICASET
          replicationSpecs:
            - numShards: 1
              regionsConfigs:
                - regionName: US_EAST_2
                  electableNodes: 3
                  priority: 7
                  readOnlyNodes: 0
          autoScalingDiskGbEnabled: false
          mongoDbMajorVersion: '4.2'
          # Provider Settings "block"
          providerName: AWS
          providerInstanceSizeName: M10
      # the following assumes an AWS provider is configured
      default:
        type: aws:ec2:DefaultVpc
        properties:
          tags:
            Name: Default VPC
      # Create the peering connection request
      mongoPeer:
        type: mongodbatlas:NetworkPeering
        properties:
          accepterRegionName: us-east-2
          projectId: ${local.project_id}
          containerId: ${test.containerId}
          providerName: AWS
          routeTableCidrBlock: 172.31.0.0/16
          vpcId: ${default.id}
          awsAccountId: ${local.AWS_ACCOUNT_ID}
      # Accept the connection
      awsPeer:
        type: aws:ec2:VpcPeeringConnectionAccepter
        properties:
          vpcPeeringConnectionId: ${mongoPeer.connectionId}
          autoAccept: true
          tags:
            Side: Accepter
    

    Example with GCP

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    // Create an Atlas cluster, this creates a container if one
    // does not yet exist for this GCP 
    const testCluster = new mongodbatlas.Cluster("testCluster", {
        projectId: local.project_id,
        clusterType: "REPLICASET",
        replicationSpecs: [{
            numShards: 1,
            regionsConfigs: [{
                regionName: "US_EAST_2",
                electableNodes: 3,
                priority: 7,
                readOnlyNodes: 0,
            }],
        }],
        autoScalingDiskGbEnabled: true,
        mongoDbMajorVersion: "4.2",
        providerName: "GCP",
        providerInstanceSizeName: "M10",
    });
    // Create the peering connection request
    const testNetworkPeering = new mongodbatlas.NetworkPeering("testNetworkPeering", {
        projectId: local.project_id,
        atlasCidrBlock: "192.168.0.0/18",
        containerId: testCluster.containerId,
        providerName: "GCP",
        gcpProjectId: local.GCP_PROJECT_ID,
        networkName: "default",
    });
    const default = gcp.compute.getNetwork({
        name: "default",
    });
    // Create the GCP peer
    const peering = new gcp.compute.NetworkPeering("peering", {
        network: _default.then(_default => _default.selfLink),
        peerNetwork: pulumi.interpolate`https://www.googleapis.com/compute/v1/projects/${testNetworkPeering.atlasGcpProjectId}/global/networks/${testNetworkPeering.atlasVpcName}`,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    import pulumi_mongodbatlas as mongodbatlas
    
    # Create an Atlas cluster, this creates a container if one
    # does not yet exist for this GCP 
    test_cluster = mongodbatlas.Cluster("testCluster",
        project_id=local["project_id"],
        cluster_type="REPLICASET",
        replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(
            num_shards=1,
            regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(
                region_name="US_EAST_2",
                electable_nodes=3,
                priority=7,
                read_only_nodes=0,
            )],
        )],
        auto_scaling_disk_gb_enabled=True,
        mongo_db_major_version="4.2",
        provider_name="GCP",
        provider_instance_size_name="M10")
    # Create the peering connection request
    test_network_peering = mongodbatlas.NetworkPeering("testNetworkPeering",
        project_id=local["project_id"],
        atlas_cidr_block="192.168.0.0/18",
        container_id=test_cluster.container_id,
        provider_name="GCP",
        gcp_project_id=local["GCP_PROJECT_ID"],
        network_name="default")
    default = gcp.compute.get_network(name="default")
    # Create the GCP peer
    peering = gcp.compute.NetworkPeering("peering",
        network=default.self_link,
        peer_network=pulumi.Output.all(test_network_peering.atlas_gcp_project_id, test_network_peering.atlas_vpc_name).apply(lambda atlas_gcp_project_id, atlas_vpc_name: f"https://www.googleapis.com/compute/v1/projects/{atlas_gcp_project_id}/global/networks/{atlas_vpc_name}"))
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-gcp/sdk/v5/go/gcp/compute"
    	"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 {
    		// Create an Atlas cluster, this creates a container if one
    		// does not yet exist for this GCP
    		testCluster, err := mongodbatlas.NewCluster(ctx, "testCluster", &mongodbatlas.ClusterArgs{
    			ProjectId:   pulumi.Any(local.Project_id),
    			ClusterType: pulumi.String("REPLICASET"),
    			ReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{
    				&mongodbatlas.ClusterReplicationSpecArgs{
    					NumShards: pulumi.Int(1),
    					RegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{
    						&mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{
    							RegionName:     pulumi.String("US_EAST_2"),
    							ElectableNodes: pulumi.Int(3),
    							Priority:       pulumi.Int(7),
    							ReadOnlyNodes:  pulumi.Int(0),
    						},
    					},
    				},
    			},
    			AutoScalingDiskGbEnabled: pulumi.Bool(true),
    			MongoDbMajorVersion:      pulumi.String("4.2"),
    			ProviderName:             pulumi.String("GCP"),
    			ProviderInstanceSizeName: pulumi.String("M10"),
    		})
    		if err != nil {
    			return err
    		}
    		// Create the peering connection request
    		testNetworkPeering, err := mongodbatlas.NewNetworkPeering(ctx, "testNetworkPeering", &mongodbatlas.NetworkPeeringArgs{
    			ProjectId:      pulumi.Any(local.Project_id),
    			AtlasCidrBlock: pulumi.String("192.168.0.0/18"),
    			ContainerId:    testCluster.ContainerId,
    			ProviderName:   pulumi.String("GCP"),
    			GcpProjectId:   pulumi.Any(local.GCP_PROJECT_ID),
    			NetworkName:    pulumi.String("default"),
    		})
    		if err != nil {
    			return err
    		}
    		_default, err := compute.LookupNetwork(ctx, &compute.LookupNetworkArgs{
    			Name: "default",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Create the GCP peer
    		_, err = compute.NewNetworkPeering(ctx, "peering", &compute.NetworkPeeringArgs{
    			Network: *pulumi.String(_default.SelfLink),
    			PeerNetwork: pulumi.All(testNetworkPeering.AtlasGcpProjectId, testNetworkPeering.AtlasVpcName).ApplyT(func(_args []interface{}) (string, error) {
    				atlasGcpProjectId := _args[0].(string)
    				atlasVpcName := _args[1].(string)
    				return fmt.Sprintf("https://www.googleapis.com/compute/v1/projects/%v/global/networks/%v", atlasGcpProjectId, atlasVpcName), nil
    			}).(pulumi.StringOutput),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        // Create an Atlas cluster, this creates a container if one
        // does not yet exist for this GCP 
        var testCluster = new Mongodbatlas.Cluster("testCluster", new()
        {
            ProjectId = local.Project_id,
            ClusterType = "REPLICASET",
            ReplicationSpecs = new[]
            {
                new Mongodbatlas.Inputs.ClusterReplicationSpecArgs
                {
                    NumShards = 1,
                    RegionsConfigs = new[]
                    {
                        new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs
                        {
                            RegionName = "US_EAST_2",
                            ElectableNodes = 3,
                            Priority = 7,
                            ReadOnlyNodes = 0,
                        },
                    },
                },
            },
            AutoScalingDiskGbEnabled = true,
            MongoDbMajorVersion = "4.2",
            ProviderName = "GCP",
            ProviderInstanceSizeName = "M10",
        });
    
        // Create the peering connection request
        var testNetworkPeering = new Mongodbatlas.NetworkPeering("testNetworkPeering", new()
        {
            ProjectId = local.Project_id,
            AtlasCidrBlock = "192.168.0.0/18",
            ContainerId = testCluster.ContainerId,
            ProviderName = "GCP",
            GcpProjectId = local.GCP_PROJECT_ID,
            NetworkName = "default",
        });
    
        var @default = Gcp.Compute.GetNetwork.Invoke(new()
        {
            Name = "default",
        });
    
        // Create the GCP peer
        var peering = new Gcp.Compute.NetworkPeering("peering", new()
        {
            Network = @default.Apply(@default => @default.Apply(getNetworkResult => getNetworkResult.SelfLink)),
            PeerNetwork = Output.Tuple(testNetworkPeering.AtlasGcpProjectId, testNetworkPeering.AtlasVpcName).Apply(values =>
            {
                var atlasGcpProjectId = values.Item1;
                var atlasVpcName = values.Item2;
                return $"https://www.googleapis.com/compute/v1/projects/{atlasGcpProjectId}/global/networks/{atlasVpcName}";
            }),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mongodbatlas.Cluster;
    import com.pulumi.mongodbatlas.ClusterArgs;
    import com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;
    import com.pulumi.mongodbatlas.NetworkPeering;
    import com.pulumi.mongodbatlas.NetworkPeeringArgs;
    import com.pulumi.gcp.compute.ComputeFunctions;
    import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
    import com.pulumi.gcp.compute.NetworkPeering;
    import com.pulumi.gcp.compute.NetworkPeeringArgs;
    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 testCluster = new Cluster("testCluster", ClusterArgs.builder()        
                .projectId(local.project_id())
                .clusterType("REPLICASET")
                .replicationSpecs(ClusterReplicationSpecArgs.builder()
                    .numShards(1)
                    .regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()
                        .regionName("US_EAST_2")
                        .electableNodes(3)
                        .priority(7)
                        .readOnlyNodes(0)
                        .build())
                    .build())
                .autoScalingDiskGbEnabled(true)
                .mongoDbMajorVersion("4.2")
                .providerName("GCP")
                .providerInstanceSizeName("M10")
                .build());
    
            var testNetworkPeering = new NetworkPeering("testNetworkPeering", NetworkPeeringArgs.builder()        
                .projectId(local.project_id())
                .atlasCidrBlock("192.168.0.0/18")
                .containerId(testCluster.containerId())
                .providerName("GCP")
                .gcpProjectId(local.GCP_PROJECT_ID())
                .networkName("default")
                .build());
    
            final var default = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
                .name("default")
                .build());
    
            var peering = new NetworkPeering("peering", NetworkPeeringArgs.builder()        
                .network(default_.selfLink())
                .peerNetwork(Output.tuple(testNetworkPeering.atlasGcpProjectId(), testNetworkPeering.atlasVpcName()).applyValue(values -> {
                    var atlasGcpProjectId = values.t1;
                    var atlasVpcName = values.t2;
                    return String.format("https://www.googleapis.com/compute/v1/projects/%s/global/networks/%s", atlasGcpProjectId,atlasVpcName);
                }))
                .build());
    
        }
    }
    
    resources:
      # Create an Atlas cluster, this creates a container if one
      # does not yet exist for this GCP
      testCluster:
        type: mongodbatlas:Cluster
        properties:
          projectId: ${local.project_id}
          clusterType: REPLICASET
          replicationSpecs:
            - numShards: 1
              regionsConfigs:
                - regionName: US_EAST_2
                  electableNodes: 3
                  priority: 7
                  readOnlyNodes: 0
          autoScalingDiskGbEnabled: true
          mongoDbMajorVersion: '4.2'
          # Provider Settings "block"
          providerName: GCP
          providerInstanceSizeName: M10
      # Create the peering connection request
      testNetworkPeering:
        type: mongodbatlas:NetworkPeering
        properties:
          projectId: ${local.project_id}
          atlasCidrBlock: 192.168.0.0/18
          containerId: ${testCluster.containerId}
          providerName: GCP
          gcpProjectId: ${local.GCP_PROJECT_ID}
          networkName: default
      # Create the GCP peer
      peering:
        type: gcp:compute:NetworkPeering
        properties:
          network: ${default.selfLink}
          peerNetwork: https://www.googleapis.com/compute/v1/projects/${testNetworkPeering.atlasGcpProjectId}/global/networks/${testNetworkPeering.atlasVpcName}
    variables:
      default:
        fn::invoke:
          Function: gcp:compute:getNetwork
          Arguments:
            name: default
    

    Example with Azure

    import * as pulumi from "@pulumi/pulumi";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    // Ensure you have created the required Azure service principal first, see
    // see https://docs.atlas.mongodb.com/security-vpc-peering/
    // Create an Atlas cluster, this creates a container if one
    // does not yet exist for this AZURE region
    const testCluster = new mongodbatlas.Cluster("testCluster", {
        projectId: local.project_id,
        clusterType: "REPLICASET",
        replicationSpecs: [{
            numShards: 1,
            regionsConfigs: [{
                regionName: "US_EAST_2",
                electableNodes: 3,
                priority: 7,
                readOnlyNodes: 0,
            }],
        }],
        autoScalingDiskGbEnabled: false,
        mongoDbMajorVersion: "4.2",
        providerName: "AZURE",
        providerInstanceSizeName: "M10",
    });
    // Create the peering connection request
    const testNetworkPeering = new mongodbatlas.NetworkPeering("testNetworkPeering", {
        projectId: local.project_id,
        containerId: testCluster.containerId,
        providerName: "AZURE",
        azureDirectoryId: local.AZURE_DIRECTORY_ID,
        azureSubscriptionId: local.AZURE_SUBSCRIPTION_ID,
        resourceGroupName: local.AZURE_RESOURCE_GROUP_NAME,
        vnetName: local.AZURE_VNET_NAME,
    });
    
    import pulumi
    import pulumi_mongodbatlas as mongodbatlas
    
    # Ensure you have created the required Azure service principal first, see
    # see https://docs.atlas.mongodb.com/security-vpc-peering/
    # Create an Atlas cluster, this creates a container if one
    # does not yet exist for this AZURE region
    test_cluster = mongodbatlas.Cluster("testCluster",
        project_id=local["project_id"],
        cluster_type="REPLICASET",
        replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(
            num_shards=1,
            regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(
                region_name="US_EAST_2",
                electable_nodes=3,
                priority=7,
                read_only_nodes=0,
            )],
        )],
        auto_scaling_disk_gb_enabled=False,
        mongo_db_major_version="4.2",
        provider_name="AZURE",
        provider_instance_size_name="M10")
    # Create the peering connection request
    test_network_peering = mongodbatlas.NetworkPeering("testNetworkPeering",
        project_id=local["project_id"],
        container_id=test_cluster.container_id,
        provider_name="AZURE",
        azure_directory_id=local["AZURE_DIRECTORY_ID"],
        azure_subscription_id=local["AZURE_SUBSCRIPTION_ID"],
        resource_group_name=local["AZURE_RESOURCE_GROUP_NAME"],
        vnet_name=local["AZURE_VNET_NAME"])
    
    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 {
    		// Ensure you have created the required Azure service principal first, see
    		// see https://docs.atlas.mongodb.com/security-vpc-peering/
    		// Create an Atlas cluster, this creates a container if one
    		// does not yet exist for this AZURE region
    		testCluster, err := mongodbatlas.NewCluster(ctx, "testCluster", &mongodbatlas.ClusterArgs{
    			ProjectId:   pulumi.Any(local.Project_id),
    			ClusterType: pulumi.String("REPLICASET"),
    			ReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{
    				&mongodbatlas.ClusterReplicationSpecArgs{
    					NumShards: pulumi.Int(1),
    					RegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{
    						&mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{
    							RegionName:     pulumi.String("US_EAST_2"),
    							ElectableNodes: pulumi.Int(3),
    							Priority:       pulumi.Int(7),
    							ReadOnlyNodes:  pulumi.Int(0),
    						},
    					},
    				},
    			},
    			AutoScalingDiskGbEnabled: pulumi.Bool(false),
    			MongoDbMajorVersion:      pulumi.String("4.2"),
    			ProviderName:             pulumi.String("AZURE"),
    			ProviderInstanceSizeName: pulumi.String("M10"),
    		})
    		if err != nil {
    			return err
    		}
    		// Create the peering connection request
    		_, err = mongodbatlas.NewNetworkPeering(ctx, "testNetworkPeering", &mongodbatlas.NetworkPeeringArgs{
    			ProjectId:           pulumi.Any(local.Project_id),
    			ContainerId:         testCluster.ContainerId,
    			ProviderName:        pulumi.String("AZURE"),
    			AzureDirectoryId:    pulumi.Any(local.AZURE_DIRECTORY_ID),
    			AzureSubscriptionId: pulumi.Any(local.AZURE_SUBSCRIPTION_ID),
    			ResourceGroupName:   pulumi.Any(local.AZURE_RESOURCE_GROUP_NAME),
    			VnetName:            pulumi.Any(local.AZURE_VNET_NAME),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        // Ensure you have created the required Azure service principal first, see
        // see https://docs.atlas.mongodb.com/security-vpc-peering/
        // Create an Atlas cluster, this creates a container if one
        // does not yet exist for this AZURE region
        var testCluster = new Mongodbatlas.Cluster("testCluster", new()
        {
            ProjectId = local.Project_id,
            ClusterType = "REPLICASET",
            ReplicationSpecs = new[]
            {
                new Mongodbatlas.Inputs.ClusterReplicationSpecArgs
                {
                    NumShards = 1,
                    RegionsConfigs = new[]
                    {
                        new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs
                        {
                            RegionName = "US_EAST_2",
                            ElectableNodes = 3,
                            Priority = 7,
                            ReadOnlyNodes = 0,
                        },
                    },
                },
            },
            AutoScalingDiskGbEnabled = false,
            MongoDbMajorVersion = "4.2",
            ProviderName = "AZURE",
            ProviderInstanceSizeName = "M10",
        });
    
        // Create the peering connection request
        var testNetworkPeering = new Mongodbatlas.NetworkPeering("testNetworkPeering", new()
        {
            ProjectId = local.Project_id,
            ContainerId = testCluster.ContainerId,
            ProviderName = "AZURE",
            AzureDirectoryId = local.AZURE_DIRECTORY_ID,
            AzureSubscriptionId = local.AZURE_SUBSCRIPTION_ID,
            ResourceGroupName = local.AZURE_RESOURCE_GROUP_NAME,
            VnetName = local.AZURE_VNET_NAME,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mongodbatlas.Cluster;
    import com.pulumi.mongodbatlas.ClusterArgs;
    import com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;
    import com.pulumi.mongodbatlas.NetworkPeering;
    import com.pulumi.mongodbatlas.NetworkPeeringArgs;
    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 testCluster = new Cluster("testCluster", ClusterArgs.builder()        
                .projectId(local.project_id())
                .clusterType("REPLICASET")
                .replicationSpecs(ClusterReplicationSpecArgs.builder()
                    .numShards(1)
                    .regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()
                        .regionName("US_EAST_2")
                        .electableNodes(3)
                        .priority(7)
                        .readOnlyNodes(0)
                        .build())
                    .build())
                .autoScalingDiskGbEnabled(false)
                .mongoDbMajorVersion("4.2")
                .providerName("AZURE")
                .providerInstanceSizeName("M10")
                .build());
    
            var testNetworkPeering = new NetworkPeering("testNetworkPeering", NetworkPeeringArgs.builder()        
                .projectId(local.project_id())
                .containerId(testCluster.containerId())
                .providerName("AZURE")
                .azureDirectoryId(local.AZURE_DIRECTORY_ID())
                .azureSubscriptionId(local.AZURE_SUBSCRIPTION_ID())
                .resourceGroupName(local.AZURE_RESOURCE_GROUP_NAME())
                .vnetName(local.AZURE_VNET_NAME())
                .build());
    
        }
    }
    
    resources:
      # Ensure you have created the required Azure service principal first, see
      # see https://docs.atlas.mongodb.com/security-vpc-peering/
    
      # Create an Atlas cluster, this creates a container if one
      # does not yet exist for this AZURE region
      testCluster:
        type: mongodbatlas:Cluster
        properties:
          projectId: ${local.project_id}
          clusterType: REPLICASET
          replicationSpecs:
            - numShards: 1
              regionsConfigs:
                - regionName: US_EAST_2
                  electableNodes: 3
                  priority: 7
                  readOnlyNodes: 0
          autoScalingDiskGbEnabled: false
          mongoDbMajorVersion: '4.2'
          # Provider Settings "block"
          providerName: AZURE
          providerInstanceSizeName: M10
      # Create the peering connection request
      testNetworkPeering:
        type: mongodbatlas:NetworkPeering
        properties:
          projectId: ${local.project_id}
          containerId: ${testCluster.containerId}
          providerName: AZURE
          azureDirectoryId: ${local.AZURE_DIRECTORY_ID}
          azureSubscriptionId: ${local.AZURE_SUBSCRIPTION_ID}
          resourceGroupName: ${local.AZURE_RESOURCE_GROUP_NAME}
          vnetName: ${local.AZURE_VNET_NAME}
    

    Create NetworkPeering Resource

    new NetworkPeering(name: string, args: NetworkPeeringArgs, opts?: CustomResourceOptions);
    @overload
    def NetworkPeering(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       accepter_region_name: Optional[str] = None,
                       atlas_cidr_block: Optional[str] = None,
                       atlas_gcp_project_id: Optional[str] = None,
                       atlas_vpc_name: Optional[str] = None,
                       aws_account_id: Optional[str] = None,
                       azure_directory_id: Optional[str] = None,
                       azure_subscription_id: Optional[str] = None,
                       container_id: Optional[str] = None,
                       gcp_project_id: Optional[str] = None,
                       network_name: Optional[str] = None,
                       project_id: Optional[str] = None,
                       provider_name: Optional[str] = None,
                       resource_group_name: Optional[str] = None,
                       route_table_cidr_block: Optional[str] = None,
                       vnet_name: Optional[str] = None,
                       vpc_id: Optional[str] = None)
    @overload
    def NetworkPeering(resource_name: str,
                       args: NetworkPeeringArgs,
                       opts: Optional[ResourceOptions] = None)
    func NewNetworkPeering(ctx *Context, name string, args NetworkPeeringArgs, opts ...ResourceOption) (*NetworkPeering, error)
    public NetworkPeering(string name, NetworkPeeringArgs args, CustomResourceOptions? opts = null)
    public NetworkPeering(String name, NetworkPeeringArgs args)
    public NetworkPeering(String name, NetworkPeeringArgs args, CustomResourceOptions options)
    
    type: mongodbatlas:NetworkPeering
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args NetworkPeeringArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args NetworkPeeringArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args NetworkPeeringArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NetworkPeeringArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NetworkPeeringArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    NetworkPeering Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The NetworkPeering resource accepts the following input properties:

    ContainerId string
    Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
    ProjectId string
    The unique ID for the MongoDB Atlas project to create the database user.
    ProviderName string

    Cloud provider to whom the peering connection is being made. (Possible Values AWS, AZURE, GCP).

    AWS ONLY:

    AccepterRegionName string
    Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
    AtlasCidrBlock string
    AtlasGcpProjectId string
    The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that it is need to set up the reciprocal connection.
    AtlasVpcName string
    AwsAccountId string
    AWS Account ID of the owner of the peer VPC.
    AzureDirectoryId string
    Unique identifier for an Azure AD directory.
    AzureSubscriptionId string
    Unique identifier of the Azure subscription in which the VNet resides.
    GcpProjectId string
    GCP project ID of the owner of the network peer.
    NetworkName string

    Name of the network peer to which Atlas connects.

    AZURE ONLY:

    ResourceGroupName string
    Name of your Azure resource group.
    RouteTableCidrBlock string

    AWS VPC CIDR block or subnet.

    GCP ONLY:

    VnetName string
    Name of your Azure VNet.
    VpcId string
    Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
    ContainerId string
    Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
    ProjectId string
    The unique ID for the MongoDB Atlas project to create the database user.
    ProviderName string

    Cloud provider to whom the peering connection is being made. (Possible Values AWS, AZURE, GCP).

    AWS ONLY:

    AccepterRegionName string
    Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
    AtlasCidrBlock string
    AtlasGcpProjectId string
    The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that it is need to set up the reciprocal connection.
    AtlasVpcName string
    AwsAccountId string
    AWS Account ID of the owner of the peer VPC.
    AzureDirectoryId string
    Unique identifier for an Azure AD directory.
    AzureSubscriptionId string
    Unique identifier of the Azure subscription in which the VNet resides.
    GcpProjectId string
    GCP project ID of the owner of the network peer.
    NetworkName string

    Name of the network peer to which Atlas connects.

    AZURE ONLY:

    ResourceGroupName string
    Name of your Azure resource group.
    RouteTableCidrBlock string

    AWS VPC CIDR block or subnet.

    GCP ONLY:

    VnetName string
    Name of your Azure VNet.
    VpcId string
    Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
    containerId String
    Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
    projectId String
    The unique ID for the MongoDB Atlas project to create the database user.
    providerName String

    Cloud provider to whom the peering connection is being made. (Possible Values AWS, AZURE, GCP).

    AWS ONLY:

    accepterRegionName String
    Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
    atlasCidrBlock String
    atlasGcpProjectId String
    The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that it is need to set up the reciprocal connection.
    atlasVpcName String
    awsAccountId String
    AWS Account ID of the owner of the peer VPC.
    azureDirectoryId String
    Unique identifier for an Azure AD directory.
    azureSubscriptionId String
    Unique identifier of the Azure subscription in which the VNet resides.
    gcpProjectId String
    GCP project ID of the owner of the network peer.
    networkName String

    Name of the network peer to which Atlas connects.

    AZURE ONLY:

    resourceGroupName String
    Name of your Azure resource group.
    routeTableCidrBlock String

    AWS VPC CIDR block or subnet.

    GCP ONLY:

    vnetName String
    Name of your Azure VNet.
    vpcId String
    Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
    containerId string
    Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
    projectId string
    The unique ID for the MongoDB Atlas project to create the database user.
    providerName string

    Cloud provider to whom the peering connection is being made. (Possible Values AWS, AZURE, GCP).

    AWS ONLY:

    accepterRegionName string
    Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
    atlasCidrBlock string
    atlasGcpProjectId string
    The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that it is need to set up the reciprocal connection.
    atlasVpcName string
    awsAccountId string
    AWS Account ID of the owner of the peer VPC.
    azureDirectoryId string
    Unique identifier for an Azure AD directory.
    azureSubscriptionId string
    Unique identifier of the Azure subscription in which the VNet resides.
    gcpProjectId string
    GCP project ID of the owner of the network peer.
    networkName string

    Name of the network peer to which Atlas connects.

    AZURE ONLY:

    resourceGroupName string
    Name of your Azure resource group.
    routeTableCidrBlock string

    AWS VPC CIDR block or subnet.

    GCP ONLY:

    vnetName string
    Name of your Azure VNet.
    vpcId string
    Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
    container_id str
    Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
    project_id str
    The unique ID for the MongoDB Atlas project to create the database user.
    provider_name str

    Cloud provider to whom the peering connection is being made. (Possible Values AWS, AZURE, GCP).

    AWS ONLY:

    accepter_region_name str
    Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
    atlas_cidr_block str
    atlas_gcp_project_id str
    The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that it is need to set up the reciprocal connection.
    atlas_vpc_name str
    aws_account_id str
    AWS Account ID of the owner of the peer VPC.
    azure_directory_id str
    Unique identifier for an Azure AD directory.
    azure_subscription_id str
    Unique identifier of the Azure subscription in which the VNet resides.
    gcp_project_id str
    GCP project ID of the owner of the network peer.
    network_name str

    Name of the network peer to which Atlas connects.

    AZURE ONLY:

    resource_group_name str
    Name of your Azure resource group.
    route_table_cidr_block str

    AWS VPC CIDR block or subnet.

    GCP ONLY:

    vnet_name str
    Name of your Azure VNet.
    vpc_id str
    Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
    containerId String
    Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
    projectId String
    The unique ID for the MongoDB Atlas project to create the database user.
    providerName String

    Cloud provider to whom the peering connection is being made. (Possible Values AWS, AZURE, GCP).

    AWS ONLY:

    accepterRegionName String
    Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
    atlasCidrBlock String
    atlasGcpProjectId String
    The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that it is need to set up the reciprocal connection.
    atlasVpcName String
    awsAccountId String
    AWS Account ID of the owner of the peer VPC.
    azureDirectoryId String
    Unique identifier for an Azure AD directory.
    azureSubscriptionId String
    Unique identifier of the Azure subscription in which the VNet resides.
    gcpProjectId String
    GCP project ID of the owner of the network peer.
    networkName String

    Name of the network peer to which Atlas connects.

    AZURE ONLY:

    resourceGroupName String
    Name of your Azure resource group.
    routeTableCidrBlock String

    AWS VPC CIDR block or subnet.

    GCP ONLY:

    vnetName String
    Name of your Azure VNet.
    vpcId String
    Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).

    Outputs

    All input properties are implicitly available as output properties. Additionally, the NetworkPeering resource produces the following output properties:

    AtlasId string
    ConnectionId string
    Unique identifier of the Atlas network peering container.
    ErrorMessage string
    When "status" : "FAILED", Atlas provides a description of the error.
    ErrorState string
    Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
    ErrorStateName string
    Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
    Id string
    The provider-assigned unique ID for this managed resource.
    PeerId string
    Unique identifier of the Atlas network peer.
    Status string
    Status of the Atlas network peering connection. Azure/GCP: ADDING_PEER, AVAILABLE, FAILED, DELETING GCP Only: WAITING_FOR_USER.
    StatusName string
    (AWS Only) The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
    AtlasId string
    ConnectionId string
    Unique identifier of the Atlas network peering container.
    ErrorMessage string
    When "status" : "FAILED", Atlas provides a description of the error.
    ErrorState string
    Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
    ErrorStateName string
    Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
    Id string
    The provider-assigned unique ID for this managed resource.
    PeerId string
    Unique identifier of the Atlas network peer.
    Status string
    Status of the Atlas network peering connection. Azure/GCP: ADDING_PEER, AVAILABLE, FAILED, DELETING GCP Only: WAITING_FOR_USER.
    StatusName string
    (AWS Only) The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
    atlasId String
    connectionId String
    Unique identifier of the Atlas network peering container.
    errorMessage String
    When "status" : "FAILED", Atlas provides a description of the error.
    errorState String
    Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
    errorStateName String
    Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
    id String
    The provider-assigned unique ID for this managed resource.
    peerId String
    Unique identifier of the Atlas network peer.
    status String
    Status of the Atlas network peering connection. Azure/GCP: ADDING_PEER, AVAILABLE, FAILED, DELETING GCP Only: WAITING_FOR_USER.
    statusName String
    (AWS Only) The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
    atlasId string
    connectionId string
    Unique identifier of the Atlas network peering container.
    errorMessage string
    When "status" : "FAILED", Atlas provides a description of the error.
    errorState string
    Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
    errorStateName string
    Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
    id string
    The provider-assigned unique ID for this managed resource.
    peerId string
    Unique identifier of the Atlas network peer.
    status string
    Status of the Atlas network peering connection. Azure/GCP: ADDING_PEER, AVAILABLE, FAILED, DELETING GCP Only: WAITING_FOR_USER.
    statusName string
    (AWS Only) The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
    atlas_id str
    connection_id str
    Unique identifier of the Atlas network peering container.
    error_message str
    When "status" : "FAILED", Atlas provides a description of the error.
    error_state str
    Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
    error_state_name str
    Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
    id str
    The provider-assigned unique ID for this managed resource.
    peer_id str
    Unique identifier of the Atlas network peer.
    status str
    Status of the Atlas network peering connection. Azure/GCP: ADDING_PEER, AVAILABLE, FAILED, DELETING GCP Only: WAITING_FOR_USER.
    status_name str
    (AWS Only) The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
    atlasId String
    connectionId String
    Unique identifier of the Atlas network peering container.
    errorMessage String
    When "status" : "FAILED", Atlas provides a description of the error.
    errorState String
    Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
    errorStateName String
    Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
    id String
    The provider-assigned unique ID for this managed resource.
    peerId String
    Unique identifier of the Atlas network peer.
    status String
    Status of the Atlas network peering connection. Azure/GCP: ADDING_PEER, AVAILABLE, FAILED, DELETING GCP Only: WAITING_FOR_USER.
    statusName String
    (AWS Only) The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.

    Look up Existing NetworkPeering Resource

    Get an existing NetworkPeering resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: NetworkPeeringState, opts?: CustomResourceOptions): NetworkPeering
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            accepter_region_name: Optional[str] = None,
            atlas_cidr_block: Optional[str] = None,
            atlas_gcp_project_id: Optional[str] = None,
            atlas_id: Optional[str] = None,
            atlas_vpc_name: Optional[str] = None,
            aws_account_id: Optional[str] = None,
            azure_directory_id: Optional[str] = None,
            azure_subscription_id: Optional[str] = None,
            connection_id: Optional[str] = None,
            container_id: Optional[str] = None,
            error_message: Optional[str] = None,
            error_state: Optional[str] = None,
            error_state_name: Optional[str] = None,
            gcp_project_id: Optional[str] = None,
            network_name: Optional[str] = None,
            peer_id: Optional[str] = None,
            project_id: Optional[str] = None,
            provider_name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            route_table_cidr_block: Optional[str] = None,
            status: Optional[str] = None,
            status_name: Optional[str] = None,
            vnet_name: Optional[str] = None,
            vpc_id: Optional[str] = None) -> NetworkPeering
    func GetNetworkPeering(ctx *Context, name string, id IDInput, state *NetworkPeeringState, opts ...ResourceOption) (*NetworkPeering, error)
    public static NetworkPeering Get(string name, Input<string> id, NetworkPeeringState? state, CustomResourceOptions? opts = null)
    public static NetworkPeering get(String name, Output<String> id, NetworkPeeringState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AccepterRegionName string
    Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
    AtlasCidrBlock string
    AtlasGcpProjectId string
    The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that it is need to set up the reciprocal connection.
    AtlasId string
    AtlasVpcName string
    AwsAccountId string
    AWS Account ID of the owner of the peer VPC.
    AzureDirectoryId string
    Unique identifier for an Azure AD directory.
    AzureSubscriptionId string
    Unique identifier of the Azure subscription in which the VNet resides.
    ConnectionId string
    Unique identifier of the Atlas network peering container.
    ContainerId string
    Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
    ErrorMessage string
    When "status" : "FAILED", Atlas provides a description of the error.
    ErrorState string
    Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
    ErrorStateName string
    Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
    GcpProjectId string
    GCP project ID of the owner of the network peer.
    NetworkName string

    Name of the network peer to which Atlas connects.

    AZURE ONLY:

    PeerId string
    Unique identifier of the Atlas network peer.
    ProjectId string
    The unique ID for the MongoDB Atlas project to create the database user.
    ProviderName string

    Cloud provider to whom the peering connection is being made. (Possible Values AWS, AZURE, GCP).

    AWS ONLY:

    ResourceGroupName string
    Name of your Azure resource group.
    RouteTableCidrBlock string

    AWS VPC CIDR block or subnet.

    GCP ONLY:

    Status string
    Status of the Atlas network peering connection. Azure/GCP: ADDING_PEER, AVAILABLE, FAILED, DELETING GCP Only: WAITING_FOR_USER.
    StatusName string
    (AWS Only) The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
    VnetName string
    Name of your Azure VNet.
    VpcId string
    Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
    AccepterRegionName string
    Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
    AtlasCidrBlock string
    AtlasGcpProjectId string
    The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that it is need to set up the reciprocal connection.
    AtlasId string
    AtlasVpcName string
    AwsAccountId string
    AWS Account ID of the owner of the peer VPC.
    AzureDirectoryId string
    Unique identifier for an Azure AD directory.
    AzureSubscriptionId string
    Unique identifier of the Azure subscription in which the VNet resides.
    ConnectionId string
    Unique identifier of the Atlas network peering container.
    ContainerId string
    Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
    ErrorMessage string
    When "status" : "FAILED", Atlas provides a description of the error.
    ErrorState string
    Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
    ErrorStateName string
    Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
    GcpProjectId string
    GCP project ID of the owner of the network peer.
    NetworkName string

    Name of the network peer to which Atlas connects.

    AZURE ONLY:

    PeerId string
    Unique identifier of the Atlas network peer.
    ProjectId string
    The unique ID for the MongoDB Atlas project to create the database user.
    ProviderName string

    Cloud provider to whom the peering connection is being made. (Possible Values AWS, AZURE, GCP).

    AWS ONLY:

    ResourceGroupName string
    Name of your Azure resource group.
    RouteTableCidrBlock string

    AWS VPC CIDR block or subnet.

    GCP ONLY:

    Status string
    Status of the Atlas network peering connection. Azure/GCP: ADDING_PEER, AVAILABLE, FAILED, DELETING GCP Only: WAITING_FOR_USER.
    StatusName string
    (AWS Only) The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
    VnetName string
    Name of your Azure VNet.
    VpcId string
    Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
    accepterRegionName String
    Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
    atlasCidrBlock String
    atlasGcpProjectId String
    The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that it is need to set up the reciprocal connection.
    atlasId String
    atlasVpcName String
    awsAccountId String
    AWS Account ID of the owner of the peer VPC.
    azureDirectoryId String
    Unique identifier for an Azure AD directory.
    azureSubscriptionId String
    Unique identifier of the Azure subscription in which the VNet resides.
    connectionId String
    Unique identifier of the Atlas network peering container.
    containerId String
    Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
    errorMessage String
    When "status" : "FAILED", Atlas provides a description of the error.
    errorState String
    Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
    errorStateName String
    Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
    gcpProjectId String
    GCP project ID of the owner of the network peer.
    networkName String

    Name of the network peer to which Atlas connects.

    AZURE ONLY:

    peerId String
    Unique identifier of the Atlas network peer.
    projectId String
    The unique ID for the MongoDB Atlas project to create the database user.
    providerName String

    Cloud provider to whom the peering connection is being made. (Possible Values AWS, AZURE, GCP).

    AWS ONLY:

    resourceGroupName String
    Name of your Azure resource group.
    routeTableCidrBlock String

    AWS VPC CIDR block or subnet.

    GCP ONLY:

    status String
    Status of the Atlas network peering connection. Azure/GCP: ADDING_PEER, AVAILABLE, FAILED, DELETING GCP Only: WAITING_FOR_USER.
    statusName String
    (AWS Only) The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
    vnetName String
    Name of your Azure VNet.
    vpcId String
    Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
    accepterRegionName string
    Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
    atlasCidrBlock string
    atlasGcpProjectId string
    The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that it is need to set up the reciprocal connection.
    atlasId string
    atlasVpcName string
    awsAccountId string
    AWS Account ID of the owner of the peer VPC.
    azureDirectoryId string
    Unique identifier for an Azure AD directory.
    azureSubscriptionId string
    Unique identifier of the Azure subscription in which the VNet resides.
    connectionId string
    Unique identifier of the Atlas network peering container.
    containerId string
    Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
    errorMessage string
    When "status" : "FAILED", Atlas provides a description of the error.
    errorState string
    Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
    errorStateName string
    Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
    gcpProjectId string
    GCP project ID of the owner of the network peer.
    networkName string

    Name of the network peer to which Atlas connects.

    AZURE ONLY:

    peerId string
    Unique identifier of the Atlas network peer.
    projectId string
    The unique ID for the MongoDB Atlas project to create the database user.
    providerName string

    Cloud provider to whom the peering connection is being made. (Possible Values AWS, AZURE, GCP).

    AWS ONLY:

    resourceGroupName string
    Name of your Azure resource group.
    routeTableCidrBlock string

    AWS VPC CIDR block or subnet.

    GCP ONLY:

    status string
    Status of the Atlas network peering connection. Azure/GCP: ADDING_PEER, AVAILABLE, FAILED, DELETING GCP Only: WAITING_FOR_USER.
    statusName string
    (AWS Only) The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
    vnetName string
    Name of your Azure VNet.
    vpcId string
    Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
    accepter_region_name str
    Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
    atlas_cidr_block str
    atlas_gcp_project_id str
    The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that it is need to set up the reciprocal connection.
    atlas_id str
    atlas_vpc_name str
    aws_account_id str
    AWS Account ID of the owner of the peer VPC.
    azure_directory_id str
    Unique identifier for an Azure AD directory.
    azure_subscription_id str
    Unique identifier of the Azure subscription in which the VNet resides.
    connection_id str
    Unique identifier of the Atlas network peering container.
    container_id str
    Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
    error_message str
    When "status" : "FAILED", Atlas provides a description of the error.
    error_state str
    Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
    error_state_name 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 str
    GCP project ID of the owner of the network peer.
    network_name str

    Name of the network peer to which Atlas connects.

    AZURE ONLY:

    peer_id str
    Unique identifier of the Atlas network peer.
    project_id str
    The unique ID for the MongoDB Atlas project to create the database user.
    provider_name str

    Cloud provider to whom the peering connection is being made. (Possible Values AWS, AZURE, GCP).

    AWS ONLY:

    resource_group_name str
    Name of your Azure resource group.
    route_table_cidr_block str

    AWS VPC CIDR block or subnet.

    GCP ONLY:

    status str
    Status of the Atlas network peering connection. Azure/GCP: ADDING_PEER, AVAILABLE, FAILED, DELETING GCP Only: WAITING_FOR_USER.
    status_name str
    (AWS Only) The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
    vnet_name str
    Name of your Azure VNet.
    vpc_id str
    Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
    accepterRegionName String
    Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
    atlasCidrBlock String
    atlasGcpProjectId String
    The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that it is need to set up the reciprocal connection.
    atlasId String
    atlasVpcName String
    awsAccountId String
    AWS Account ID of the owner of the peer VPC.
    azureDirectoryId String
    Unique identifier for an Azure AD directory.
    azureSubscriptionId String
    Unique identifier of the Azure subscription in which the VNet resides.
    connectionId String
    Unique identifier of the Atlas network peering container.
    containerId String
    Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
    errorMessage String
    When "status" : "FAILED", Atlas provides a description of the error.
    errorState String
    Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
    errorStateName String
    Error state, if any. The VPC peering connection error state value can be one of the following: REJECTED, EXPIRED, INVALID_ARGUMENT.
    gcpProjectId String
    GCP project ID of the owner of the network peer.
    networkName String

    Name of the network peer to which Atlas connects.

    AZURE ONLY:

    peerId String
    Unique identifier of the Atlas network peer.
    projectId String
    The unique ID for the MongoDB Atlas project to create the database user.
    providerName String

    Cloud provider to whom the peering connection is being made. (Possible Values AWS, AZURE, GCP).

    AWS ONLY:

    resourceGroupName String
    Name of your Azure resource group.
    routeTableCidrBlock String

    AWS VPC CIDR block or subnet.

    GCP ONLY:

    status String
    Status of the Atlas network peering connection. Azure/GCP: ADDING_PEER, AVAILABLE, FAILED, DELETING GCP Only: WAITING_FOR_USER.
    statusName String
    (AWS Only) The VPC peering connection status value can be one of the following: INITIATING, PENDING_ACCEPTANCE, FAILED, FINALIZING, AVAILABLE, TERMINATING.
    vnetName String
    Name of your Azure VNet.
    vpcId String
    Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).

    Import

    Network Peering Connections can be imported using project ID and network peering id, in the format PROJECTID-PEERID-PROVIDERNAME, e.g.

    $ pulumi import mongodbatlas:index/networkPeering:NetworkPeering my_peering 1112222b3bf99403840e8934-5cbf563d87d9d67253be590a-AWS
    

    See detailed information for arguments and attributes: MongoDB API Network Peering Connection

    -> NOTE: If you need to get an existing container ID see the How-To Guide.

    Package Details

    Repository
    MongoDB Atlas pulumi/pulumi-mongodbatlas
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the mongodbatlas Terraform Provider.
    mongodbatlas logo
    MongoDB Atlas v3.14.2 published on Monday, Mar 18, 2024 by Pulumi