diff --git a/examples/go.mod b/examples/go.mod index 217e3160..f8c60365 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -2,7 +2,7 @@ module github.com/pulumi/pulumi-mongodbatlas/examples/v2 go 1.21 -require github.com/pulumi/pulumi/pkg/v3 v3.105.0 +require github.com/pulumi/pulumi/pkg/v3 v3.107.0 require ( cloud.google.com/go v0.110.10 // indirect @@ -135,7 +135,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect github.com/pulumi/esc v0.6.2 // indirect - github.com/pulumi/pulumi/sdk/v3 v3.105.0 // indirect + github.com/pulumi/pulumi/sdk/v3 v3.107.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect diff --git a/examples/go.sum b/examples/go.sum index c752447c..bf363e56 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -1467,10 +1467,10 @@ github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 h1:vkHw5I/plNdTr435 github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231/go.mod h1:murToZ2N9hNJzewjHBgfFdXhZKjY3z5cYC1VXk+lbFE= github.com/pulumi/esc v0.6.2 h1:+z+l8cuwIauLSwXQS0uoI3rqB+YG4SzsZYtHfNoXBvw= github.com/pulumi/esc v0.6.2/go.mod h1:jNnYNjzsOgVTjCp0LL24NsCk8ZJxq4IoLQdCT0X7l8k= -github.com/pulumi/pulumi/pkg/v3 v3.105.0 h1:bJG1vUiYH2gDF1pfBKlIABDNoJD2LvU1LmjjL+EbvuM= -github.com/pulumi/pulumi/pkg/v3 v3.105.0/go.mod h1:eZAFEFOwE/skElTfwetfyTxPebmWr5vOS5NSU9XwlVw= -github.com/pulumi/pulumi/sdk/v3 v3.105.0 h1:OKEeubZigWyQVnZS6udnFnZHZ/8OWXuUYv9ir3OY+vs= -github.com/pulumi/pulumi/sdk/v3 v3.105.0/go.mod h1:Ml3rpGfyZlI4zQCG7LN2XDSmH4XUNYdyBwJ3yEr/OpI= +github.com/pulumi/pulumi/pkg/v3 v3.107.0 h1:HRyIl1c9ur0PVQW+GuFL1APBEuGa/fQQMp3F+WluxW8= +github.com/pulumi/pulumi/pkg/v3 v3.107.0/go.mod h1:7edfZu4FlrXdIn4339tJ+SQX5VKGqbFntmpc8cai0Zg= +github.com/pulumi/pulumi/sdk/v3 v3.107.0 h1:bef+ayh9+4KkAqXih4EjlHfQXRY24NWPwWBIQhBxTjg= +github.com/pulumi/pulumi/sdk/v3 v3.107.0/go.mod h1:Ml3rpGfyZlI4zQCG7LN2XDSmH4XUNYdyBwJ3yEr/OpI= github.com/rakyll/embedmd v0.0.0-20171029212350-c8060a0752a2/go.mod h1:7jOTMgqac46PZcF54q6l2hkLEG8op93fZu61KmxWDV4= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= diff --git a/provider/cmd/pulumi-resource-mongodbatlas/schema.json b/provider/cmd/pulumi-resource-mongodbatlas/schema.json index 1ec0337e..6de479c8 100644 --- a/provider/cmd/pulumi-resource-mongodbatlas/schema.json +++ b/provider/cmd/pulumi-resource-mongodbatlas/schema.json @@ -16906,7 +16906,7 @@ } }, "mongodbatlas:index/networkPeering:NetworkPeering": { - "description": "`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. \n\nEnsure 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.\n\n\u003e **GCP AND AZURE ONLY:** Connect via Peering Only mode is deprecated, so no longer needed. See [disable Peering Only mode](https://docs.atlas.mongodb.com/reference/faq/connection-changes/#disable-peering-mode) for details\n\n\u003e **AZURE ONLY:** To create the peering request with an Azure VNET, you must grant Atlas the following permissions on the virtual network.\n Microsoft.Network/virtualNetworks/virtualNetworkPeerings/read\n Microsoft.Network/virtualNetworks/virtualNetworkPeerings/write\n Microsoft.Network/virtualNetworks/virtualNetworkPeerings/delete\n Microsoft.Network/virtualNetworks/peer/action\nFor more information see https://docs.atlas.mongodb.com/security-vpc-peering/ and https://docs.atlas.mongodb.com/reference/api/vpc-create-peering-connection/\n\n\u003e **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.\n\n\u003e **NOTE:** Groups and projects are synonymous terms. You may find **group_id** in the official documentation.\n\n\n{{% examples %}}\n## Example Usage\n\n### Container \u0026 Peering Connection\n{{% example %}}\n### Example with AWS\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as mongodbatlas from \"@pulumi/mongodbatlas\";\n\n// Container example provided but not always required, \n// see network_container documentation for details. \nconst testNetworkContainer = new mongodbatlas.NetworkContainer(\"testNetworkContainer\", {\n projectId: local.project_id,\n atlasCidrBlock: \"10.8.0.0/21\",\n providerName: \"AWS\",\n regionName: \"US_EAST_1\",\n});\n// Create the peering connection request\nconst testNetworkPeering = new mongodbatlas.NetworkPeering(\"testNetworkPeering\", {\n accepterRegionName: \"us-east-1\",\n projectId: local.project_id,\n containerId: \"507f1f77bcf86cd799439011\",\n providerName: \"AWS\",\n routeTableCidrBlock: \"192.168.0.0/24\",\n vpcId: \"vpc-abc123abc123\",\n awsAccountId: \"abc123abc123\",\n});\n// the following assumes an AWS provider is configured\n// Accept the peering connection request\nconst peer = new aws.ec2.VpcPeeringConnectionAccepter(\"peer\", {\n vpcPeeringConnectionId: testNetworkPeering.connectionId,\n autoAccept: true,\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_mongodbatlas as mongodbatlas\n\n# Container example provided but not always required, \n# see network_container documentation for details. \ntest_network_container = mongodbatlas.NetworkContainer(\"testNetworkContainer\",\n project_id=local[\"project_id\"],\n atlas_cidr_block=\"10.8.0.0/21\",\n provider_name=\"AWS\",\n region_name=\"US_EAST_1\")\n# Create the peering connection request\ntest_network_peering = mongodbatlas.NetworkPeering(\"testNetworkPeering\",\n accepter_region_name=\"us-east-1\",\n project_id=local[\"project_id\"],\n container_id=\"507f1f77bcf86cd799439011\",\n provider_name=\"AWS\",\n route_table_cidr_block=\"192.168.0.0/24\",\n vpc_id=\"vpc-abc123abc123\",\n aws_account_id=\"abc123abc123\")\n# the following assumes an AWS provider is configured\n# Accept the peering connection request\npeer = aws.ec2.VpcPeeringConnectionAccepter(\"peer\",\n vpc_peering_connection_id=test_network_peering.connection_id,\n auto_accept=True)\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Mongodbatlas = Pulumi.Mongodbatlas;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Container example provided but not always required, \n // see network_container documentation for details. \n var testNetworkContainer = new Mongodbatlas.NetworkContainer(\"testNetworkContainer\", new()\n {\n ProjectId = local.Project_id,\n AtlasCidrBlock = \"10.8.0.0/21\",\n ProviderName = \"AWS\",\n RegionName = \"US_EAST_1\",\n });\n\n // Create the peering connection request\n var testNetworkPeering = new Mongodbatlas.NetworkPeering(\"testNetworkPeering\", new()\n {\n AccepterRegionName = \"us-east-1\",\n ProjectId = local.Project_id,\n ContainerId = \"507f1f77bcf86cd799439011\",\n ProviderName = \"AWS\",\n RouteTableCidrBlock = \"192.168.0.0/24\",\n VpcId = \"vpc-abc123abc123\",\n AwsAccountId = \"abc123abc123\",\n });\n\n // the following assumes an AWS provider is configured\n // Accept the peering connection request\n var peer = new Aws.Ec2.VpcPeeringConnectionAccepter(\"peer\", new()\n {\n VpcPeeringConnectionId = testNetworkPeering.ConnectionId,\n AutoAccept = true,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2\"\n\t\"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := mongodbatlas.NewNetworkContainer(ctx, \"testNetworkContainer\", \u0026mongodbatlas.NetworkContainerArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tAtlasCidrBlock: pulumi.String(\"10.8.0.0/21\"),\n\t\t\tProviderName: pulumi.String(\"AWS\"),\n\t\t\tRegionName: pulumi.String(\"US_EAST_1\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttestNetworkPeering, err := mongodbatlas.NewNetworkPeering(ctx, \"testNetworkPeering\", \u0026mongodbatlas.NetworkPeeringArgs{\n\t\t\tAccepterRegionName: pulumi.String(\"us-east-1\"),\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tContainerId: pulumi.String(\"507f1f77bcf86cd799439011\"),\n\t\t\tProviderName: pulumi.String(\"AWS\"),\n\t\t\tRouteTableCidrBlock: pulumi.String(\"192.168.0.0/24\"),\n\t\t\tVpcId: pulumi.String(\"vpc-abc123abc123\"),\n\t\t\tAwsAccountId: pulumi.String(\"abc123abc123\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = ec2.NewVpcPeeringConnectionAccepter(ctx, \"peer\", \u0026ec2.VpcPeeringConnectionAccepterArgs{\n\t\t\tVpcPeeringConnectionId: testNetworkPeering.ConnectionId,\n\t\t\tAutoAccept: pulumi.Bool(true),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mongodbatlas.NetworkContainer;\nimport com.pulumi.mongodbatlas.NetworkContainerArgs;\nimport com.pulumi.mongodbatlas.NetworkPeering;\nimport com.pulumi.mongodbatlas.NetworkPeeringArgs;\nimport com.pulumi.aws.ec2.VpcPeeringConnectionAccepter;\nimport com.pulumi.aws.ec2.VpcPeeringConnectionAccepterArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var testNetworkContainer = new NetworkContainer(\"testNetworkContainer\", NetworkContainerArgs.builder() \n .projectId(local.project_id())\n .atlasCidrBlock(\"10.8.0.0/21\")\n .providerName(\"AWS\")\n .regionName(\"US_EAST_1\")\n .build());\n\n var testNetworkPeering = new NetworkPeering(\"testNetworkPeering\", NetworkPeeringArgs.builder() \n .accepterRegionName(\"us-east-1\")\n .projectId(local.project_id())\n .containerId(\"507f1f77bcf86cd799439011\")\n .providerName(\"AWS\")\n .routeTableCidrBlock(\"192.168.0.0/24\")\n .vpcId(\"vpc-abc123abc123\")\n .awsAccountId(\"abc123abc123\")\n .build());\n\n var peer = new VpcPeeringConnectionAccepter(\"peer\", VpcPeeringConnectionAccepterArgs.builder() \n .vpcPeeringConnectionId(testNetworkPeering.connectionId())\n .autoAccept(true)\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Container example provided but not always required, \n # see network_container documentation for details.\n testNetworkContainer:\n type: mongodbatlas:NetworkContainer\n properties:\n projectId: ${local.project_id}\n atlasCidrBlock: 10.8.0.0/21\n providerName: AWS\n regionName: US_EAST_1\n # Create the peering connection request\n testNetworkPeering:\n type: mongodbatlas:NetworkPeering\n properties:\n accepterRegionName: us-east-1\n projectId: ${local.project_id}\n containerId: 507f1f77bcf86cd799439011\n providerName: AWS\n routeTableCidrBlock: 192.168.0.0/24\n vpcId: vpc-abc123abc123\n awsAccountId: abc123abc123\n # the following assumes an AWS provider is configured\n # Accept the peering connection request\n peer:\n type: aws:ec2:VpcPeeringConnectionAccepter\n properties:\n vpcPeeringConnectionId: ${testNetworkPeering.connectionId}\n autoAccept: true\n```\n{{% /example %}}\n{{% example %}}\n### Example with GCP\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as gcp from \"@pulumi/gcp\";\nimport * as mongodbatlas from \"@pulumi/mongodbatlas\";\n\n// Container example provided but not always required, \n// see network_container documentation for details. \nconst testNetworkContainer = new mongodbatlas.NetworkContainer(\"testNetworkContainer\", {\n projectId: local.project_id,\n atlasCidrBlock: \"10.8.0.0/21\",\n providerName: \"GCP\",\n});\n// Create the peering connection request\nconst testNetworkPeering = new mongodbatlas.NetworkPeering(\"testNetworkPeering\", {\n projectId: local.project_id,\n containerId: testNetworkContainer.containerId,\n providerName: \"GCP\",\n gcpProjectId: local.GCP_PROJECT_ID,\n networkName: \"default\",\n});\nconst default = gcp.compute.getNetwork({\n name: \"default\",\n});\n// Create the GCP peer\nconst peering = new gcp.compute.NetworkPeering(\"peering\", {\n network: _default.then(_default =\u003e _default.selfLink),\n peerNetwork: pulumi.interpolate`https://www.googleapis.com/compute/v1/projects/${testNetworkPeering.atlasGcpProjectId}/global/networks/${testNetworkPeering.atlasVpcName}`,\n});\n// Create the cluster once the peering connection is completed\nconst testCluster = new mongodbatlas.Cluster(\"testCluster\", {\n projectId: local.project_id,\n numShards: 1,\n clusterType: \"REPLICASET\",\n replicationSpecs: [{\n numShards: 1,\n regionsConfigs: [{\n regionName: \"US_EAST_4\",\n electableNodes: 3,\n priority: 7,\n readOnlyNodes: 0,\n }],\n }],\n autoScalingDiskGbEnabled: true,\n mongoDbMajorVersion: \"4.2\",\n providerName: \"GCP\",\n providerInstanceSizeName: \"M10\",\n}, {\n dependsOn: [\"google_compute_network_peering.peering\"],\n});\n```\n```python\nimport pulumi\nimport pulumi_gcp as gcp\nimport pulumi_mongodbatlas as mongodbatlas\n\n# Container example provided but not always required, \n# see network_container documentation for details. \ntest_network_container = mongodbatlas.NetworkContainer(\"testNetworkContainer\",\n project_id=local[\"project_id\"],\n atlas_cidr_block=\"10.8.0.0/21\",\n provider_name=\"GCP\")\n# Create the peering connection request\ntest_network_peering = mongodbatlas.NetworkPeering(\"testNetworkPeering\",\n project_id=local[\"project_id\"],\n container_id=test_network_container.container_id,\n provider_name=\"GCP\",\n gcp_project_id=local[\"GCP_PROJECT_ID\"],\n network_name=\"default\")\ndefault = gcp.compute.get_network(name=\"default\")\n# Create the GCP peer\npeering = gcp.compute.NetworkPeering(\"peering\",\n network=default.self_link,\n 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}\"))\n# Create the cluster once the peering connection is completed\ntest_cluster = mongodbatlas.Cluster(\"testCluster\",\n project_id=local[\"project_id\"],\n num_shards=1,\n cluster_type=\"REPLICASET\",\n replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(\n num_shards=1,\n regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(\n region_name=\"US_EAST_4\",\n electable_nodes=3,\n priority=7,\n read_only_nodes=0,\n )],\n )],\n auto_scaling_disk_gb_enabled=True,\n mongo_db_major_version=\"4.2\",\n provider_name=\"GCP\",\n provider_instance_size_name=\"M10\",\n opts=pulumi.ResourceOptions(depends_on=[\"google_compute_network_peering.peering\"]))\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Gcp = Pulumi.Gcp;\nusing Mongodbatlas = Pulumi.Mongodbatlas;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Container example provided but not always required, \n // see network_container documentation for details. \n var testNetworkContainer = new Mongodbatlas.NetworkContainer(\"testNetworkContainer\", new()\n {\n ProjectId = local.Project_id,\n AtlasCidrBlock = \"10.8.0.0/21\",\n ProviderName = \"GCP\",\n });\n\n // Create the peering connection request\n var testNetworkPeering = new Mongodbatlas.NetworkPeering(\"testNetworkPeering\", new()\n {\n ProjectId = local.Project_id,\n ContainerId = testNetworkContainer.ContainerId,\n ProviderName = \"GCP\",\n GcpProjectId = local.GCP_PROJECT_ID,\n NetworkName = \"default\",\n });\n\n var @default = Gcp.Compute.GetNetwork.Invoke(new()\n {\n Name = \"default\",\n });\n\n // Create the GCP peer\n var peering = new Gcp.Compute.NetworkPeering(\"peering\", new()\n {\n Network = @default.Apply(@default =\u003e @default.Apply(getNetworkResult =\u003e getNetworkResult.SelfLink)),\n PeerNetwork = Output.Tuple(testNetworkPeering.AtlasGcpProjectId, testNetworkPeering.AtlasVpcName).Apply(values =\u003e\n {\n var atlasGcpProjectId = values.Item1;\n var atlasVpcName = values.Item2;\n return $\"https://www.googleapis.com/compute/v1/projects/{atlasGcpProjectId}/global/networks/{atlasVpcName}\";\n }),\n });\n\n // Create the cluster once the peering connection is completed\n var testCluster = new Mongodbatlas.Cluster(\"testCluster\", new()\n {\n ProjectId = local.Project_id,\n NumShards = 1,\n ClusterType = \"REPLICASET\",\n ReplicationSpecs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecArgs\n {\n NumShards = 1,\n RegionsConfigs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs\n {\n RegionName = \"US_EAST_4\",\n ElectableNodes = 3,\n Priority = 7,\n ReadOnlyNodes = 0,\n },\n },\n },\n },\n AutoScalingDiskGbEnabled = true,\n MongoDbMajorVersion = \"4.2\",\n ProviderName = \"GCP\",\n ProviderInstanceSizeName = \"M10\",\n }, new CustomResourceOptions\n {\n DependsOn = new[]\n {\n \"google_compute_network_peering.peering\",\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-gcp/sdk/v5/go/gcp/compute\"\n\t\"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\ttestNetworkContainer, err := mongodbatlas.NewNetworkContainer(ctx, \"testNetworkContainer\", \u0026mongodbatlas.NetworkContainerArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tAtlasCidrBlock: pulumi.String(\"10.8.0.0/21\"),\n\t\t\tProviderName: pulumi.String(\"GCP\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttestNetworkPeering, err := mongodbatlas.NewNetworkPeering(ctx, \"testNetworkPeering\", \u0026mongodbatlas.NetworkPeeringArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tContainerId: testNetworkContainer.ContainerId,\n\t\t\tProviderName: pulumi.String(\"GCP\"),\n\t\t\tGcpProjectId: pulumi.Any(local.GCP_PROJECT_ID),\n\t\t\tNetworkName: pulumi.String(\"default\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_default, err := compute.LookupNetwork(ctx, \u0026compute.LookupNetworkArgs{\n\t\t\tName: \"default\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = compute.NewNetworkPeering(ctx, \"peering\", \u0026compute.NetworkPeeringArgs{\n\t\t\tNetwork: *pulumi.String(_default.SelfLink),\n\t\t\tPeerNetwork: pulumi.All(testNetworkPeering.AtlasGcpProjectId, testNetworkPeering.AtlasVpcName).ApplyT(func(_args []interface{}) (string, error) {\n\t\t\t\tatlasGcpProjectId := _args[0].(string)\n\t\t\t\tatlasVpcName := _args[1].(string)\n\t\t\t\treturn fmt.Sprintf(\"https://www.googleapis.com/compute/v1/projects/%v/global/networks/%v\", atlasGcpProjectId, atlasVpcName), nil\n\t\t\t}).(pulumi.StringOutput),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = mongodbatlas.NewCluster(ctx, \"testCluster\", \u0026mongodbatlas.ClusterArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tNumShards: pulumi.Int(1),\n\t\t\tClusterType: pulumi.String(\"REPLICASET\"),\n\t\t\tReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{\n\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecArgs{\n\t\t\t\t\tNumShards: pulumi.Int(1),\n\t\t\t\t\tRegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{\n\t\t\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{\n\t\t\t\t\t\t\tRegionName: pulumi.String(\"US_EAST_4\"),\n\t\t\t\t\t\t\tElectableNodes: pulumi.Int(3),\n\t\t\t\t\t\t\tPriority: pulumi.Int(7),\n\t\t\t\t\t\t\tReadOnlyNodes: pulumi.Int(0),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tAutoScalingDiskGbEnabled: pulumi.Bool(true),\n\t\t\tMongoDbMajorVersion: pulumi.String(\"4.2\"),\n\t\t\tProviderName: pulumi.String(\"GCP\"),\n\t\t\tProviderInstanceSizeName: pulumi.String(\"M10\"),\n\t\t}, pulumi.DependsOn([]pulumi.Resource{\n\t\t\tpulumi.Resource(\"google_compute_network_peering.peering\"),\n\t\t}))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mongodbatlas.NetworkContainer;\nimport com.pulumi.mongodbatlas.NetworkContainerArgs;\nimport com.pulumi.mongodbatlas.NetworkPeering;\nimport com.pulumi.mongodbatlas.NetworkPeeringArgs;\nimport com.pulumi.gcp.compute.ComputeFunctions;\nimport com.pulumi.gcp.compute.inputs.GetNetworkArgs;\nimport com.pulumi.gcp.compute.NetworkPeering;\nimport com.pulumi.gcp.compute.NetworkPeeringArgs;\nimport com.pulumi.mongodbatlas.Cluster;\nimport com.pulumi.mongodbatlas.ClusterArgs;\nimport com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;\nimport com.pulumi.resources.CustomResourceOptions;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var testNetworkContainer = new NetworkContainer(\"testNetworkContainer\", NetworkContainerArgs.builder() \n .projectId(local.project_id())\n .atlasCidrBlock(\"10.8.0.0/21\")\n .providerName(\"GCP\")\n .build());\n\n var testNetworkPeering = new NetworkPeering(\"testNetworkPeering\", NetworkPeeringArgs.builder() \n .projectId(local.project_id())\n .containerId(testNetworkContainer.containerId())\n .providerName(\"GCP\")\n .gcpProjectId(local.GCP_PROJECT_ID())\n .networkName(\"default\")\n .build());\n\n final var default = ComputeFunctions.getNetwork(GetNetworkArgs.builder()\n .name(\"default\")\n .build());\n\n var peering = new NetworkPeering(\"peering\", NetworkPeeringArgs.builder() \n .network(default_.selfLink())\n .peerNetwork(Output.tuple(testNetworkPeering.atlasGcpProjectId(), testNetworkPeering.atlasVpcName()).applyValue(values -\u003e {\n var atlasGcpProjectId = values.t1;\n var atlasVpcName = values.t2;\n return String.format(\"https://www.googleapis.com/compute/v1/projects/%s/global/networks/%s\", atlasGcpProjectId,atlasVpcName);\n }))\n .build());\n\n var testCluster = new Cluster(\"testCluster\", ClusterArgs.builder() \n .projectId(local.project_id())\n .numShards(1)\n .clusterType(\"REPLICASET\")\n .replicationSpecs(ClusterReplicationSpecArgs.builder()\n .numShards(1)\n .regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()\n .regionName(\"US_EAST_4\")\n .electableNodes(3)\n .priority(7)\n .readOnlyNodes(0)\n .build())\n .build())\n .autoScalingDiskGbEnabled(true)\n .mongoDbMajorVersion(\"4.2\")\n .providerName(\"GCP\")\n .providerInstanceSizeName(\"M10\")\n .build(), CustomResourceOptions.builder()\n .dependsOn(\"google_compute_network_peering.peering\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Container example provided but not always required, \n # see network_container documentation for details.\n testNetworkContainer:\n type: mongodbatlas:NetworkContainer\n properties:\n projectId: ${local.project_id}\n atlasCidrBlock: 10.8.0.0/21\n providerName: GCP\n # Create the peering connection request\n testNetworkPeering:\n type: mongodbatlas:NetworkPeering\n properties:\n projectId: ${local.project_id}\n containerId: ${testNetworkContainer.containerId}\n providerName: GCP\n gcpProjectId: ${local.GCP_PROJECT_ID}\n networkName: default\n # Create the GCP peer\n peering:\n type: gcp:compute:NetworkPeering\n properties:\n network: ${default.selfLink}\n peerNetwork: https://www.googleapis.com/compute/v1/projects/${testNetworkPeering.atlasGcpProjectId}/global/networks/${testNetworkPeering.atlasVpcName}\n # Create the cluster once the peering connection is completed\n testCluster:\n type: mongodbatlas:Cluster\n properties:\n projectId: ${local.project_id}\n numShards: 1\n clusterType: REPLICASET\n replicationSpecs:\n - numShards: 1\n regionsConfigs:\n - regionName: US_EAST_4\n electableNodes: 3\n priority: 7\n readOnlyNodes: 0\n autoScalingDiskGbEnabled: true\n mongoDbMajorVersion: '4.2'\n # Provider Settings \"block\"\n providerName: GCP\n providerInstanceSizeName: M10\n options:\n dependson:\n - google_compute_network_peering.peering\nvariables:\n default:\n fn::invoke:\n Function: gcp:compute:getNetwork\n Arguments:\n name: default\n```\n{{% /example %}}\n{{% example %}}\n### Example with Azure\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as mongodbatlas from \"@pulumi/mongodbatlas\";\n\n// Ensure you have created the required Azure service principal first, see\n// see https://docs.atlas.mongodb.com/security-vpc-peering/\n// Container example provided but not always required, \n// see network_container documentation for details. \nconst testNetworkContainer = new mongodbatlas.NetworkContainer(\"testNetworkContainer\", {\n projectId: local.project_id,\n atlasCidrBlock: local.ATLAS_CIDR_BLOCK,\n providerName: \"AZURE\",\n region: \"US_EAST_2\",\n});\n// Create the peering connection request\nconst testNetworkPeering = new mongodbatlas.NetworkPeering(\"testNetworkPeering\", {\n projectId: local.project_id,\n containerId: testNetworkContainer.containerId,\n providerName: \"AZURE\",\n azureDirectoryId: local.AZURE_DIRECTORY_ID,\n azureSubscriptionId: local.AZURE_SUBSCRIPTION_ID,\n resourceGroupName: local.AZURE_RESOURCES_GROUP_NAME,\n vnetName: local.AZURE_VNET_NAME,\n});\n// Create the cluster once the peering connection is completed\nconst testCluster = new mongodbatlas.Cluster(\"testCluster\", {\n projectId: local.project_id,\n clusterType: \"REPLICASET\",\n replicationSpecs: [{\n numShards: 1,\n regionsConfigs: [{\n regionName: \"US_EAST_2\",\n electableNodes: 3,\n priority: 7,\n readOnlyNodes: 0,\n }],\n }],\n autoScalingDiskGbEnabled: true,\n mongoDbMajorVersion: \"4.2\",\n providerName: \"AZURE\",\n providerDiskTypeName: \"P4\",\n providerInstanceSizeName: \"M10\",\n}, {\n dependsOn: [\"mongodbatlas_network_peering.test\"],\n});\n```\n```python\nimport pulumi\nimport pulumi_mongodbatlas as mongodbatlas\n\n# Ensure you have created the required Azure service principal first, see\n# see https://docs.atlas.mongodb.com/security-vpc-peering/\n# Container example provided but not always required, \n# see network_container documentation for details. \ntest_network_container = mongodbatlas.NetworkContainer(\"testNetworkContainer\",\n project_id=local[\"project_id\"],\n atlas_cidr_block=local[\"ATLAS_CIDR_BLOCK\"],\n provider_name=\"AZURE\",\n region=\"US_EAST_2\")\n# Create the peering connection request\ntest_network_peering = mongodbatlas.NetworkPeering(\"testNetworkPeering\",\n project_id=local[\"project_id\"],\n container_id=test_network_container.container_id,\n provider_name=\"AZURE\",\n azure_directory_id=local[\"AZURE_DIRECTORY_ID\"],\n azure_subscription_id=local[\"AZURE_SUBSCRIPTION_ID\"],\n resource_group_name=local[\"AZURE_RESOURCES_GROUP_NAME\"],\n vnet_name=local[\"AZURE_VNET_NAME\"])\n# Create the cluster once the peering connection is completed\ntest_cluster = mongodbatlas.Cluster(\"testCluster\",\n project_id=local[\"project_id\"],\n cluster_type=\"REPLICASET\",\n replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(\n num_shards=1,\n regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(\n region_name=\"US_EAST_2\",\n electable_nodes=3,\n priority=7,\n read_only_nodes=0,\n )],\n )],\n auto_scaling_disk_gb_enabled=True,\n mongo_db_major_version=\"4.2\",\n provider_name=\"AZURE\",\n provider_disk_type_name=\"P4\",\n provider_instance_size_name=\"M10\",\n opts=pulumi.ResourceOptions(depends_on=[\"mongodbatlas_network_peering.test\"]))\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Mongodbatlas = Pulumi.Mongodbatlas;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Ensure you have created the required Azure service principal first, see\n // see https://docs.atlas.mongodb.com/security-vpc-peering/\n // Container example provided but not always required, \n // see network_container documentation for details. \n var testNetworkContainer = new Mongodbatlas.NetworkContainer(\"testNetworkContainer\", new()\n {\n ProjectId = local.Project_id,\n AtlasCidrBlock = local.ATLAS_CIDR_BLOCK,\n ProviderName = \"AZURE\",\n Region = \"US_EAST_2\",\n });\n\n // Create the peering connection request\n var testNetworkPeering = new Mongodbatlas.NetworkPeering(\"testNetworkPeering\", new()\n {\n ProjectId = local.Project_id,\n ContainerId = testNetworkContainer.ContainerId,\n ProviderName = \"AZURE\",\n AzureDirectoryId = local.AZURE_DIRECTORY_ID,\n AzureSubscriptionId = local.AZURE_SUBSCRIPTION_ID,\n ResourceGroupName = local.AZURE_RESOURCES_GROUP_NAME,\n VnetName = local.AZURE_VNET_NAME,\n });\n\n // Create the cluster once the peering connection is completed\n var testCluster = new Mongodbatlas.Cluster(\"testCluster\", new()\n {\n ProjectId = local.Project_id,\n ClusterType = \"REPLICASET\",\n ReplicationSpecs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecArgs\n {\n NumShards = 1,\n RegionsConfigs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs\n {\n RegionName = \"US_EAST_2\",\n ElectableNodes = 3,\n Priority = 7,\n ReadOnlyNodes = 0,\n },\n },\n },\n },\n AutoScalingDiskGbEnabled = true,\n MongoDbMajorVersion = \"4.2\",\n ProviderName = \"AZURE\",\n ProviderDiskTypeName = \"P4\",\n ProviderInstanceSizeName = \"M10\",\n }, new CustomResourceOptions\n {\n DependsOn = new[]\n {\n \"mongodbatlas_network_peering.test\",\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\ttestNetworkContainer, err := mongodbatlas.NewNetworkContainer(ctx, \"testNetworkContainer\", \u0026mongodbatlas.NetworkContainerArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tAtlasCidrBlock: pulumi.Any(local.ATLAS_CIDR_BLOCK),\n\t\t\tProviderName: pulumi.String(\"AZURE\"),\n\t\t\tRegion: pulumi.String(\"US_EAST_2\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = mongodbatlas.NewNetworkPeering(ctx, \"testNetworkPeering\", \u0026mongodbatlas.NetworkPeeringArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tContainerId: testNetworkContainer.ContainerId,\n\t\t\tProviderName: pulumi.String(\"AZURE\"),\n\t\t\tAzureDirectoryId: pulumi.Any(local.AZURE_DIRECTORY_ID),\n\t\t\tAzureSubscriptionId: pulumi.Any(local.AZURE_SUBSCRIPTION_ID),\n\t\t\tResourceGroupName: pulumi.Any(local.AZURE_RESOURCES_GROUP_NAME),\n\t\t\tVnetName: pulumi.Any(local.AZURE_VNET_NAME),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = mongodbatlas.NewCluster(ctx, \"testCluster\", \u0026mongodbatlas.ClusterArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tClusterType: pulumi.String(\"REPLICASET\"),\n\t\t\tReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{\n\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecArgs{\n\t\t\t\t\tNumShards: pulumi.Int(1),\n\t\t\t\t\tRegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{\n\t\t\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{\n\t\t\t\t\t\t\tRegionName: pulumi.String(\"US_EAST_2\"),\n\t\t\t\t\t\t\tElectableNodes: pulumi.Int(3),\n\t\t\t\t\t\t\tPriority: pulumi.Int(7),\n\t\t\t\t\t\t\tReadOnlyNodes: pulumi.Int(0),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tAutoScalingDiskGbEnabled: pulumi.Bool(true),\n\t\t\tMongoDbMajorVersion: pulumi.String(\"4.2\"),\n\t\t\tProviderName: pulumi.String(\"AZURE\"),\n\t\t\tProviderDiskTypeName: pulumi.String(\"P4\"),\n\t\t\tProviderInstanceSizeName: pulumi.String(\"M10\"),\n\t\t}, pulumi.DependsOn([]pulumi.Resource{\n\t\t\tpulumi.Resource(\"mongodbatlas_network_peering.test\"),\n\t\t}))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mongodbatlas.NetworkContainer;\nimport com.pulumi.mongodbatlas.NetworkContainerArgs;\nimport com.pulumi.mongodbatlas.NetworkPeering;\nimport com.pulumi.mongodbatlas.NetworkPeeringArgs;\nimport com.pulumi.mongodbatlas.Cluster;\nimport com.pulumi.mongodbatlas.ClusterArgs;\nimport com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;\nimport com.pulumi.resources.CustomResourceOptions;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var testNetworkContainer = new NetworkContainer(\"testNetworkContainer\", NetworkContainerArgs.builder() \n .projectId(local.project_id())\n .atlasCidrBlock(local.ATLAS_CIDR_BLOCK())\n .providerName(\"AZURE\")\n .region(\"US_EAST_2\")\n .build());\n\n var testNetworkPeering = new NetworkPeering(\"testNetworkPeering\", NetworkPeeringArgs.builder() \n .projectId(local.project_id())\n .containerId(testNetworkContainer.containerId())\n .providerName(\"AZURE\")\n .azureDirectoryId(local.AZURE_DIRECTORY_ID())\n .azureSubscriptionId(local.AZURE_SUBSCRIPTION_ID())\n .resourceGroupName(local.AZURE_RESOURCES_GROUP_NAME())\n .vnetName(local.AZURE_VNET_NAME())\n .build());\n\n var testCluster = new Cluster(\"testCluster\", ClusterArgs.builder() \n .projectId(local.project_id())\n .clusterType(\"REPLICASET\")\n .replicationSpecs(ClusterReplicationSpecArgs.builder()\n .numShards(1)\n .regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()\n .regionName(\"US_EAST_2\")\n .electableNodes(3)\n .priority(7)\n .readOnlyNodes(0)\n .build())\n .build())\n .autoScalingDiskGbEnabled(true)\n .mongoDbMajorVersion(\"4.2\")\n .providerName(\"AZURE\")\n .providerDiskTypeName(\"P4\")\n .providerInstanceSizeName(\"M10\")\n .build(), CustomResourceOptions.builder()\n .dependsOn(\"mongodbatlas_network_peering.test\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Ensure you have created the required Azure service principal first, see\n # see https://docs.atlas.mongodb.com/security-vpc-peering/\n\n # Container example provided but not always required, \n # see network_container documentation for details.\n testNetworkContainer:\n type: mongodbatlas:NetworkContainer\n properties:\n projectId: ${local.project_id}\n atlasCidrBlock: ${local.ATLAS_CIDR_BLOCK}\n providerName: AZURE\n region: US_EAST_2\n # Create the peering connection request\n testNetworkPeering:\n type: mongodbatlas:NetworkPeering\n properties:\n projectId: ${local.project_id}\n containerId: ${testNetworkContainer.containerId}\n providerName: AZURE\n azureDirectoryId: ${local.AZURE_DIRECTORY_ID}\n azureSubscriptionId: ${local.AZURE_SUBSCRIPTION_ID}\n resourceGroupName: ${local.AZURE_RESOURCES_GROUP_NAME}\n vnetName: ${local.AZURE_VNET_NAME}\n # Create the cluster once the peering connection is completed\n testCluster:\n type: mongodbatlas:Cluster\n properties:\n projectId: ${local.project_id}\n clusterType: REPLICASET\n replicationSpecs:\n - numShards: 1\n regionsConfigs:\n - regionName: US_EAST_2\n electableNodes: 3\n priority: 7\n readOnlyNodes: 0\n autoScalingDiskGbEnabled: true\n mongoDbMajorVersion: '4.2'\n # Provider Settings \"block\"\n providerName: AZURE\n providerDiskTypeName: P4\n providerInstanceSizeName: M10\n options:\n dependson:\n - mongodbatlas_network_peering.test\n```\n{{% /example %}}\n### Peering Connection Only, Container Exists\nYou 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.\n{{% example %}}\n### Example with AWS\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as mongodbatlas from \"@pulumi/mongodbatlas\";\n\n// Create an Atlas cluster, this creates a container if one\n// does not yet exist for this AWS region\nconst test = new mongodbatlas.Cluster(\"test\", {\n projectId: local.project_id,\n clusterType: \"REPLICASET\",\n replicationSpecs: [{\n numShards: 1,\n regionsConfigs: [{\n regionName: \"US_EAST_2\",\n electableNodes: 3,\n priority: 7,\n readOnlyNodes: 0,\n }],\n }],\n autoScalingDiskGbEnabled: false,\n mongoDbMajorVersion: \"4.2\",\n providerName: \"AWS\",\n providerInstanceSizeName: \"M10\",\n});\n// the following assumes an AWS provider is configured\nconst _default = new aws.ec2.DefaultVpc(\"default\", {tags: {\n Name: \"Default VPC\",\n}});\n// Create the peering connection request\nconst mongoPeer = new mongodbatlas.NetworkPeering(\"mongoPeer\", {\n accepterRegionName: \"us-east-2\",\n projectId: local.project_id,\n containerId: test.containerId,\n providerName: \"AWS\",\n routeTableCidrBlock: \"172.31.0.0/16\",\n vpcId: _default.id,\n awsAccountId: local.AWS_ACCOUNT_ID,\n});\n// Accept the connection \nconst awsPeer = new aws.ec2.VpcPeeringConnectionAccepter(\"awsPeer\", {\n vpcPeeringConnectionId: mongoPeer.connectionId,\n autoAccept: true,\n tags: {\n Side: \"Accepter\",\n },\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_mongodbatlas as mongodbatlas\n\n# Create an Atlas cluster, this creates a container if one\n# does not yet exist for this AWS region\ntest = mongodbatlas.Cluster(\"test\",\n project_id=local[\"project_id\"],\n cluster_type=\"REPLICASET\",\n replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(\n num_shards=1,\n regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(\n region_name=\"US_EAST_2\",\n electable_nodes=3,\n priority=7,\n read_only_nodes=0,\n )],\n )],\n auto_scaling_disk_gb_enabled=False,\n mongo_db_major_version=\"4.2\",\n provider_name=\"AWS\",\n provider_instance_size_name=\"M10\")\n# the following assumes an AWS provider is configured\ndefault = aws.ec2.DefaultVpc(\"default\", tags={\n \"Name\": \"Default VPC\",\n})\n# Create the peering connection request\nmongo_peer = mongodbatlas.NetworkPeering(\"mongoPeer\",\n accepter_region_name=\"us-east-2\",\n project_id=local[\"project_id\"],\n container_id=test.container_id,\n provider_name=\"AWS\",\n route_table_cidr_block=\"172.31.0.0/16\",\n vpc_id=default.id,\n aws_account_id=local[\"AWS_ACCOUNT_ID\"])\n# Accept the connection \naws_peer = aws.ec2.VpcPeeringConnectionAccepter(\"awsPeer\",\n vpc_peering_connection_id=mongo_peer.connection_id,\n auto_accept=True,\n tags={\n \"Side\": \"Accepter\",\n })\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Mongodbatlas = Pulumi.Mongodbatlas;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Create an Atlas cluster, this creates a container if one\n // does not yet exist for this AWS region\n var test = new Mongodbatlas.Cluster(\"test\", new()\n {\n ProjectId = local.Project_id,\n ClusterType = \"REPLICASET\",\n ReplicationSpecs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecArgs\n {\n NumShards = 1,\n RegionsConfigs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs\n {\n RegionName = \"US_EAST_2\",\n ElectableNodes = 3,\n Priority = 7,\n ReadOnlyNodes = 0,\n },\n },\n },\n },\n AutoScalingDiskGbEnabled = false,\n MongoDbMajorVersion = \"4.2\",\n ProviderName = \"AWS\",\n ProviderInstanceSizeName = \"M10\",\n });\n\n // the following assumes an AWS provider is configured\n var @default = new Aws.Ec2.DefaultVpc(\"default\", new()\n {\n Tags = \n {\n { \"Name\", \"Default VPC\" },\n },\n });\n\n // Create the peering connection request\n var mongoPeer = new Mongodbatlas.NetworkPeering(\"mongoPeer\", new()\n {\n AccepterRegionName = \"us-east-2\",\n ProjectId = local.Project_id,\n ContainerId = test.ContainerId,\n ProviderName = \"AWS\",\n RouteTableCidrBlock = \"172.31.0.0/16\",\n VpcId = @default.Id,\n AwsAccountId = local.AWS_ACCOUNT_ID,\n });\n\n // Accept the connection \n var awsPeer = new Aws.Ec2.VpcPeeringConnectionAccepter(\"awsPeer\", new()\n {\n VpcPeeringConnectionId = mongoPeer.ConnectionId,\n AutoAccept = true,\n Tags = \n {\n { \"Side\", \"Accepter\" },\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2\"\n\t\"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\ttest, err := mongodbatlas.NewCluster(ctx, \"test\", \u0026mongodbatlas.ClusterArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tClusterType: pulumi.String(\"REPLICASET\"),\n\t\t\tReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{\n\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecArgs{\n\t\t\t\t\tNumShards: pulumi.Int(1),\n\t\t\t\t\tRegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{\n\t\t\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{\n\t\t\t\t\t\t\tRegionName: pulumi.String(\"US_EAST_2\"),\n\t\t\t\t\t\t\tElectableNodes: pulumi.Int(3),\n\t\t\t\t\t\t\tPriority: pulumi.Int(7),\n\t\t\t\t\t\t\tReadOnlyNodes: pulumi.Int(0),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tAutoScalingDiskGbEnabled: pulumi.Bool(false),\n\t\t\tMongoDbMajorVersion: pulumi.String(\"4.2\"),\n\t\t\tProviderName: pulumi.String(\"AWS\"),\n\t\t\tProviderInstanceSizeName: pulumi.String(\"M10\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = ec2.NewDefaultVpc(ctx, \"default\", \u0026ec2.DefaultVpcArgs{\n\t\t\tTags: pulumi.StringMap{\n\t\t\t\t\"Name\": pulumi.String(\"Default VPC\"),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tmongoPeer, err := mongodbatlas.NewNetworkPeering(ctx, \"mongoPeer\", \u0026mongodbatlas.NetworkPeeringArgs{\n\t\t\tAccepterRegionName: pulumi.String(\"us-east-2\"),\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tContainerId: test.ContainerId,\n\t\t\tProviderName: pulumi.String(\"AWS\"),\n\t\t\tRouteTableCidrBlock: pulumi.String(\"172.31.0.0/16\"),\n\t\t\tVpcId: _default.ID(),\n\t\t\tAwsAccountId: pulumi.Any(local.AWS_ACCOUNT_ID),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = ec2.NewVpcPeeringConnectionAccepter(ctx, \"awsPeer\", \u0026ec2.VpcPeeringConnectionAccepterArgs{\n\t\t\tVpcPeeringConnectionId: mongoPeer.ConnectionId,\n\t\t\tAutoAccept: pulumi.Bool(true),\n\t\t\tTags: pulumi.StringMap{\n\t\t\t\t\"Side\": pulumi.String(\"Accepter\"),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mongodbatlas.Cluster;\nimport com.pulumi.mongodbatlas.ClusterArgs;\nimport com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;\nimport com.pulumi.aws.ec2.DefaultVpc;\nimport com.pulumi.aws.ec2.DefaultVpcArgs;\nimport com.pulumi.mongodbatlas.NetworkPeering;\nimport com.pulumi.mongodbatlas.NetworkPeeringArgs;\nimport com.pulumi.aws.ec2.VpcPeeringConnectionAccepter;\nimport com.pulumi.aws.ec2.VpcPeeringConnectionAccepterArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var test = new Cluster(\"test\", ClusterArgs.builder() \n .projectId(local.project_id())\n .clusterType(\"REPLICASET\")\n .replicationSpecs(ClusterReplicationSpecArgs.builder()\n .numShards(1)\n .regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()\n .regionName(\"US_EAST_2\")\n .electableNodes(3)\n .priority(7)\n .readOnlyNodes(0)\n .build())\n .build())\n .autoScalingDiskGbEnabled(false)\n .mongoDbMajorVersion(\"4.2\")\n .providerName(\"AWS\")\n .providerInstanceSizeName(\"M10\")\n .build());\n\n var default_ = new DefaultVpc(\"default\", DefaultVpcArgs.builder() \n .tags(Map.of(\"Name\", \"Default VPC\"))\n .build());\n\n var mongoPeer = new NetworkPeering(\"mongoPeer\", NetworkPeeringArgs.builder() \n .accepterRegionName(\"us-east-2\")\n .projectId(local.project_id())\n .containerId(test.containerId())\n .providerName(\"AWS\")\n .routeTableCidrBlock(\"172.31.0.0/16\")\n .vpcId(default_.id())\n .awsAccountId(local.AWS_ACCOUNT_ID())\n .build());\n\n var awsPeer = new VpcPeeringConnectionAccepter(\"awsPeer\", VpcPeeringConnectionAccepterArgs.builder() \n .vpcPeeringConnectionId(mongoPeer.connectionId())\n .autoAccept(true)\n .tags(Map.of(\"Side\", \"Accepter\"))\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Create an Atlas cluster, this creates a container if one\n # does not yet exist for this AWS region\n test:\n type: mongodbatlas:Cluster\n properties:\n projectId: ${local.project_id}\n clusterType: REPLICASET\n replicationSpecs:\n - numShards: 1\n regionsConfigs:\n - regionName: US_EAST_2\n electableNodes: 3\n priority: 7\n readOnlyNodes: 0\n autoScalingDiskGbEnabled: false\n mongoDbMajorVersion: '4.2'\n # Provider Settings \"block\"\n providerName: AWS\n providerInstanceSizeName: M10\n # the following assumes an AWS provider is configured\n default:\n type: aws:ec2:DefaultVpc\n properties:\n tags:\n Name: Default VPC\n # Create the peering connection request\n mongoPeer:\n type: mongodbatlas:NetworkPeering\n properties:\n accepterRegionName: us-east-2\n projectId: ${local.project_id}\n containerId: ${test.containerId}\n providerName: AWS\n routeTableCidrBlock: 172.31.0.0/16\n vpcId: ${default.id}\n awsAccountId: ${local.AWS_ACCOUNT_ID}\n # Accept the connection\n awsPeer:\n type: aws:ec2:VpcPeeringConnectionAccepter\n properties:\n vpcPeeringConnectionId: ${mongoPeer.connectionId}\n autoAccept: true\n tags:\n Side: Accepter\n```\n{{% /example %}}\n{{% example %}}\n### Example with GCP\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as gcp from \"@pulumi/gcp\";\nimport * as mongodbatlas from \"@pulumi/mongodbatlas\";\n\n// Create an Atlas cluster, this creates a container if one\n// does not yet exist for this GCP \nconst testCluster = new mongodbatlas.Cluster(\"testCluster\", {\n projectId: local.project_id,\n clusterType: \"REPLICASET\",\n replicationSpecs: [{\n numShards: 1,\n regionsConfigs: [{\n regionName: \"US_EAST_2\",\n electableNodes: 3,\n priority: 7,\n readOnlyNodes: 0,\n }],\n }],\n autoScalingDiskGbEnabled: true,\n mongoDbMajorVersion: \"4.2\",\n providerName: \"GCP\",\n providerInstanceSizeName: \"M10\",\n});\n// Create the peering connection request\nconst testNetworkPeering = new mongodbatlas.NetworkPeering(\"testNetworkPeering\", {\n projectId: local.project_id,\n atlasCidrBlock: \"192.168.0.0/18\",\n containerId: testCluster.containerId,\n providerName: \"GCP\",\n gcpProjectId: local.GCP_PROJECT_ID,\n networkName: \"default\",\n});\nconst default = gcp.compute.getNetwork({\n name: \"default\",\n});\n// Create the GCP peer\nconst peering = new gcp.compute.NetworkPeering(\"peering\", {\n network: _default.then(_default =\u003e _default.selfLink),\n peerNetwork: pulumi.interpolate`https://www.googleapis.com/compute/v1/projects/${testNetworkPeering.atlasGcpProjectId}/global/networks/${testNetworkPeering.atlasVpcName}`,\n});\n```\n```python\nimport pulumi\nimport pulumi_gcp as gcp\nimport pulumi_mongodbatlas as mongodbatlas\n\n# Create an Atlas cluster, this creates a container if one\n# does not yet exist for this GCP \ntest_cluster = mongodbatlas.Cluster(\"testCluster\",\n project_id=local[\"project_id\"],\n cluster_type=\"REPLICASET\",\n replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(\n num_shards=1,\n regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(\n region_name=\"US_EAST_2\",\n electable_nodes=3,\n priority=7,\n read_only_nodes=0,\n )],\n )],\n auto_scaling_disk_gb_enabled=True,\n mongo_db_major_version=\"4.2\",\n provider_name=\"GCP\",\n provider_instance_size_name=\"M10\")\n# Create the peering connection request\ntest_network_peering = mongodbatlas.NetworkPeering(\"testNetworkPeering\",\n project_id=local[\"project_id\"],\n atlas_cidr_block=\"192.168.0.0/18\",\n container_id=test_cluster.container_id,\n provider_name=\"GCP\",\n gcp_project_id=local[\"GCP_PROJECT_ID\"],\n network_name=\"default\")\ndefault = gcp.compute.get_network(name=\"default\")\n# Create the GCP peer\npeering = gcp.compute.NetworkPeering(\"peering\",\n network=default.self_link,\n 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}\"))\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Gcp = Pulumi.Gcp;\nusing Mongodbatlas = Pulumi.Mongodbatlas;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Create an Atlas cluster, this creates a container if one\n // does not yet exist for this GCP \n var testCluster = new Mongodbatlas.Cluster(\"testCluster\", new()\n {\n ProjectId = local.Project_id,\n ClusterType = \"REPLICASET\",\n ReplicationSpecs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecArgs\n {\n NumShards = 1,\n RegionsConfigs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs\n {\n RegionName = \"US_EAST_2\",\n ElectableNodes = 3,\n Priority = 7,\n ReadOnlyNodes = 0,\n },\n },\n },\n },\n AutoScalingDiskGbEnabled = true,\n MongoDbMajorVersion = \"4.2\",\n ProviderName = \"GCP\",\n ProviderInstanceSizeName = \"M10\",\n });\n\n // Create the peering connection request\n var testNetworkPeering = new Mongodbatlas.NetworkPeering(\"testNetworkPeering\", new()\n {\n ProjectId = local.Project_id,\n AtlasCidrBlock = \"192.168.0.0/18\",\n ContainerId = testCluster.ContainerId,\n ProviderName = \"GCP\",\n GcpProjectId = local.GCP_PROJECT_ID,\n NetworkName = \"default\",\n });\n\n var @default = Gcp.Compute.GetNetwork.Invoke(new()\n {\n Name = \"default\",\n });\n\n // Create the GCP peer\n var peering = new Gcp.Compute.NetworkPeering(\"peering\", new()\n {\n Network = @default.Apply(@default =\u003e @default.Apply(getNetworkResult =\u003e getNetworkResult.SelfLink)),\n PeerNetwork = Output.Tuple(testNetworkPeering.AtlasGcpProjectId, testNetworkPeering.AtlasVpcName).Apply(values =\u003e\n {\n var atlasGcpProjectId = values.Item1;\n var atlasVpcName = values.Item2;\n return $\"https://www.googleapis.com/compute/v1/projects/{atlasGcpProjectId}/global/networks/{atlasVpcName}\";\n }),\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-gcp/sdk/v5/go/gcp/compute\"\n\t\"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\ttestCluster, err := mongodbatlas.NewCluster(ctx, \"testCluster\", \u0026mongodbatlas.ClusterArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tClusterType: pulumi.String(\"REPLICASET\"),\n\t\t\tReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{\n\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecArgs{\n\t\t\t\t\tNumShards: pulumi.Int(1),\n\t\t\t\t\tRegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{\n\t\t\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{\n\t\t\t\t\t\t\tRegionName: pulumi.String(\"US_EAST_2\"),\n\t\t\t\t\t\t\tElectableNodes: pulumi.Int(3),\n\t\t\t\t\t\t\tPriority: pulumi.Int(7),\n\t\t\t\t\t\t\tReadOnlyNodes: pulumi.Int(0),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tAutoScalingDiskGbEnabled: pulumi.Bool(true),\n\t\t\tMongoDbMajorVersion: pulumi.String(\"4.2\"),\n\t\t\tProviderName: pulumi.String(\"GCP\"),\n\t\t\tProviderInstanceSizeName: pulumi.String(\"M10\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttestNetworkPeering, err := mongodbatlas.NewNetworkPeering(ctx, \"testNetworkPeering\", \u0026mongodbatlas.NetworkPeeringArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tAtlasCidrBlock: pulumi.String(\"192.168.0.0/18\"),\n\t\t\tContainerId: testCluster.ContainerId,\n\t\t\tProviderName: pulumi.String(\"GCP\"),\n\t\t\tGcpProjectId: pulumi.Any(local.GCP_PROJECT_ID),\n\t\t\tNetworkName: pulumi.String(\"default\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_default, err := compute.LookupNetwork(ctx, \u0026compute.LookupNetworkArgs{\n\t\t\tName: \"default\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = compute.NewNetworkPeering(ctx, \"peering\", \u0026compute.NetworkPeeringArgs{\n\t\t\tNetwork: *pulumi.String(_default.SelfLink),\n\t\t\tPeerNetwork: pulumi.All(testNetworkPeering.AtlasGcpProjectId, testNetworkPeering.AtlasVpcName).ApplyT(func(_args []interface{}) (string, error) {\n\t\t\t\tatlasGcpProjectId := _args[0].(string)\n\t\t\t\tatlasVpcName := _args[1].(string)\n\t\t\t\treturn fmt.Sprintf(\"https://www.googleapis.com/compute/v1/projects/%v/global/networks/%v\", atlasGcpProjectId, atlasVpcName), nil\n\t\t\t}).(pulumi.StringOutput),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mongodbatlas.Cluster;\nimport com.pulumi.mongodbatlas.ClusterArgs;\nimport com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;\nimport com.pulumi.mongodbatlas.NetworkPeering;\nimport com.pulumi.mongodbatlas.NetworkPeeringArgs;\nimport com.pulumi.gcp.compute.ComputeFunctions;\nimport com.pulumi.gcp.compute.inputs.GetNetworkArgs;\nimport com.pulumi.gcp.compute.NetworkPeering;\nimport com.pulumi.gcp.compute.NetworkPeeringArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var testCluster = new Cluster(\"testCluster\", ClusterArgs.builder() \n .projectId(local.project_id())\n .clusterType(\"REPLICASET\")\n .replicationSpecs(ClusterReplicationSpecArgs.builder()\n .numShards(1)\n .regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()\n .regionName(\"US_EAST_2\")\n .electableNodes(3)\n .priority(7)\n .readOnlyNodes(0)\n .build())\n .build())\n .autoScalingDiskGbEnabled(true)\n .mongoDbMajorVersion(\"4.2\")\n .providerName(\"GCP\")\n .providerInstanceSizeName(\"M10\")\n .build());\n\n var testNetworkPeering = new NetworkPeering(\"testNetworkPeering\", NetworkPeeringArgs.builder() \n .projectId(local.project_id())\n .atlasCidrBlock(\"192.168.0.0/18\")\n .containerId(testCluster.containerId())\n .providerName(\"GCP\")\n .gcpProjectId(local.GCP_PROJECT_ID())\n .networkName(\"default\")\n .build());\n\n final var default = ComputeFunctions.getNetwork(GetNetworkArgs.builder()\n .name(\"default\")\n .build());\n\n var peering = new NetworkPeering(\"peering\", NetworkPeeringArgs.builder() \n .network(default_.selfLink())\n .peerNetwork(Output.tuple(testNetworkPeering.atlasGcpProjectId(), testNetworkPeering.atlasVpcName()).applyValue(values -\u003e {\n var atlasGcpProjectId = values.t1;\n var atlasVpcName = values.t2;\n return String.format(\"https://www.googleapis.com/compute/v1/projects/%s/global/networks/%s\", atlasGcpProjectId,atlasVpcName);\n }))\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Create an Atlas cluster, this creates a container if one\n # does not yet exist for this GCP\n testCluster:\n type: mongodbatlas:Cluster\n properties:\n projectId: ${local.project_id}\n clusterType: REPLICASET\n replicationSpecs:\n - numShards: 1\n regionsConfigs:\n - regionName: US_EAST_2\n electableNodes: 3\n priority: 7\n readOnlyNodes: 0\n autoScalingDiskGbEnabled: true\n mongoDbMajorVersion: '4.2'\n # Provider Settings \"block\"\n providerName: GCP\n providerInstanceSizeName: M10\n # Create the peering connection request\n testNetworkPeering:\n type: mongodbatlas:NetworkPeering\n properties:\n projectId: ${local.project_id}\n atlasCidrBlock: 192.168.0.0/18\n containerId: ${testCluster.containerId}\n providerName: GCP\n gcpProjectId: ${local.GCP_PROJECT_ID}\n networkName: default\n # Create the GCP peer\n peering:\n type: gcp:compute:NetworkPeering\n properties:\n network: ${default.selfLink}\n peerNetwork: https://www.googleapis.com/compute/v1/projects/${testNetworkPeering.atlasGcpProjectId}/global/networks/${testNetworkPeering.atlasVpcName}\nvariables:\n default:\n fn::invoke:\n Function: gcp:compute:getNetwork\n Arguments:\n name: default\n```\n{{% /example %}}\n{{% example %}}\n### Example with Azure\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as mongodbatlas from \"@pulumi/mongodbatlas\";\n\n// Ensure you have created the required Azure service principal first, see\n// see https://docs.atlas.mongodb.com/security-vpc-peering/\n// Create an Atlas cluster, this creates a container if one\n// does not yet exist for this AZURE region\nconst testCluster = new mongodbatlas.Cluster(\"testCluster\", {\n projectId: local.project_id,\n clusterType: \"REPLICASET\",\n replicationSpecs: [{\n numShards: 1,\n regionsConfigs: [{\n regionName: \"US_EAST_2\",\n electableNodes: 3,\n priority: 7,\n readOnlyNodes: 0,\n }],\n }],\n autoScalingDiskGbEnabled: false,\n mongoDbMajorVersion: \"4.2\",\n providerName: \"AZURE\",\n providerInstanceSizeName: \"M10\",\n});\n// Create the peering connection request\nconst testNetworkPeering = new mongodbatlas.NetworkPeering(\"testNetworkPeering\", {\n projectId: local.project_id,\n containerId: testCluster.containerId,\n providerName: \"AZURE\",\n azureDirectoryId: local.AZURE_DIRECTORY_ID,\n azureSubscriptionId: local.AZURE_SUBSCRIPTION_ID,\n resourceGroupName: local.AZURE_RESOURCE_GROUP_NAME,\n vnetName: local.AZURE_VNET_NAME,\n});\n```\n```python\nimport pulumi\nimport pulumi_mongodbatlas as mongodbatlas\n\n# Ensure you have created the required Azure service principal first, see\n# see https://docs.atlas.mongodb.com/security-vpc-peering/\n# Create an Atlas cluster, this creates a container if one\n# does not yet exist for this AZURE region\ntest_cluster = mongodbatlas.Cluster(\"testCluster\",\n project_id=local[\"project_id\"],\n cluster_type=\"REPLICASET\",\n replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(\n num_shards=1,\n regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(\n region_name=\"US_EAST_2\",\n electable_nodes=3,\n priority=7,\n read_only_nodes=0,\n )],\n )],\n auto_scaling_disk_gb_enabled=False,\n mongo_db_major_version=\"4.2\",\n provider_name=\"AZURE\",\n provider_instance_size_name=\"M10\")\n# Create the peering connection request\ntest_network_peering = mongodbatlas.NetworkPeering(\"testNetworkPeering\",\n project_id=local[\"project_id\"],\n container_id=test_cluster.container_id,\n provider_name=\"AZURE\",\n azure_directory_id=local[\"AZURE_DIRECTORY_ID\"],\n azure_subscription_id=local[\"AZURE_SUBSCRIPTION_ID\"],\n resource_group_name=local[\"AZURE_RESOURCE_GROUP_NAME\"],\n vnet_name=local[\"AZURE_VNET_NAME\"])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Mongodbatlas = Pulumi.Mongodbatlas;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Ensure you have created the required Azure service principal first, see\n // see https://docs.atlas.mongodb.com/security-vpc-peering/\n // Create an Atlas cluster, this creates a container if one\n // does not yet exist for this AZURE region\n var testCluster = new Mongodbatlas.Cluster(\"testCluster\", new()\n {\n ProjectId = local.Project_id,\n ClusterType = \"REPLICASET\",\n ReplicationSpecs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecArgs\n {\n NumShards = 1,\n RegionsConfigs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs\n {\n RegionName = \"US_EAST_2\",\n ElectableNodes = 3,\n Priority = 7,\n ReadOnlyNodes = 0,\n },\n },\n },\n },\n AutoScalingDiskGbEnabled = false,\n MongoDbMajorVersion = \"4.2\",\n ProviderName = \"AZURE\",\n ProviderInstanceSizeName = \"M10\",\n });\n\n // Create the peering connection request\n var testNetworkPeering = new Mongodbatlas.NetworkPeering(\"testNetworkPeering\", new()\n {\n ProjectId = local.Project_id,\n ContainerId = testCluster.ContainerId,\n ProviderName = \"AZURE\",\n AzureDirectoryId = local.AZURE_DIRECTORY_ID,\n AzureSubscriptionId = local.AZURE_SUBSCRIPTION_ID,\n ResourceGroupName = local.AZURE_RESOURCE_GROUP_NAME,\n VnetName = local.AZURE_VNET_NAME,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\ttestCluster, err := mongodbatlas.NewCluster(ctx, \"testCluster\", \u0026mongodbatlas.ClusterArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tClusterType: pulumi.String(\"REPLICASET\"),\n\t\t\tReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{\n\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecArgs{\n\t\t\t\t\tNumShards: pulumi.Int(1),\n\t\t\t\t\tRegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{\n\t\t\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{\n\t\t\t\t\t\t\tRegionName: pulumi.String(\"US_EAST_2\"),\n\t\t\t\t\t\t\tElectableNodes: pulumi.Int(3),\n\t\t\t\t\t\t\tPriority: pulumi.Int(7),\n\t\t\t\t\t\t\tReadOnlyNodes: pulumi.Int(0),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tAutoScalingDiskGbEnabled: pulumi.Bool(false),\n\t\t\tMongoDbMajorVersion: pulumi.String(\"4.2\"),\n\t\t\tProviderName: pulumi.String(\"AZURE\"),\n\t\t\tProviderInstanceSizeName: pulumi.String(\"M10\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = mongodbatlas.NewNetworkPeering(ctx, \"testNetworkPeering\", \u0026mongodbatlas.NetworkPeeringArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tContainerId: testCluster.ContainerId,\n\t\t\tProviderName: pulumi.String(\"AZURE\"),\n\t\t\tAzureDirectoryId: pulumi.Any(local.AZURE_DIRECTORY_ID),\n\t\t\tAzureSubscriptionId: pulumi.Any(local.AZURE_SUBSCRIPTION_ID),\n\t\t\tResourceGroupName: pulumi.Any(local.AZURE_RESOURCE_GROUP_NAME),\n\t\t\tVnetName: pulumi.Any(local.AZURE_VNET_NAME),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mongodbatlas.Cluster;\nimport com.pulumi.mongodbatlas.ClusterArgs;\nimport com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;\nimport com.pulumi.mongodbatlas.NetworkPeering;\nimport com.pulumi.mongodbatlas.NetworkPeeringArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var testCluster = new Cluster(\"testCluster\", ClusterArgs.builder() \n .projectId(local.project_id())\n .clusterType(\"REPLICASET\")\n .replicationSpecs(ClusterReplicationSpecArgs.builder()\n .numShards(1)\n .regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()\n .regionName(\"US_EAST_2\")\n .electableNodes(3)\n .priority(7)\n .readOnlyNodes(0)\n .build())\n .build())\n .autoScalingDiskGbEnabled(false)\n .mongoDbMajorVersion(\"4.2\")\n .providerName(\"AZURE\")\n .providerInstanceSizeName(\"M10\")\n .build());\n\n var testNetworkPeering = new NetworkPeering(\"testNetworkPeering\", NetworkPeeringArgs.builder() \n .projectId(local.project_id())\n .containerId(testCluster.containerId())\n .providerName(\"AZURE\")\n .azureDirectoryId(local.AZURE_DIRECTORY_ID())\n .azureSubscriptionId(local.AZURE_SUBSCRIPTION_ID())\n .resourceGroupName(local.AZURE_RESOURCE_GROUP_NAME())\n .vnetName(local.AZURE_VNET_NAME())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Ensure you have created the required Azure service principal first, see\n # see https://docs.atlas.mongodb.com/security-vpc-peering/\n\n # Create an Atlas cluster, this creates a container if one\n # does not yet exist for this AZURE region\n testCluster:\n type: mongodbatlas:Cluster\n properties:\n projectId: ${local.project_id}\n clusterType: REPLICASET\n replicationSpecs:\n - numShards: 1\n regionsConfigs:\n - regionName: US_EAST_2\n electableNodes: 3\n priority: 7\n readOnlyNodes: 0\n autoScalingDiskGbEnabled: false\n mongoDbMajorVersion: '4.2'\n # Provider Settings \"block\"\n providerName: AZURE\n providerInstanceSizeName: M10\n # Create the peering connection request\n testNetworkPeering:\n type: mongodbatlas:NetworkPeering\n properties:\n projectId: ${local.project_id}\n containerId: ${testCluster.containerId}\n providerName: AZURE\n azureDirectoryId: ${local.AZURE_DIRECTORY_ID}\n azureSubscriptionId: ${local.AZURE_SUBSCRIPTION_ID}\n resourceGroupName: ${local.AZURE_RESOURCE_GROUP_NAME}\n vnetName: ${local.AZURE_VNET_NAME}\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\nNetwork Peering Connections can be imported using project ID and network peering id, in the format `PROJECTID-PEERID-PROVIDERNAME`, e.g.\n\n```sh\n $ pulumi import mongodbatlas:index/networkPeering:NetworkPeering my_peering 1112222b3bf99403840e8934-5cbf563d87d9d67253be590a-AWS\n```\n See detailed information for arguments and attributes: [MongoDB API Network Peering Connection](https://docs.atlas.mongodb.com/reference/api/vpc-create-peering-connection/)\n\n-\u003e __NOTE:__ If you need to get an existing container ID see the How-To Guide.\n\n", + "description": "`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. \n\nEnsure 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.\n\n\u003e **GCP AND AZURE ONLY:** Connect via Peering Only mode is deprecated, so no longer needed. See [disable Peering Only mode](https://docs.atlas.mongodb.com/reference/faq/connection-changes/#disable-peering-mode) for details\n\n\u003e **AZURE ONLY:** To create the peering request with an Azure VNET, you must grant Atlas the following permissions on the virtual network.\n Microsoft.Network/virtualNetworks/virtualNetworkPeerings/read\n Microsoft.Network/virtualNetworks/virtualNetworkPeerings/write\n Microsoft.Network/virtualNetworks/virtualNetworkPeerings/delete\n Microsoft.Network/virtualNetworks/peer/action\nFor more information see https://docs.atlas.mongodb.com/security-vpc-peering/ and https://docs.atlas.mongodb.com/reference/api/vpc-create-peering-connection/\n\n\u003e **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.\n\n\u003e **NOTE:** Groups and projects are synonymous terms. You may find **group_id** in the official documentation.\n\n\n{{% examples %}}\n## Example Usage\n\n### Container \u0026 Peering Connection\n{{% example %}}\n### Example with AWS\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as mongodbatlas from \"@pulumi/mongodbatlas\";\n\n// Container example provided but not always required, \n// see network_container documentation for details. \nconst testNetworkContainer = new mongodbatlas.NetworkContainer(\"testNetworkContainer\", {\n projectId: local.project_id,\n atlasCidrBlock: \"10.8.0.0/21\",\n providerName: \"AWS\",\n regionName: \"US_EAST_1\",\n});\n// Create the peering connection request\nconst testNetworkPeering = new mongodbatlas.NetworkPeering(\"testNetworkPeering\", {\n accepterRegionName: \"us-east-1\",\n projectId: local.project_id,\n containerId: \"507f1f77bcf86cd799439011\",\n providerName: \"AWS\",\n routeTableCidrBlock: \"192.168.0.0/24\",\n vpcId: \"vpc-abc123abc123\",\n awsAccountId: \"abc123abc123\",\n});\n// the following assumes an AWS provider is configured\n// Accept the peering connection request\nconst peer = new aws.ec2.VpcPeeringConnectionAccepter(\"peer\", {\n vpcPeeringConnectionId: testNetworkPeering.connectionId,\n autoAccept: true,\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_mongodbatlas as mongodbatlas\n\n# Container example provided but not always required, \n# see network_container documentation for details. \ntest_network_container = mongodbatlas.NetworkContainer(\"testNetworkContainer\",\n project_id=local[\"project_id\"],\n atlas_cidr_block=\"10.8.0.0/21\",\n provider_name=\"AWS\",\n region_name=\"US_EAST_1\")\n# Create the peering connection request\ntest_network_peering = mongodbatlas.NetworkPeering(\"testNetworkPeering\",\n accepter_region_name=\"us-east-1\",\n project_id=local[\"project_id\"],\n container_id=\"507f1f77bcf86cd799439011\",\n provider_name=\"AWS\",\n route_table_cidr_block=\"192.168.0.0/24\",\n vpc_id=\"vpc-abc123abc123\",\n aws_account_id=\"abc123abc123\")\n# the following assumes an AWS provider is configured\n# Accept the peering connection request\npeer = aws.ec2.VpcPeeringConnectionAccepter(\"peer\",\n vpc_peering_connection_id=test_network_peering.connection_id,\n auto_accept=True)\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Mongodbatlas = Pulumi.Mongodbatlas;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Container example provided but not always required, \n // see network_container documentation for details. \n var testNetworkContainer = new Mongodbatlas.NetworkContainer(\"testNetworkContainer\", new()\n {\n ProjectId = local.Project_id,\n AtlasCidrBlock = \"10.8.0.0/21\",\n ProviderName = \"AWS\",\n RegionName = \"US_EAST_1\",\n });\n\n // Create the peering connection request\n var testNetworkPeering = new Mongodbatlas.NetworkPeering(\"testNetworkPeering\", new()\n {\n AccepterRegionName = \"us-east-1\",\n ProjectId = local.Project_id,\n ContainerId = \"507f1f77bcf86cd799439011\",\n ProviderName = \"AWS\",\n RouteTableCidrBlock = \"192.168.0.0/24\",\n VpcId = \"vpc-abc123abc123\",\n AwsAccountId = \"abc123abc123\",\n });\n\n // the following assumes an AWS provider is configured\n // Accept the peering connection request\n var peer = new Aws.Ec2.VpcPeeringConnectionAccepter(\"peer\", new()\n {\n VpcPeeringConnectionId = testNetworkPeering.ConnectionId,\n AutoAccept = true,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2\"\n\t\"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// Container example provided but not always required,\n\t\t// see network_container documentation for details.\n\t\t_, err := mongodbatlas.NewNetworkContainer(ctx, \"testNetworkContainer\", \u0026mongodbatlas.NetworkContainerArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tAtlasCidrBlock: pulumi.String(\"10.8.0.0/21\"),\n\t\t\tProviderName: pulumi.String(\"AWS\"),\n\t\t\tRegionName: pulumi.String(\"US_EAST_1\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Create the peering connection request\n\t\ttestNetworkPeering, err := mongodbatlas.NewNetworkPeering(ctx, \"testNetworkPeering\", \u0026mongodbatlas.NetworkPeeringArgs{\n\t\t\tAccepterRegionName: pulumi.String(\"us-east-1\"),\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tContainerId: pulumi.String(\"507f1f77bcf86cd799439011\"),\n\t\t\tProviderName: pulumi.String(\"AWS\"),\n\t\t\tRouteTableCidrBlock: pulumi.String(\"192.168.0.0/24\"),\n\t\t\tVpcId: pulumi.String(\"vpc-abc123abc123\"),\n\t\t\tAwsAccountId: pulumi.String(\"abc123abc123\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// the following assumes an AWS provider is configured\n\t\t// Accept the peering connection request\n\t\t_, err = ec2.NewVpcPeeringConnectionAccepter(ctx, \"peer\", \u0026ec2.VpcPeeringConnectionAccepterArgs{\n\t\t\tVpcPeeringConnectionId: testNetworkPeering.ConnectionId,\n\t\t\tAutoAccept: pulumi.Bool(true),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mongodbatlas.NetworkContainer;\nimport com.pulumi.mongodbatlas.NetworkContainerArgs;\nimport com.pulumi.mongodbatlas.NetworkPeering;\nimport com.pulumi.mongodbatlas.NetworkPeeringArgs;\nimport com.pulumi.aws.ec2.VpcPeeringConnectionAccepter;\nimport com.pulumi.aws.ec2.VpcPeeringConnectionAccepterArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var testNetworkContainer = new NetworkContainer(\"testNetworkContainer\", NetworkContainerArgs.builder() \n .projectId(local.project_id())\n .atlasCidrBlock(\"10.8.0.0/21\")\n .providerName(\"AWS\")\n .regionName(\"US_EAST_1\")\n .build());\n\n var testNetworkPeering = new NetworkPeering(\"testNetworkPeering\", NetworkPeeringArgs.builder() \n .accepterRegionName(\"us-east-1\")\n .projectId(local.project_id())\n .containerId(\"507f1f77bcf86cd799439011\")\n .providerName(\"AWS\")\n .routeTableCidrBlock(\"192.168.0.0/24\")\n .vpcId(\"vpc-abc123abc123\")\n .awsAccountId(\"abc123abc123\")\n .build());\n\n var peer = new VpcPeeringConnectionAccepter(\"peer\", VpcPeeringConnectionAccepterArgs.builder() \n .vpcPeeringConnectionId(testNetworkPeering.connectionId())\n .autoAccept(true)\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Container example provided but not always required, \n # see network_container documentation for details.\n testNetworkContainer:\n type: mongodbatlas:NetworkContainer\n properties:\n projectId: ${local.project_id}\n atlasCidrBlock: 10.8.0.0/21\n providerName: AWS\n regionName: US_EAST_1\n # Create the peering connection request\n testNetworkPeering:\n type: mongodbatlas:NetworkPeering\n properties:\n accepterRegionName: us-east-1\n projectId: ${local.project_id}\n containerId: 507f1f77bcf86cd799439011\n providerName: AWS\n routeTableCidrBlock: 192.168.0.0/24\n vpcId: vpc-abc123abc123\n awsAccountId: abc123abc123\n # the following assumes an AWS provider is configured\n # Accept the peering connection request\n peer:\n type: aws:ec2:VpcPeeringConnectionAccepter\n properties:\n vpcPeeringConnectionId: ${testNetworkPeering.connectionId}\n autoAccept: true\n```\n{{% /example %}}\n{{% example %}}\n### Example with GCP\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as gcp from \"@pulumi/gcp\";\nimport * as mongodbatlas from \"@pulumi/mongodbatlas\";\n\n// Container example provided but not always required, \n// see network_container documentation for details. \nconst testNetworkContainer = new mongodbatlas.NetworkContainer(\"testNetworkContainer\", {\n projectId: local.project_id,\n atlasCidrBlock: \"10.8.0.0/21\",\n providerName: \"GCP\",\n});\n// Create the peering connection request\nconst testNetworkPeering = new mongodbatlas.NetworkPeering(\"testNetworkPeering\", {\n projectId: local.project_id,\n containerId: testNetworkContainer.containerId,\n providerName: \"GCP\",\n gcpProjectId: local.GCP_PROJECT_ID,\n networkName: \"default\",\n});\nconst default = gcp.compute.getNetwork({\n name: \"default\",\n});\n// Create the GCP peer\nconst peering = new gcp.compute.NetworkPeering(\"peering\", {\n network: _default.then(_default =\u003e _default.selfLink),\n peerNetwork: pulumi.interpolate`https://www.googleapis.com/compute/v1/projects/${testNetworkPeering.atlasGcpProjectId}/global/networks/${testNetworkPeering.atlasVpcName}`,\n});\n// Create the cluster once the peering connection is completed\nconst testCluster = new mongodbatlas.Cluster(\"testCluster\", {\n projectId: local.project_id,\n numShards: 1,\n clusterType: \"REPLICASET\",\n replicationSpecs: [{\n numShards: 1,\n regionsConfigs: [{\n regionName: \"US_EAST_4\",\n electableNodes: 3,\n priority: 7,\n readOnlyNodes: 0,\n }],\n }],\n autoScalingDiskGbEnabled: true,\n mongoDbMajorVersion: \"4.2\",\n providerName: \"GCP\",\n providerInstanceSizeName: \"M10\",\n}, {\n dependsOn: [\"google_compute_network_peering.peering\"],\n});\n```\n```python\nimport pulumi\nimport pulumi_gcp as gcp\nimport pulumi_mongodbatlas as mongodbatlas\n\n# Container example provided but not always required, \n# see network_container documentation for details. \ntest_network_container = mongodbatlas.NetworkContainer(\"testNetworkContainer\",\n project_id=local[\"project_id\"],\n atlas_cidr_block=\"10.8.0.0/21\",\n provider_name=\"GCP\")\n# Create the peering connection request\ntest_network_peering = mongodbatlas.NetworkPeering(\"testNetworkPeering\",\n project_id=local[\"project_id\"],\n container_id=test_network_container.container_id,\n provider_name=\"GCP\",\n gcp_project_id=local[\"GCP_PROJECT_ID\"],\n network_name=\"default\")\ndefault = gcp.compute.get_network(name=\"default\")\n# Create the GCP peer\npeering = gcp.compute.NetworkPeering(\"peering\",\n network=default.self_link,\n 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}\"))\n# Create the cluster once the peering connection is completed\ntest_cluster = mongodbatlas.Cluster(\"testCluster\",\n project_id=local[\"project_id\"],\n num_shards=1,\n cluster_type=\"REPLICASET\",\n replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(\n num_shards=1,\n regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(\n region_name=\"US_EAST_4\",\n electable_nodes=3,\n priority=7,\n read_only_nodes=0,\n )],\n )],\n auto_scaling_disk_gb_enabled=True,\n mongo_db_major_version=\"4.2\",\n provider_name=\"GCP\",\n provider_instance_size_name=\"M10\",\n opts=pulumi.ResourceOptions(depends_on=[\"google_compute_network_peering.peering\"]))\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Gcp = Pulumi.Gcp;\nusing Mongodbatlas = Pulumi.Mongodbatlas;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Container example provided but not always required, \n // see network_container documentation for details. \n var testNetworkContainer = new Mongodbatlas.NetworkContainer(\"testNetworkContainer\", new()\n {\n ProjectId = local.Project_id,\n AtlasCidrBlock = \"10.8.0.0/21\",\n ProviderName = \"GCP\",\n });\n\n // Create the peering connection request\n var testNetworkPeering = new Mongodbatlas.NetworkPeering(\"testNetworkPeering\", new()\n {\n ProjectId = local.Project_id,\n ContainerId = testNetworkContainer.ContainerId,\n ProviderName = \"GCP\",\n GcpProjectId = local.GCP_PROJECT_ID,\n NetworkName = \"default\",\n });\n\n var @default = Gcp.Compute.GetNetwork.Invoke(new()\n {\n Name = \"default\",\n });\n\n // Create the GCP peer\n var peering = new Gcp.Compute.NetworkPeering(\"peering\", new()\n {\n Network = @default.Apply(@default =\u003e @default.Apply(getNetworkResult =\u003e getNetworkResult.SelfLink)),\n PeerNetwork = Output.Tuple(testNetworkPeering.AtlasGcpProjectId, testNetworkPeering.AtlasVpcName).Apply(values =\u003e\n {\n var atlasGcpProjectId = values.Item1;\n var atlasVpcName = values.Item2;\n return $\"https://www.googleapis.com/compute/v1/projects/{atlasGcpProjectId}/global/networks/{atlasVpcName}\";\n }),\n });\n\n // Create the cluster once the peering connection is completed\n var testCluster = new Mongodbatlas.Cluster(\"testCluster\", new()\n {\n ProjectId = local.Project_id,\n NumShards = 1,\n ClusterType = \"REPLICASET\",\n ReplicationSpecs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecArgs\n {\n NumShards = 1,\n RegionsConfigs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs\n {\n RegionName = \"US_EAST_4\",\n ElectableNodes = 3,\n Priority = 7,\n ReadOnlyNodes = 0,\n },\n },\n },\n },\n AutoScalingDiskGbEnabled = true,\n MongoDbMajorVersion = \"4.2\",\n ProviderName = \"GCP\",\n ProviderInstanceSizeName = \"M10\",\n }, new CustomResourceOptions\n {\n DependsOn = new[]\n {\n \"google_compute_network_peering.peering\",\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-gcp/sdk/v5/go/gcp/compute\"\n\t\"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// Container example provided but not always required,\n\t\t// see network_container documentation for details.\n\t\ttestNetworkContainer, err := mongodbatlas.NewNetworkContainer(ctx, \"testNetworkContainer\", \u0026mongodbatlas.NetworkContainerArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tAtlasCidrBlock: pulumi.String(\"10.8.0.0/21\"),\n\t\t\tProviderName: pulumi.String(\"GCP\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Create the peering connection request\n\t\ttestNetworkPeering, err := mongodbatlas.NewNetworkPeering(ctx, \"testNetworkPeering\", \u0026mongodbatlas.NetworkPeeringArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tContainerId: testNetworkContainer.ContainerId,\n\t\t\tProviderName: pulumi.String(\"GCP\"),\n\t\t\tGcpProjectId: pulumi.Any(local.GCP_PROJECT_ID),\n\t\t\tNetworkName: pulumi.String(\"default\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_default, err := compute.LookupNetwork(ctx, \u0026compute.LookupNetworkArgs{\n\t\t\tName: \"default\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Create the GCP peer\n\t\t_, err = compute.NewNetworkPeering(ctx, \"peering\", \u0026compute.NetworkPeeringArgs{\n\t\t\tNetwork: *pulumi.String(_default.SelfLink),\n\t\t\tPeerNetwork: pulumi.All(testNetworkPeering.AtlasGcpProjectId, testNetworkPeering.AtlasVpcName).ApplyT(func(_args []interface{}) (string, error) {\n\t\t\t\tatlasGcpProjectId := _args[0].(string)\n\t\t\t\tatlasVpcName := _args[1].(string)\n\t\t\t\treturn fmt.Sprintf(\"https://www.googleapis.com/compute/v1/projects/%v/global/networks/%v\", atlasGcpProjectId, atlasVpcName), nil\n\t\t\t}).(pulumi.StringOutput),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Create the cluster once the peering connection is completed\n\t\t_, err = mongodbatlas.NewCluster(ctx, \"testCluster\", \u0026mongodbatlas.ClusterArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tNumShards: pulumi.Int(1),\n\t\t\tClusterType: pulumi.String(\"REPLICASET\"),\n\t\t\tReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{\n\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecArgs{\n\t\t\t\t\tNumShards: pulumi.Int(1),\n\t\t\t\t\tRegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{\n\t\t\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{\n\t\t\t\t\t\t\tRegionName: pulumi.String(\"US_EAST_4\"),\n\t\t\t\t\t\t\tElectableNodes: pulumi.Int(3),\n\t\t\t\t\t\t\tPriority: pulumi.Int(7),\n\t\t\t\t\t\t\tReadOnlyNodes: pulumi.Int(0),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tAutoScalingDiskGbEnabled: pulumi.Bool(true),\n\t\t\tMongoDbMajorVersion: pulumi.String(\"4.2\"),\n\t\t\tProviderName: pulumi.String(\"GCP\"),\n\t\t\tProviderInstanceSizeName: pulumi.String(\"M10\"),\n\t\t}, pulumi.DependsOn([]pulumi.Resource{\n\t\t\tpulumi.Resource(\"google_compute_network_peering.peering\"),\n\t\t}))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mongodbatlas.NetworkContainer;\nimport com.pulumi.mongodbatlas.NetworkContainerArgs;\nimport com.pulumi.mongodbatlas.NetworkPeering;\nimport com.pulumi.mongodbatlas.NetworkPeeringArgs;\nimport com.pulumi.gcp.compute.ComputeFunctions;\nimport com.pulumi.gcp.compute.inputs.GetNetworkArgs;\nimport com.pulumi.gcp.compute.NetworkPeering;\nimport com.pulumi.gcp.compute.NetworkPeeringArgs;\nimport com.pulumi.mongodbatlas.Cluster;\nimport com.pulumi.mongodbatlas.ClusterArgs;\nimport com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;\nimport com.pulumi.resources.CustomResourceOptions;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var testNetworkContainer = new NetworkContainer(\"testNetworkContainer\", NetworkContainerArgs.builder() \n .projectId(local.project_id())\n .atlasCidrBlock(\"10.8.0.0/21\")\n .providerName(\"GCP\")\n .build());\n\n var testNetworkPeering = new NetworkPeering(\"testNetworkPeering\", NetworkPeeringArgs.builder() \n .projectId(local.project_id())\n .containerId(testNetworkContainer.containerId())\n .providerName(\"GCP\")\n .gcpProjectId(local.GCP_PROJECT_ID())\n .networkName(\"default\")\n .build());\n\n final var default = ComputeFunctions.getNetwork(GetNetworkArgs.builder()\n .name(\"default\")\n .build());\n\n var peering = new NetworkPeering(\"peering\", NetworkPeeringArgs.builder() \n .network(default_.selfLink())\n .peerNetwork(Output.tuple(testNetworkPeering.atlasGcpProjectId(), testNetworkPeering.atlasVpcName()).applyValue(values -\u003e {\n var atlasGcpProjectId = values.t1;\n var atlasVpcName = values.t2;\n return String.format(\"https://www.googleapis.com/compute/v1/projects/%s/global/networks/%s\", atlasGcpProjectId,atlasVpcName);\n }))\n .build());\n\n var testCluster = new Cluster(\"testCluster\", ClusterArgs.builder() \n .projectId(local.project_id())\n .numShards(1)\n .clusterType(\"REPLICASET\")\n .replicationSpecs(ClusterReplicationSpecArgs.builder()\n .numShards(1)\n .regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()\n .regionName(\"US_EAST_4\")\n .electableNodes(3)\n .priority(7)\n .readOnlyNodes(0)\n .build())\n .build())\n .autoScalingDiskGbEnabled(true)\n .mongoDbMajorVersion(\"4.2\")\n .providerName(\"GCP\")\n .providerInstanceSizeName(\"M10\")\n .build(), CustomResourceOptions.builder()\n .dependsOn(\"google_compute_network_peering.peering\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Container example provided but not always required, \n # see network_container documentation for details.\n testNetworkContainer:\n type: mongodbatlas:NetworkContainer\n properties:\n projectId: ${local.project_id}\n atlasCidrBlock: 10.8.0.0/21\n providerName: GCP\n # Create the peering connection request\n testNetworkPeering:\n type: mongodbatlas:NetworkPeering\n properties:\n projectId: ${local.project_id}\n containerId: ${testNetworkContainer.containerId}\n providerName: GCP\n gcpProjectId: ${local.GCP_PROJECT_ID}\n networkName: default\n # Create the GCP peer\n peering:\n type: gcp:compute:NetworkPeering\n properties:\n network: ${default.selfLink}\n peerNetwork: https://www.googleapis.com/compute/v1/projects/${testNetworkPeering.atlasGcpProjectId}/global/networks/${testNetworkPeering.atlasVpcName}\n # Create the cluster once the peering connection is completed\n testCluster:\n type: mongodbatlas:Cluster\n properties:\n projectId: ${local.project_id}\n numShards: 1\n clusterType: REPLICASET\n replicationSpecs:\n - numShards: 1\n regionsConfigs:\n - regionName: US_EAST_4\n electableNodes: 3\n priority: 7\n readOnlyNodes: 0\n autoScalingDiskGbEnabled: true\n mongoDbMajorVersion: '4.2'\n # Provider Settings \"block\"\n providerName: GCP\n providerInstanceSizeName: M10\n options:\n dependson:\n - google_compute_network_peering.peering\nvariables:\n default:\n fn::invoke:\n Function: gcp:compute:getNetwork\n Arguments:\n name: default\n```\n{{% /example %}}\n{{% example %}}\n### Example with Azure\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as mongodbatlas from \"@pulumi/mongodbatlas\";\n\n// Ensure you have created the required Azure service principal first, see\n// see https://docs.atlas.mongodb.com/security-vpc-peering/\n// Container example provided but not always required, \n// see network_container documentation for details. \nconst testNetworkContainer = new mongodbatlas.NetworkContainer(\"testNetworkContainer\", {\n projectId: local.project_id,\n atlasCidrBlock: local.ATLAS_CIDR_BLOCK,\n providerName: \"AZURE\",\n region: \"US_EAST_2\",\n});\n// Create the peering connection request\nconst testNetworkPeering = new mongodbatlas.NetworkPeering(\"testNetworkPeering\", {\n projectId: local.project_id,\n containerId: testNetworkContainer.containerId,\n providerName: \"AZURE\",\n azureDirectoryId: local.AZURE_DIRECTORY_ID,\n azureSubscriptionId: local.AZURE_SUBSCRIPTION_ID,\n resourceGroupName: local.AZURE_RESOURCES_GROUP_NAME,\n vnetName: local.AZURE_VNET_NAME,\n});\n// Create the cluster once the peering connection is completed\nconst testCluster = new mongodbatlas.Cluster(\"testCluster\", {\n projectId: local.project_id,\n clusterType: \"REPLICASET\",\n replicationSpecs: [{\n numShards: 1,\n regionsConfigs: [{\n regionName: \"US_EAST_2\",\n electableNodes: 3,\n priority: 7,\n readOnlyNodes: 0,\n }],\n }],\n autoScalingDiskGbEnabled: true,\n mongoDbMajorVersion: \"4.2\",\n providerName: \"AZURE\",\n providerDiskTypeName: \"P4\",\n providerInstanceSizeName: \"M10\",\n}, {\n dependsOn: [\"mongodbatlas_network_peering.test\"],\n});\n```\n```python\nimport pulumi\nimport pulumi_mongodbatlas as mongodbatlas\n\n# Ensure you have created the required Azure service principal first, see\n# see https://docs.atlas.mongodb.com/security-vpc-peering/\n# Container example provided but not always required, \n# see network_container documentation for details. \ntest_network_container = mongodbatlas.NetworkContainer(\"testNetworkContainer\",\n project_id=local[\"project_id\"],\n atlas_cidr_block=local[\"ATLAS_CIDR_BLOCK\"],\n provider_name=\"AZURE\",\n region=\"US_EAST_2\")\n# Create the peering connection request\ntest_network_peering = mongodbatlas.NetworkPeering(\"testNetworkPeering\",\n project_id=local[\"project_id\"],\n container_id=test_network_container.container_id,\n provider_name=\"AZURE\",\n azure_directory_id=local[\"AZURE_DIRECTORY_ID\"],\n azure_subscription_id=local[\"AZURE_SUBSCRIPTION_ID\"],\n resource_group_name=local[\"AZURE_RESOURCES_GROUP_NAME\"],\n vnet_name=local[\"AZURE_VNET_NAME\"])\n# Create the cluster once the peering connection is completed\ntest_cluster = mongodbatlas.Cluster(\"testCluster\",\n project_id=local[\"project_id\"],\n cluster_type=\"REPLICASET\",\n replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(\n num_shards=1,\n regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(\n region_name=\"US_EAST_2\",\n electable_nodes=3,\n priority=7,\n read_only_nodes=0,\n )],\n )],\n auto_scaling_disk_gb_enabled=True,\n mongo_db_major_version=\"4.2\",\n provider_name=\"AZURE\",\n provider_disk_type_name=\"P4\",\n provider_instance_size_name=\"M10\",\n opts=pulumi.ResourceOptions(depends_on=[\"mongodbatlas_network_peering.test\"]))\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Mongodbatlas = Pulumi.Mongodbatlas;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Ensure you have created the required Azure service principal first, see\n // see https://docs.atlas.mongodb.com/security-vpc-peering/\n // Container example provided but not always required, \n // see network_container documentation for details. \n var testNetworkContainer = new Mongodbatlas.NetworkContainer(\"testNetworkContainer\", new()\n {\n ProjectId = local.Project_id,\n AtlasCidrBlock = local.ATLAS_CIDR_BLOCK,\n ProviderName = \"AZURE\",\n Region = \"US_EAST_2\",\n });\n\n // Create the peering connection request\n var testNetworkPeering = new Mongodbatlas.NetworkPeering(\"testNetworkPeering\", new()\n {\n ProjectId = local.Project_id,\n ContainerId = testNetworkContainer.ContainerId,\n ProviderName = \"AZURE\",\n AzureDirectoryId = local.AZURE_DIRECTORY_ID,\n AzureSubscriptionId = local.AZURE_SUBSCRIPTION_ID,\n ResourceGroupName = local.AZURE_RESOURCES_GROUP_NAME,\n VnetName = local.AZURE_VNET_NAME,\n });\n\n // Create the cluster once the peering connection is completed\n var testCluster = new Mongodbatlas.Cluster(\"testCluster\", new()\n {\n ProjectId = local.Project_id,\n ClusterType = \"REPLICASET\",\n ReplicationSpecs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecArgs\n {\n NumShards = 1,\n RegionsConfigs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs\n {\n RegionName = \"US_EAST_2\",\n ElectableNodes = 3,\n Priority = 7,\n ReadOnlyNodes = 0,\n },\n },\n },\n },\n AutoScalingDiskGbEnabled = true,\n MongoDbMajorVersion = \"4.2\",\n ProviderName = \"AZURE\",\n ProviderDiskTypeName = \"P4\",\n ProviderInstanceSizeName = \"M10\",\n }, new CustomResourceOptions\n {\n DependsOn = new[]\n {\n \"mongodbatlas_network_peering.test\",\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// Ensure you have created the required Azure service principal first, see\n\t\t// see https://docs.atlas.mongodb.com/security-vpc-peering/\n\t\t// Container example provided but not always required,\n\t\t// see network_container documentation for details.\n\t\ttestNetworkContainer, err := mongodbatlas.NewNetworkContainer(ctx, \"testNetworkContainer\", \u0026mongodbatlas.NetworkContainerArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tAtlasCidrBlock: pulumi.Any(local.ATLAS_CIDR_BLOCK),\n\t\t\tProviderName: pulumi.String(\"AZURE\"),\n\t\t\tRegion: pulumi.String(\"US_EAST_2\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Create the peering connection request\n\t\t_, err = mongodbatlas.NewNetworkPeering(ctx, \"testNetworkPeering\", \u0026mongodbatlas.NetworkPeeringArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tContainerId: testNetworkContainer.ContainerId,\n\t\t\tProviderName: pulumi.String(\"AZURE\"),\n\t\t\tAzureDirectoryId: pulumi.Any(local.AZURE_DIRECTORY_ID),\n\t\t\tAzureSubscriptionId: pulumi.Any(local.AZURE_SUBSCRIPTION_ID),\n\t\t\tResourceGroupName: pulumi.Any(local.AZURE_RESOURCES_GROUP_NAME),\n\t\t\tVnetName: pulumi.Any(local.AZURE_VNET_NAME),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Create the cluster once the peering connection is completed\n\t\t_, err = mongodbatlas.NewCluster(ctx, \"testCluster\", \u0026mongodbatlas.ClusterArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tClusterType: pulumi.String(\"REPLICASET\"),\n\t\t\tReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{\n\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecArgs{\n\t\t\t\t\tNumShards: pulumi.Int(1),\n\t\t\t\t\tRegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{\n\t\t\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{\n\t\t\t\t\t\t\tRegionName: pulumi.String(\"US_EAST_2\"),\n\t\t\t\t\t\t\tElectableNodes: pulumi.Int(3),\n\t\t\t\t\t\t\tPriority: pulumi.Int(7),\n\t\t\t\t\t\t\tReadOnlyNodes: pulumi.Int(0),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tAutoScalingDiskGbEnabled: pulumi.Bool(true),\n\t\t\tMongoDbMajorVersion: pulumi.String(\"4.2\"),\n\t\t\tProviderName: pulumi.String(\"AZURE\"),\n\t\t\tProviderDiskTypeName: pulumi.String(\"P4\"),\n\t\t\tProviderInstanceSizeName: pulumi.String(\"M10\"),\n\t\t}, pulumi.DependsOn([]pulumi.Resource{\n\t\t\tpulumi.Resource(\"mongodbatlas_network_peering.test\"),\n\t\t}))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mongodbatlas.NetworkContainer;\nimport com.pulumi.mongodbatlas.NetworkContainerArgs;\nimport com.pulumi.mongodbatlas.NetworkPeering;\nimport com.pulumi.mongodbatlas.NetworkPeeringArgs;\nimport com.pulumi.mongodbatlas.Cluster;\nimport com.pulumi.mongodbatlas.ClusterArgs;\nimport com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;\nimport com.pulumi.resources.CustomResourceOptions;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var testNetworkContainer = new NetworkContainer(\"testNetworkContainer\", NetworkContainerArgs.builder() \n .projectId(local.project_id())\n .atlasCidrBlock(local.ATLAS_CIDR_BLOCK())\n .providerName(\"AZURE\")\n .region(\"US_EAST_2\")\n .build());\n\n var testNetworkPeering = new NetworkPeering(\"testNetworkPeering\", NetworkPeeringArgs.builder() \n .projectId(local.project_id())\n .containerId(testNetworkContainer.containerId())\n .providerName(\"AZURE\")\n .azureDirectoryId(local.AZURE_DIRECTORY_ID())\n .azureSubscriptionId(local.AZURE_SUBSCRIPTION_ID())\n .resourceGroupName(local.AZURE_RESOURCES_GROUP_NAME())\n .vnetName(local.AZURE_VNET_NAME())\n .build());\n\n var testCluster = new Cluster(\"testCluster\", ClusterArgs.builder() \n .projectId(local.project_id())\n .clusterType(\"REPLICASET\")\n .replicationSpecs(ClusterReplicationSpecArgs.builder()\n .numShards(1)\n .regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()\n .regionName(\"US_EAST_2\")\n .electableNodes(3)\n .priority(7)\n .readOnlyNodes(0)\n .build())\n .build())\n .autoScalingDiskGbEnabled(true)\n .mongoDbMajorVersion(\"4.2\")\n .providerName(\"AZURE\")\n .providerDiskTypeName(\"P4\")\n .providerInstanceSizeName(\"M10\")\n .build(), CustomResourceOptions.builder()\n .dependsOn(\"mongodbatlas_network_peering.test\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Ensure you have created the required Azure service principal first, see\n # see https://docs.atlas.mongodb.com/security-vpc-peering/\n\n # Container example provided but not always required, \n # see network_container documentation for details.\n testNetworkContainer:\n type: mongodbatlas:NetworkContainer\n properties:\n projectId: ${local.project_id}\n atlasCidrBlock: ${local.ATLAS_CIDR_BLOCK}\n providerName: AZURE\n region: US_EAST_2\n # Create the peering connection request\n testNetworkPeering:\n type: mongodbatlas:NetworkPeering\n properties:\n projectId: ${local.project_id}\n containerId: ${testNetworkContainer.containerId}\n providerName: AZURE\n azureDirectoryId: ${local.AZURE_DIRECTORY_ID}\n azureSubscriptionId: ${local.AZURE_SUBSCRIPTION_ID}\n resourceGroupName: ${local.AZURE_RESOURCES_GROUP_NAME}\n vnetName: ${local.AZURE_VNET_NAME}\n # Create the cluster once the peering connection is completed\n testCluster:\n type: mongodbatlas:Cluster\n properties:\n projectId: ${local.project_id}\n clusterType: REPLICASET\n replicationSpecs:\n - numShards: 1\n regionsConfigs:\n - regionName: US_EAST_2\n electableNodes: 3\n priority: 7\n readOnlyNodes: 0\n autoScalingDiskGbEnabled: true\n mongoDbMajorVersion: '4.2'\n # Provider Settings \"block\"\n providerName: AZURE\n providerDiskTypeName: P4\n providerInstanceSizeName: M10\n options:\n dependson:\n - mongodbatlas_network_peering.test\n```\n{{% /example %}}\n### Peering Connection Only, Container Exists\nYou 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.\n{{% example %}}\n### Example with AWS\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as mongodbatlas from \"@pulumi/mongodbatlas\";\n\n// Create an Atlas cluster, this creates a container if one\n// does not yet exist for this AWS region\nconst test = new mongodbatlas.Cluster(\"test\", {\n projectId: local.project_id,\n clusterType: \"REPLICASET\",\n replicationSpecs: [{\n numShards: 1,\n regionsConfigs: [{\n regionName: \"US_EAST_2\",\n electableNodes: 3,\n priority: 7,\n readOnlyNodes: 0,\n }],\n }],\n autoScalingDiskGbEnabled: false,\n mongoDbMajorVersion: \"4.2\",\n providerName: \"AWS\",\n providerInstanceSizeName: \"M10\",\n});\n// the following assumes an AWS provider is configured\nconst _default = new aws.ec2.DefaultVpc(\"default\", {tags: {\n Name: \"Default VPC\",\n}});\n// Create the peering connection request\nconst mongoPeer = new mongodbatlas.NetworkPeering(\"mongoPeer\", {\n accepterRegionName: \"us-east-2\",\n projectId: local.project_id,\n containerId: test.containerId,\n providerName: \"AWS\",\n routeTableCidrBlock: \"172.31.0.0/16\",\n vpcId: _default.id,\n awsAccountId: local.AWS_ACCOUNT_ID,\n});\n// Accept the connection \nconst awsPeer = new aws.ec2.VpcPeeringConnectionAccepter(\"awsPeer\", {\n vpcPeeringConnectionId: mongoPeer.connectionId,\n autoAccept: true,\n tags: {\n Side: \"Accepter\",\n },\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_mongodbatlas as mongodbatlas\n\n# Create an Atlas cluster, this creates a container if one\n# does not yet exist for this AWS region\ntest = mongodbatlas.Cluster(\"test\",\n project_id=local[\"project_id\"],\n cluster_type=\"REPLICASET\",\n replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(\n num_shards=1,\n regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(\n region_name=\"US_EAST_2\",\n electable_nodes=3,\n priority=7,\n read_only_nodes=0,\n )],\n )],\n auto_scaling_disk_gb_enabled=False,\n mongo_db_major_version=\"4.2\",\n provider_name=\"AWS\",\n provider_instance_size_name=\"M10\")\n# the following assumes an AWS provider is configured\ndefault = aws.ec2.DefaultVpc(\"default\", tags={\n \"Name\": \"Default VPC\",\n})\n# Create the peering connection request\nmongo_peer = mongodbatlas.NetworkPeering(\"mongoPeer\",\n accepter_region_name=\"us-east-2\",\n project_id=local[\"project_id\"],\n container_id=test.container_id,\n provider_name=\"AWS\",\n route_table_cidr_block=\"172.31.0.0/16\",\n vpc_id=default.id,\n aws_account_id=local[\"AWS_ACCOUNT_ID\"])\n# Accept the connection \naws_peer = aws.ec2.VpcPeeringConnectionAccepter(\"awsPeer\",\n vpc_peering_connection_id=mongo_peer.connection_id,\n auto_accept=True,\n tags={\n \"Side\": \"Accepter\",\n })\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Mongodbatlas = Pulumi.Mongodbatlas;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Create an Atlas cluster, this creates a container if one\n // does not yet exist for this AWS region\n var test = new Mongodbatlas.Cluster(\"test\", new()\n {\n ProjectId = local.Project_id,\n ClusterType = \"REPLICASET\",\n ReplicationSpecs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecArgs\n {\n NumShards = 1,\n RegionsConfigs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs\n {\n RegionName = \"US_EAST_2\",\n ElectableNodes = 3,\n Priority = 7,\n ReadOnlyNodes = 0,\n },\n },\n },\n },\n AutoScalingDiskGbEnabled = false,\n MongoDbMajorVersion = \"4.2\",\n ProviderName = \"AWS\",\n ProviderInstanceSizeName = \"M10\",\n });\n\n // the following assumes an AWS provider is configured\n var @default = new Aws.Ec2.DefaultVpc(\"default\", new()\n {\n Tags = \n {\n { \"Name\", \"Default VPC\" },\n },\n });\n\n // Create the peering connection request\n var mongoPeer = new Mongodbatlas.NetworkPeering(\"mongoPeer\", new()\n {\n AccepterRegionName = \"us-east-2\",\n ProjectId = local.Project_id,\n ContainerId = test.ContainerId,\n ProviderName = \"AWS\",\n RouteTableCidrBlock = \"172.31.0.0/16\",\n VpcId = @default.Id,\n AwsAccountId = local.AWS_ACCOUNT_ID,\n });\n\n // Accept the connection \n var awsPeer = new Aws.Ec2.VpcPeeringConnectionAccepter(\"awsPeer\", new()\n {\n VpcPeeringConnectionId = mongoPeer.ConnectionId,\n AutoAccept = true,\n Tags = \n {\n { \"Side\", \"Accepter\" },\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2\"\n\t\"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// Create an Atlas cluster, this creates a container if one\n\t\t// does not yet exist for this AWS region\n\t\ttest, err := mongodbatlas.NewCluster(ctx, \"test\", \u0026mongodbatlas.ClusterArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tClusterType: pulumi.String(\"REPLICASET\"),\n\t\t\tReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{\n\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecArgs{\n\t\t\t\t\tNumShards: pulumi.Int(1),\n\t\t\t\t\tRegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{\n\t\t\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{\n\t\t\t\t\t\t\tRegionName: pulumi.String(\"US_EAST_2\"),\n\t\t\t\t\t\t\tElectableNodes: pulumi.Int(3),\n\t\t\t\t\t\t\tPriority: pulumi.Int(7),\n\t\t\t\t\t\t\tReadOnlyNodes: pulumi.Int(0),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tAutoScalingDiskGbEnabled: pulumi.Bool(false),\n\t\t\tMongoDbMajorVersion: pulumi.String(\"4.2\"),\n\t\t\tProviderName: pulumi.String(\"AWS\"),\n\t\t\tProviderInstanceSizeName: pulumi.String(\"M10\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// the following assumes an AWS provider is configured\n\t\t_, err = ec2.NewDefaultVpc(ctx, \"default\", \u0026ec2.DefaultVpcArgs{\n\t\t\tTags: pulumi.StringMap{\n\t\t\t\t\"Name\": pulumi.String(\"Default VPC\"),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Create the peering connection request\n\t\tmongoPeer, err := mongodbatlas.NewNetworkPeering(ctx, \"mongoPeer\", \u0026mongodbatlas.NetworkPeeringArgs{\n\t\t\tAccepterRegionName: pulumi.String(\"us-east-2\"),\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tContainerId: test.ContainerId,\n\t\t\tProviderName: pulumi.String(\"AWS\"),\n\t\t\tRouteTableCidrBlock: pulumi.String(\"172.31.0.0/16\"),\n\t\t\tVpcId: _default.ID(),\n\t\t\tAwsAccountId: pulumi.Any(local.AWS_ACCOUNT_ID),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Accept the connection\n\t\t_, err = ec2.NewVpcPeeringConnectionAccepter(ctx, \"awsPeer\", \u0026ec2.VpcPeeringConnectionAccepterArgs{\n\t\t\tVpcPeeringConnectionId: mongoPeer.ConnectionId,\n\t\t\tAutoAccept: pulumi.Bool(true),\n\t\t\tTags: pulumi.StringMap{\n\t\t\t\t\"Side\": pulumi.String(\"Accepter\"),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mongodbatlas.Cluster;\nimport com.pulumi.mongodbatlas.ClusterArgs;\nimport com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;\nimport com.pulumi.aws.ec2.DefaultVpc;\nimport com.pulumi.aws.ec2.DefaultVpcArgs;\nimport com.pulumi.mongodbatlas.NetworkPeering;\nimport com.pulumi.mongodbatlas.NetworkPeeringArgs;\nimport com.pulumi.aws.ec2.VpcPeeringConnectionAccepter;\nimport com.pulumi.aws.ec2.VpcPeeringConnectionAccepterArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var test = new Cluster(\"test\", ClusterArgs.builder() \n .projectId(local.project_id())\n .clusterType(\"REPLICASET\")\n .replicationSpecs(ClusterReplicationSpecArgs.builder()\n .numShards(1)\n .regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()\n .regionName(\"US_EAST_2\")\n .electableNodes(3)\n .priority(7)\n .readOnlyNodes(0)\n .build())\n .build())\n .autoScalingDiskGbEnabled(false)\n .mongoDbMajorVersion(\"4.2\")\n .providerName(\"AWS\")\n .providerInstanceSizeName(\"M10\")\n .build());\n\n var default_ = new DefaultVpc(\"default\", DefaultVpcArgs.builder() \n .tags(Map.of(\"Name\", \"Default VPC\"))\n .build());\n\n var mongoPeer = new NetworkPeering(\"mongoPeer\", NetworkPeeringArgs.builder() \n .accepterRegionName(\"us-east-2\")\n .projectId(local.project_id())\n .containerId(test.containerId())\n .providerName(\"AWS\")\n .routeTableCidrBlock(\"172.31.0.0/16\")\n .vpcId(default_.id())\n .awsAccountId(local.AWS_ACCOUNT_ID())\n .build());\n\n var awsPeer = new VpcPeeringConnectionAccepter(\"awsPeer\", VpcPeeringConnectionAccepterArgs.builder() \n .vpcPeeringConnectionId(mongoPeer.connectionId())\n .autoAccept(true)\n .tags(Map.of(\"Side\", \"Accepter\"))\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Create an Atlas cluster, this creates a container if one\n # does not yet exist for this AWS region\n test:\n type: mongodbatlas:Cluster\n properties:\n projectId: ${local.project_id}\n clusterType: REPLICASET\n replicationSpecs:\n - numShards: 1\n regionsConfigs:\n - regionName: US_EAST_2\n electableNodes: 3\n priority: 7\n readOnlyNodes: 0\n autoScalingDiskGbEnabled: false\n mongoDbMajorVersion: '4.2'\n # Provider Settings \"block\"\n providerName: AWS\n providerInstanceSizeName: M10\n # the following assumes an AWS provider is configured\n default:\n type: aws:ec2:DefaultVpc\n properties:\n tags:\n Name: Default VPC\n # Create the peering connection request\n mongoPeer:\n type: mongodbatlas:NetworkPeering\n properties:\n accepterRegionName: us-east-2\n projectId: ${local.project_id}\n containerId: ${test.containerId}\n providerName: AWS\n routeTableCidrBlock: 172.31.0.0/16\n vpcId: ${default.id}\n awsAccountId: ${local.AWS_ACCOUNT_ID}\n # Accept the connection\n awsPeer:\n type: aws:ec2:VpcPeeringConnectionAccepter\n properties:\n vpcPeeringConnectionId: ${mongoPeer.connectionId}\n autoAccept: true\n tags:\n Side: Accepter\n```\n{{% /example %}}\n{{% example %}}\n### Example with GCP\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as gcp from \"@pulumi/gcp\";\nimport * as mongodbatlas from \"@pulumi/mongodbatlas\";\n\n// Create an Atlas cluster, this creates a container if one\n// does not yet exist for this GCP \nconst testCluster = new mongodbatlas.Cluster(\"testCluster\", {\n projectId: local.project_id,\n clusterType: \"REPLICASET\",\n replicationSpecs: [{\n numShards: 1,\n regionsConfigs: [{\n regionName: \"US_EAST_2\",\n electableNodes: 3,\n priority: 7,\n readOnlyNodes: 0,\n }],\n }],\n autoScalingDiskGbEnabled: true,\n mongoDbMajorVersion: \"4.2\",\n providerName: \"GCP\",\n providerInstanceSizeName: \"M10\",\n});\n// Create the peering connection request\nconst testNetworkPeering = new mongodbatlas.NetworkPeering(\"testNetworkPeering\", {\n projectId: local.project_id,\n atlasCidrBlock: \"192.168.0.0/18\",\n containerId: testCluster.containerId,\n providerName: \"GCP\",\n gcpProjectId: local.GCP_PROJECT_ID,\n networkName: \"default\",\n});\nconst default = gcp.compute.getNetwork({\n name: \"default\",\n});\n// Create the GCP peer\nconst peering = new gcp.compute.NetworkPeering(\"peering\", {\n network: _default.then(_default =\u003e _default.selfLink),\n peerNetwork: pulumi.interpolate`https://www.googleapis.com/compute/v1/projects/${testNetworkPeering.atlasGcpProjectId}/global/networks/${testNetworkPeering.atlasVpcName}`,\n});\n```\n```python\nimport pulumi\nimport pulumi_gcp as gcp\nimport pulumi_mongodbatlas as mongodbatlas\n\n# Create an Atlas cluster, this creates a container if one\n# does not yet exist for this GCP \ntest_cluster = mongodbatlas.Cluster(\"testCluster\",\n project_id=local[\"project_id\"],\n cluster_type=\"REPLICASET\",\n replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(\n num_shards=1,\n regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(\n region_name=\"US_EAST_2\",\n electable_nodes=3,\n priority=7,\n read_only_nodes=0,\n )],\n )],\n auto_scaling_disk_gb_enabled=True,\n mongo_db_major_version=\"4.2\",\n provider_name=\"GCP\",\n provider_instance_size_name=\"M10\")\n# Create the peering connection request\ntest_network_peering = mongodbatlas.NetworkPeering(\"testNetworkPeering\",\n project_id=local[\"project_id\"],\n atlas_cidr_block=\"192.168.0.0/18\",\n container_id=test_cluster.container_id,\n provider_name=\"GCP\",\n gcp_project_id=local[\"GCP_PROJECT_ID\"],\n network_name=\"default\")\ndefault = gcp.compute.get_network(name=\"default\")\n# Create the GCP peer\npeering = gcp.compute.NetworkPeering(\"peering\",\n network=default.self_link,\n 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}\"))\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Gcp = Pulumi.Gcp;\nusing Mongodbatlas = Pulumi.Mongodbatlas;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Create an Atlas cluster, this creates a container if one\n // does not yet exist for this GCP \n var testCluster = new Mongodbatlas.Cluster(\"testCluster\", new()\n {\n ProjectId = local.Project_id,\n ClusterType = \"REPLICASET\",\n ReplicationSpecs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecArgs\n {\n NumShards = 1,\n RegionsConfigs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs\n {\n RegionName = \"US_EAST_2\",\n ElectableNodes = 3,\n Priority = 7,\n ReadOnlyNodes = 0,\n },\n },\n },\n },\n AutoScalingDiskGbEnabled = true,\n MongoDbMajorVersion = \"4.2\",\n ProviderName = \"GCP\",\n ProviderInstanceSizeName = \"M10\",\n });\n\n // Create the peering connection request\n var testNetworkPeering = new Mongodbatlas.NetworkPeering(\"testNetworkPeering\", new()\n {\n ProjectId = local.Project_id,\n AtlasCidrBlock = \"192.168.0.0/18\",\n ContainerId = testCluster.ContainerId,\n ProviderName = \"GCP\",\n GcpProjectId = local.GCP_PROJECT_ID,\n NetworkName = \"default\",\n });\n\n var @default = Gcp.Compute.GetNetwork.Invoke(new()\n {\n Name = \"default\",\n });\n\n // Create the GCP peer\n var peering = new Gcp.Compute.NetworkPeering(\"peering\", new()\n {\n Network = @default.Apply(@default =\u003e @default.Apply(getNetworkResult =\u003e getNetworkResult.SelfLink)),\n PeerNetwork = Output.Tuple(testNetworkPeering.AtlasGcpProjectId, testNetworkPeering.AtlasVpcName).Apply(values =\u003e\n {\n var atlasGcpProjectId = values.Item1;\n var atlasVpcName = values.Item2;\n return $\"https://www.googleapis.com/compute/v1/projects/{atlasGcpProjectId}/global/networks/{atlasVpcName}\";\n }),\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-gcp/sdk/v5/go/gcp/compute\"\n\t\"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// Create an Atlas cluster, this creates a container if one\n\t\t// does not yet exist for this GCP\n\t\ttestCluster, err := mongodbatlas.NewCluster(ctx, \"testCluster\", \u0026mongodbatlas.ClusterArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tClusterType: pulumi.String(\"REPLICASET\"),\n\t\t\tReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{\n\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecArgs{\n\t\t\t\t\tNumShards: pulumi.Int(1),\n\t\t\t\t\tRegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{\n\t\t\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{\n\t\t\t\t\t\t\tRegionName: pulumi.String(\"US_EAST_2\"),\n\t\t\t\t\t\t\tElectableNodes: pulumi.Int(3),\n\t\t\t\t\t\t\tPriority: pulumi.Int(7),\n\t\t\t\t\t\t\tReadOnlyNodes: pulumi.Int(0),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tAutoScalingDiskGbEnabled: pulumi.Bool(true),\n\t\t\tMongoDbMajorVersion: pulumi.String(\"4.2\"),\n\t\t\tProviderName: pulumi.String(\"GCP\"),\n\t\t\tProviderInstanceSizeName: pulumi.String(\"M10\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Create the peering connection request\n\t\ttestNetworkPeering, err := mongodbatlas.NewNetworkPeering(ctx, \"testNetworkPeering\", \u0026mongodbatlas.NetworkPeeringArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tAtlasCidrBlock: pulumi.String(\"192.168.0.0/18\"),\n\t\t\tContainerId: testCluster.ContainerId,\n\t\t\tProviderName: pulumi.String(\"GCP\"),\n\t\t\tGcpProjectId: pulumi.Any(local.GCP_PROJECT_ID),\n\t\t\tNetworkName: pulumi.String(\"default\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_default, err := compute.LookupNetwork(ctx, \u0026compute.LookupNetworkArgs{\n\t\t\tName: \"default\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Create the GCP peer\n\t\t_, err = compute.NewNetworkPeering(ctx, \"peering\", \u0026compute.NetworkPeeringArgs{\n\t\t\tNetwork: *pulumi.String(_default.SelfLink),\n\t\t\tPeerNetwork: pulumi.All(testNetworkPeering.AtlasGcpProjectId, testNetworkPeering.AtlasVpcName).ApplyT(func(_args []interface{}) (string, error) {\n\t\t\t\tatlasGcpProjectId := _args[0].(string)\n\t\t\t\tatlasVpcName := _args[1].(string)\n\t\t\t\treturn fmt.Sprintf(\"https://www.googleapis.com/compute/v1/projects/%v/global/networks/%v\", atlasGcpProjectId, atlasVpcName), nil\n\t\t\t}).(pulumi.StringOutput),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mongodbatlas.Cluster;\nimport com.pulumi.mongodbatlas.ClusterArgs;\nimport com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;\nimport com.pulumi.mongodbatlas.NetworkPeering;\nimport com.pulumi.mongodbatlas.NetworkPeeringArgs;\nimport com.pulumi.gcp.compute.ComputeFunctions;\nimport com.pulumi.gcp.compute.inputs.GetNetworkArgs;\nimport com.pulumi.gcp.compute.NetworkPeering;\nimport com.pulumi.gcp.compute.NetworkPeeringArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var testCluster = new Cluster(\"testCluster\", ClusterArgs.builder() \n .projectId(local.project_id())\n .clusterType(\"REPLICASET\")\n .replicationSpecs(ClusterReplicationSpecArgs.builder()\n .numShards(1)\n .regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()\n .regionName(\"US_EAST_2\")\n .electableNodes(3)\n .priority(7)\n .readOnlyNodes(0)\n .build())\n .build())\n .autoScalingDiskGbEnabled(true)\n .mongoDbMajorVersion(\"4.2\")\n .providerName(\"GCP\")\n .providerInstanceSizeName(\"M10\")\n .build());\n\n var testNetworkPeering = new NetworkPeering(\"testNetworkPeering\", NetworkPeeringArgs.builder() \n .projectId(local.project_id())\n .atlasCidrBlock(\"192.168.0.0/18\")\n .containerId(testCluster.containerId())\n .providerName(\"GCP\")\n .gcpProjectId(local.GCP_PROJECT_ID())\n .networkName(\"default\")\n .build());\n\n final var default = ComputeFunctions.getNetwork(GetNetworkArgs.builder()\n .name(\"default\")\n .build());\n\n var peering = new NetworkPeering(\"peering\", NetworkPeeringArgs.builder() \n .network(default_.selfLink())\n .peerNetwork(Output.tuple(testNetworkPeering.atlasGcpProjectId(), testNetworkPeering.atlasVpcName()).applyValue(values -\u003e {\n var atlasGcpProjectId = values.t1;\n var atlasVpcName = values.t2;\n return String.format(\"https://www.googleapis.com/compute/v1/projects/%s/global/networks/%s\", atlasGcpProjectId,atlasVpcName);\n }))\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Create an Atlas cluster, this creates a container if one\n # does not yet exist for this GCP\n testCluster:\n type: mongodbatlas:Cluster\n properties:\n projectId: ${local.project_id}\n clusterType: REPLICASET\n replicationSpecs:\n - numShards: 1\n regionsConfigs:\n - regionName: US_EAST_2\n electableNodes: 3\n priority: 7\n readOnlyNodes: 0\n autoScalingDiskGbEnabled: true\n mongoDbMajorVersion: '4.2'\n # Provider Settings \"block\"\n providerName: GCP\n providerInstanceSizeName: M10\n # Create the peering connection request\n testNetworkPeering:\n type: mongodbatlas:NetworkPeering\n properties:\n projectId: ${local.project_id}\n atlasCidrBlock: 192.168.0.0/18\n containerId: ${testCluster.containerId}\n providerName: GCP\n gcpProjectId: ${local.GCP_PROJECT_ID}\n networkName: default\n # Create the GCP peer\n peering:\n type: gcp:compute:NetworkPeering\n properties:\n network: ${default.selfLink}\n peerNetwork: https://www.googleapis.com/compute/v1/projects/${testNetworkPeering.atlasGcpProjectId}/global/networks/${testNetworkPeering.atlasVpcName}\nvariables:\n default:\n fn::invoke:\n Function: gcp:compute:getNetwork\n Arguments:\n name: default\n```\n{{% /example %}}\n{{% example %}}\n### Example with Azure\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as mongodbatlas from \"@pulumi/mongodbatlas\";\n\n// Ensure you have created the required Azure service principal first, see\n// see https://docs.atlas.mongodb.com/security-vpc-peering/\n// Create an Atlas cluster, this creates a container if one\n// does not yet exist for this AZURE region\nconst testCluster = new mongodbatlas.Cluster(\"testCluster\", {\n projectId: local.project_id,\n clusterType: \"REPLICASET\",\n replicationSpecs: [{\n numShards: 1,\n regionsConfigs: [{\n regionName: \"US_EAST_2\",\n electableNodes: 3,\n priority: 7,\n readOnlyNodes: 0,\n }],\n }],\n autoScalingDiskGbEnabled: false,\n mongoDbMajorVersion: \"4.2\",\n providerName: \"AZURE\",\n providerInstanceSizeName: \"M10\",\n});\n// Create the peering connection request\nconst testNetworkPeering = new mongodbatlas.NetworkPeering(\"testNetworkPeering\", {\n projectId: local.project_id,\n containerId: testCluster.containerId,\n providerName: \"AZURE\",\n azureDirectoryId: local.AZURE_DIRECTORY_ID,\n azureSubscriptionId: local.AZURE_SUBSCRIPTION_ID,\n resourceGroupName: local.AZURE_RESOURCE_GROUP_NAME,\n vnetName: local.AZURE_VNET_NAME,\n});\n```\n```python\nimport pulumi\nimport pulumi_mongodbatlas as mongodbatlas\n\n# Ensure you have created the required Azure service principal first, see\n# see https://docs.atlas.mongodb.com/security-vpc-peering/\n# Create an Atlas cluster, this creates a container if one\n# does not yet exist for this AZURE region\ntest_cluster = mongodbatlas.Cluster(\"testCluster\",\n project_id=local[\"project_id\"],\n cluster_type=\"REPLICASET\",\n replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(\n num_shards=1,\n regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(\n region_name=\"US_EAST_2\",\n electable_nodes=3,\n priority=7,\n read_only_nodes=0,\n )],\n )],\n auto_scaling_disk_gb_enabled=False,\n mongo_db_major_version=\"4.2\",\n provider_name=\"AZURE\",\n provider_instance_size_name=\"M10\")\n# Create the peering connection request\ntest_network_peering = mongodbatlas.NetworkPeering(\"testNetworkPeering\",\n project_id=local[\"project_id\"],\n container_id=test_cluster.container_id,\n provider_name=\"AZURE\",\n azure_directory_id=local[\"AZURE_DIRECTORY_ID\"],\n azure_subscription_id=local[\"AZURE_SUBSCRIPTION_ID\"],\n resource_group_name=local[\"AZURE_RESOURCE_GROUP_NAME\"],\n vnet_name=local[\"AZURE_VNET_NAME\"])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Mongodbatlas = Pulumi.Mongodbatlas;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n // Ensure you have created the required Azure service principal first, see\n // see https://docs.atlas.mongodb.com/security-vpc-peering/\n // Create an Atlas cluster, this creates a container if one\n // does not yet exist for this AZURE region\n var testCluster = new Mongodbatlas.Cluster(\"testCluster\", new()\n {\n ProjectId = local.Project_id,\n ClusterType = \"REPLICASET\",\n ReplicationSpecs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecArgs\n {\n NumShards = 1,\n RegionsConfigs = new[]\n {\n new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs\n {\n RegionName = \"US_EAST_2\",\n ElectableNodes = 3,\n Priority = 7,\n ReadOnlyNodes = 0,\n },\n },\n },\n },\n AutoScalingDiskGbEnabled = false,\n MongoDbMajorVersion = \"4.2\",\n ProviderName = \"AZURE\",\n ProviderInstanceSizeName = \"M10\",\n });\n\n // Create the peering connection request\n var testNetworkPeering = new Mongodbatlas.NetworkPeering(\"testNetworkPeering\", new()\n {\n ProjectId = local.Project_id,\n ContainerId = testCluster.ContainerId,\n ProviderName = \"AZURE\",\n AzureDirectoryId = local.AZURE_DIRECTORY_ID,\n AzureSubscriptionId = local.AZURE_SUBSCRIPTION_ID,\n ResourceGroupName = local.AZURE_RESOURCE_GROUP_NAME,\n VnetName = local.AZURE_VNET_NAME,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t// Ensure you have created the required Azure service principal first, see\n\t\t// see https://docs.atlas.mongodb.com/security-vpc-peering/\n\t\t// Create an Atlas cluster, this creates a container if one\n\t\t// does not yet exist for this AZURE region\n\t\ttestCluster, err := mongodbatlas.NewCluster(ctx, \"testCluster\", \u0026mongodbatlas.ClusterArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tClusterType: pulumi.String(\"REPLICASET\"),\n\t\t\tReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{\n\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecArgs{\n\t\t\t\t\tNumShards: pulumi.Int(1),\n\t\t\t\t\tRegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{\n\t\t\t\t\t\t\u0026mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{\n\t\t\t\t\t\t\tRegionName: pulumi.String(\"US_EAST_2\"),\n\t\t\t\t\t\t\tElectableNodes: pulumi.Int(3),\n\t\t\t\t\t\t\tPriority: pulumi.Int(7),\n\t\t\t\t\t\t\tReadOnlyNodes: pulumi.Int(0),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tAutoScalingDiskGbEnabled: pulumi.Bool(false),\n\t\t\tMongoDbMajorVersion: pulumi.String(\"4.2\"),\n\t\t\tProviderName: pulumi.String(\"AZURE\"),\n\t\t\tProviderInstanceSizeName: pulumi.String(\"M10\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Create the peering connection request\n\t\t_, err = mongodbatlas.NewNetworkPeering(ctx, \"testNetworkPeering\", \u0026mongodbatlas.NetworkPeeringArgs{\n\t\t\tProjectId: pulumi.Any(local.Project_id),\n\t\t\tContainerId: testCluster.ContainerId,\n\t\t\tProviderName: pulumi.String(\"AZURE\"),\n\t\t\tAzureDirectoryId: pulumi.Any(local.AZURE_DIRECTORY_ID),\n\t\t\tAzureSubscriptionId: pulumi.Any(local.AZURE_SUBSCRIPTION_ID),\n\t\t\tResourceGroupName: pulumi.Any(local.AZURE_RESOURCE_GROUP_NAME),\n\t\t\tVnetName: pulumi.Any(local.AZURE_VNET_NAME),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.mongodbatlas.Cluster;\nimport com.pulumi.mongodbatlas.ClusterArgs;\nimport com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;\nimport com.pulumi.mongodbatlas.NetworkPeering;\nimport com.pulumi.mongodbatlas.NetworkPeeringArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var testCluster = new Cluster(\"testCluster\", ClusterArgs.builder() \n .projectId(local.project_id())\n .clusterType(\"REPLICASET\")\n .replicationSpecs(ClusterReplicationSpecArgs.builder()\n .numShards(1)\n .regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()\n .regionName(\"US_EAST_2\")\n .electableNodes(3)\n .priority(7)\n .readOnlyNodes(0)\n .build())\n .build())\n .autoScalingDiskGbEnabled(false)\n .mongoDbMajorVersion(\"4.2\")\n .providerName(\"AZURE\")\n .providerInstanceSizeName(\"M10\")\n .build());\n\n var testNetworkPeering = new NetworkPeering(\"testNetworkPeering\", NetworkPeeringArgs.builder() \n .projectId(local.project_id())\n .containerId(testCluster.containerId())\n .providerName(\"AZURE\")\n .azureDirectoryId(local.AZURE_DIRECTORY_ID())\n .azureSubscriptionId(local.AZURE_SUBSCRIPTION_ID())\n .resourceGroupName(local.AZURE_RESOURCE_GROUP_NAME())\n .vnetName(local.AZURE_VNET_NAME())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n # Ensure you have created the required Azure service principal first, see\n # see https://docs.atlas.mongodb.com/security-vpc-peering/\n\n # Create an Atlas cluster, this creates a container if one\n # does not yet exist for this AZURE region\n testCluster:\n type: mongodbatlas:Cluster\n properties:\n projectId: ${local.project_id}\n clusterType: REPLICASET\n replicationSpecs:\n - numShards: 1\n regionsConfigs:\n - regionName: US_EAST_2\n electableNodes: 3\n priority: 7\n readOnlyNodes: 0\n autoScalingDiskGbEnabled: false\n mongoDbMajorVersion: '4.2'\n # Provider Settings \"block\"\n providerName: AZURE\n providerInstanceSizeName: M10\n # Create the peering connection request\n testNetworkPeering:\n type: mongodbatlas:NetworkPeering\n properties:\n projectId: ${local.project_id}\n containerId: ${testCluster.containerId}\n providerName: AZURE\n azureDirectoryId: ${local.AZURE_DIRECTORY_ID}\n azureSubscriptionId: ${local.AZURE_SUBSCRIPTION_ID}\n resourceGroupName: ${local.AZURE_RESOURCE_GROUP_NAME}\n vnetName: ${local.AZURE_VNET_NAME}\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\nNetwork Peering Connections can be imported using project ID and network peering id, in the format `PROJECTID-PEERID-PROVIDERNAME`, e.g.\n\n```sh\n $ pulumi import mongodbatlas:index/networkPeering:NetworkPeering my_peering 1112222b3bf99403840e8934-5cbf563d87d9d67253be590a-AWS\n```\n See detailed information for arguments and attributes: [MongoDB API Network Peering Connection](https://docs.atlas.mongodb.com/reference/api/vpc-create-peering-connection/)\n\n-\u003e __NOTE:__ If you need to get an existing container ID see the How-To Guide.\n\n", "properties": { "accepterRegionName": { "type": "string", diff --git a/provider/go.mod b/provider/go.mod index 1d111486..d5d71a06 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -8,9 +8,9 @@ replace github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/pulumi/terraf require ( github.com/mongodb/terraform-provider-mongodbatlas/shim v0.0.0 - github.com/pulumi/pulumi-terraform-bridge/pf v0.27.0 - github.com/pulumi/pulumi-terraform-bridge/v3 v3.74.0 - github.com/pulumi/pulumi/sdk/v3 v3.105.0 + github.com/pulumi/pulumi-terraform-bridge/pf v0.29.0 + github.com/pulumi/pulumi-terraform-bridge/v3 v3.76.0 + github.com/pulumi/pulumi/sdk/v3 v3.107.0 ) require ( @@ -183,9 +183,9 @@ require ( github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect github.com/pulumi/esc v0.6.2 // indirect github.com/pulumi/pulumi-java/pkg v0.9.9 // indirect - github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.7 // indirect + github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.8 // indirect github.com/pulumi/pulumi-yaml v1.5.0 // indirect - github.com/pulumi/pulumi/pkg/v3 v3.105.0 // indirect + github.com/pulumi/pulumi/pkg/v3 v3.107.0 // indirect github.com/pulumi/schema-tools v0.1.2 // indirect github.com/pulumi/terraform-diff-reader v0.0.2 // indirect github.com/rivo/uniseg v0.4.4 // indirect diff --git a/provider/go.sum b/provider/go.sum index 118003c9..1c3db9e5 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -2251,18 +2251,18 @@ github.com/pulumi/providertest v0.0.10 h1:bx77G0JYPO2Alf/SHRP05XpAYMrboKJkMIVkbF github.com/pulumi/providertest v0.0.10/go.mod h1:HsxjVsytcMIuNj19w1lT2W0QXY0oReXl1+h6eD2JXP8= github.com/pulumi/pulumi-java/pkg v0.9.9 h1:F3xJUtMFDVrTGCxb7Rh2Q8s6tj7gMfM5pcoUthz7vFY= github.com/pulumi/pulumi-java/pkg v0.9.9/go.mod h1:LVF1zeg3UkToHWxb67V+zEIxQc3EdMnlot5NWSt+FpA= -github.com/pulumi/pulumi-terraform-bridge/pf v0.27.0 h1:D9XAlpWh2Ai65HrBsWNFvJbdS1kWo0aoiPl/T7wHSk0= -github.com/pulumi/pulumi-terraform-bridge/pf v0.27.0/go.mod h1:bxg00rjoF8jhIN9EIdwe+ptl+Ia3/Syb0ZEDCBh0CIw= -github.com/pulumi/pulumi-terraform-bridge/v3 v3.74.0 h1:cVsqcIJqgCosq9ib0rUyUBLEr3Mamz138JA7gqN21c8= -github.com/pulumi/pulumi-terraform-bridge/v3 v3.74.0/go.mod h1:WOKqq+pzEXcfoXbGPd4weBFIY6RQjzlKO365LPHKrB8= -github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.7 h1:Z9vmfVTW0QtJrWh+DRR3UKiRZX23f45lFtdhQiUHEqE= -github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.7/go.mod h1:T9zHpTHyVz2EyobzByFFpjfqgGtXO4C4bNqC0j29D2I= +github.com/pulumi/pulumi-terraform-bridge/pf v0.29.0 h1:4rdkNurOR9wd0efLxJGWXZZQUIvQsWS9tDlHqWqzimM= +github.com/pulumi/pulumi-terraform-bridge/pf v0.29.0/go.mod h1:JpjEhF1ua4lIYhprwsWKTx3xcBTCH/7LdXrvshwTze8= +github.com/pulumi/pulumi-terraform-bridge/v3 v3.76.0 h1:o8XQDN0KH1LE1SNYjk512HdQujxmnOVhMp4mlqIGqVo= +github.com/pulumi/pulumi-terraform-bridge/v3 v3.76.0/go.mod h1:iSQ4IXK9AD/ne+pFcR+kqtrEuOD43/1f8jugbYWvt4c= +github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.8 h1:mav2tSitA9BPJPLLahKgepHyYsMzwaTm4cvp0dcTMYw= +github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.8/go.mod h1:qUYk2c9i/yqMGNj9/bQyXpS39BxNDSXYjVN1njnq0zY= github.com/pulumi/pulumi-yaml v1.5.0 h1:HfXu+WSFNpycref9CK935cViYJzXwSgHGWM/RepyrW0= github.com/pulumi/pulumi-yaml v1.5.0/go.mod h1:AvKSmEQv2EkPbpvAQroR1eP1LkJGC8z5NDM34rVWOtg= -github.com/pulumi/pulumi/pkg/v3 v3.105.0 h1:bJG1vUiYH2gDF1pfBKlIABDNoJD2LvU1LmjjL+EbvuM= -github.com/pulumi/pulumi/pkg/v3 v3.105.0/go.mod h1:eZAFEFOwE/skElTfwetfyTxPebmWr5vOS5NSU9XwlVw= -github.com/pulumi/pulumi/sdk/v3 v3.105.0 h1:OKEeubZigWyQVnZS6udnFnZHZ/8OWXuUYv9ir3OY+vs= -github.com/pulumi/pulumi/sdk/v3 v3.105.0/go.mod h1:Ml3rpGfyZlI4zQCG7LN2XDSmH4XUNYdyBwJ3yEr/OpI= +github.com/pulumi/pulumi/pkg/v3 v3.107.0 h1:HRyIl1c9ur0PVQW+GuFL1APBEuGa/fQQMp3F+WluxW8= +github.com/pulumi/pulumi/pkg/v3 v3.107.0/go.mod h1:7edfZu4FlrXdIn4339tJ+SQX5VKGqbFntmpc8cai0Zg= +github.com/pulumi/pulumi/sdk/v3 v3.107.0 h1:bef+ayh9+4KkAqXih4EjlHfQXRY24NWPwWBIQhBxTjg= +github.com/pulumi/pulumi/sdk/v3 v3.107.0/go.mod h1:Ml3rpGfyZlI4zQCG7LN2XDSmH4XUNYdyBwJ3yEr/OpI= github.com/pulumi/schema-tools v0.1.2 h1:Fd9xvUjgck4NA+7/jSk7InqCUT4Kj940+EcnbQKpfZo= github.com/pulumi/schema-tools v0.1.2/go.mod h1:62lgj52Tzq11eqWTIaKd+EVyYAu5dEcDJxMhTjvMO/k= github.com/pulumi/terraform-diff-reader v0.0.2 h1:kTE4nEXU3/SYXESvAIem+wyHMI3abqkI3OhJ0G04LLI= diff --git a/sdk/go.mod b/sdk/go.mod index f6927238..355e3792 100644 --- a/sdk/go.mod +++ b/sdk/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( github.com/blang/semver v3.5.1+incompatible - github.com/pulumi/pulumi/sdk/v3 v3.105.0 + github.com/pulumi/pulumi/sdk/v3 v3.107.0 ) require ( diff --git a/sdk/go.sum b/sdk/go.sum index 6b1732e4..e0318b57 100644 --- a/sdk/go.sum +++ b/sdk/go.sum @@ -148,8 +148,8 @@ github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 h1:vkHw5I/plNdTr435 github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231/go.mod h1:murToZ2N9hNJzewjHBgfFdXhZKjY3z5cYC1VXk+lbFE= github.com/pulumi/esc v0.6.2 h1:+z+l8cuwIauLSwXQS0uoI3rqB+YG4SzsZYtHfNoXBvw= github.com/pulumi/esc v0.6.2/go.mod h1:jNnYNjzsOgVTjCp0LL24NsCk8ZJxq4IoLQdCT0X7l8k= -github.com/pulumi/pulumi/sdk/v3 v3.105.0 h1:OKEeubZigWyQVnZS6udnFnZHZ/8OWXuUYv9ir3OY+vs= -github.com/pulumi/pulumi/sdk/v3 v3.105.0/go.mod h1:Ml3rpGfyZlI4zQCG7LN2XDSmH4XUNYdyBwJ3yEr/OpI= +github.com/pulumi/pulumi/sdk/v3 v3.107.0 h1:bef+ayh9+4KkAqXih4EjlHfQXRY24NWPwWBIQhBxTjg= +github.com/pulumi/pulumi/sdk/v3 v3.107.0/go.mod h1:Ml3rpGfyZlI4zQCG7LN2XDSmH4XUNYdyBwJ3yEr/OpI= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= diff --git a/sdk/go/mongodbatlas/networkPeering.go b/sdk/go/mongodbatlas/networkPeering.go index 7b3bc4c4..d079a01c 100644 --- a/sdk/go/mongodbatlas/networkPeering.go +++ b/sdk/go/mongodbatlas/networkPeering.go @@ -49,6 +49,8 @@ import ( // // 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"), @@ -58,6 +60,7 @@ import ( // 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), @@ -70,6 +73,8 @@ import ( // 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), @@ -99,6 +104,8 @@ import ( // // 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"), @@ -107,6 +114,7 @@ import ( // 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, @@ -123,6 +131,7 @@ import ( // 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) { @@ -134,6 +143,7 @@ import ( // 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), @@ -180,6 +190,10 @@ import ( // // 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), @@ -189,6 +203,7 @@ import ( // 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, @@ -201,6 +216,7 @@ import ( // 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"), @@ -249,6 +265,8 @@ import ( // // 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"), @@ -273,6 +291,7 @@ import ( // 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"), @@ -281,6 +300,7 @@ import ( // 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), @@ -293,6 +313,7 @@ import ( // if err != nil { // return err // } +// // Accept the connection // _, err = ec2.NewVpcPeeringConnectionAccepter(ctx, "awsPeer", &ec2.VpcPeeringConnectionAccepterArgs{ // VpcPeeringConnectionId: mongoPeer.ConnectionId, // AutoAccept: pulumi.Bool(true), @@ -324,6 +345,8 @@ import ( // // 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"), @@ -348,6 +371,7 @@ import ( // 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"), @@ -365,6 +389,7 @@ import ( // 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) { @@ -395,6 +420,10 @@ import ( // // 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"), @@ -419,6 +448,7 @@ import ( // 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,