mongodbatlas.NetworkPeering
Explore with Pulumi AI
mongodbatlas.NetworkPeering
provides a Network Peering Connection resource. The resource lets you create, edit and delete network peering connections. The resource requires your Project ID.
Ensure you have first created a network container if it is required for your configuration. See the network_container resource documentation to determine if you need a network container first. Examples for creating both container and peering resource are shown below as well as examples for creating the peering connection only.
GCP AND AZURE ONLY: Connect via Peering Only mode is deprecated, so no longer needed. See disable Peering Only mode for details
AZURE ONLY: To create the peering request with an Azure VNET, you must grant Atlas the following permissions on the virtual network. Microsoft.Network/virtualNetworks/virtualNetworkPeerings/read Microsoft.Network/virtualNetworks/virtualNetworkPeerings/write Microsoft.Network/virtualNetworks/virtualNetworkPeerings/delete Microsoft.Network/virtualNetworks/peer/action For more information see https://docs.atlas.mongodb.com/security-vpc-peering/ and https://docs.atlas.mongodb.com/reference/api/vpc-create-peering-connection/
Create a Whitelist: Ensure you whitelist the private IP ranges of the subnets in which your application is hosted in order to connect to your Atlas cluster. See the project_ip_whitelist resource.
NOTE: Groups and projects are synonymous terms. You may find group_id in the official documentation.
Example Usage
Container & Peering Connection
Example with AWS
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as mongodbatlas from "@pulumi/mongodbatlas";
// Container example provided but not always required,
// see network_container documentation for details.
const test = new mongodbatlas.NetworkContainer("test", {
projectId: projectId,
atlasCidrBlock: "10.8.0.0/21",
providerName: "AWS",
regionName: "US_EAST_1",
});
// Create the peering connection request
const testNetworkPeering = new mongodbatlas.NetworkPeering("test", {
accepterRegionName: "us-east-1",
projectId: projectId,
containerId: "507f1f77bcf86cd799439011",
providerName: "AWS",
routeTableCidrBlock: "192.168.0.0/24",
vpcId: "vpc-abc123abc123",
awsAccountId: "abc123abc123",
});
// the following assumes an AWS provider is configured
// Accept the peering connection request
const peer = new aws.index.VpcPeeringConnectionAccepter("peer", {
vpcPeeringConnectionId: testNetworkPeering.connectionId,
autoAccept: true,
});
import pulumi
import pulumi_aws as aws
import pulumi_mongodbatlas as mongodbatlas
# Container example provided but not always required,
# see network_container documentation for details.
test = mongodbatlas.NetworkContainer("test",
project_id=project_id,
atlas_cidr_block="10.8.0.0/21",
provider_name="AWS",
region_name="US_EAST_1")
# Create the peering connection request
test_network_peering = mongodbatlas.NetworkPeering("test",
accepter_region_name="us-east-1",
project_id=project_id,
container_id="507f1f77bcf86cd799439011",
provider_name="AWS",
route_table_cidr_block="192.168.0.0/24",
vpc_id="vpc-abc123abc123",
aws_account_id="abc123abc123")
# the following assumes an AWS provider is configured
# Accept the peering connection request
peer = aws.index.VpcPeeringConnectionAccepter("peer",
vpc_peering_connection_id=test_network_peering.connection_id,
auto_accept=True)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws"
"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Container example provided but not always required,
// see network_container documentation for details.
_, err := mongodbatlas.NewNetworkContainer(ctx, "test", &mongodbatlas.NetworkContainerArgs{
ProjectId: pulumi.Any(projectId),
AtlasCidrBlock: pulumi.String("10.8.0.0/21"),
ProviderName: pulumi.String("AWS"),
RegionName: pulumi.String("US_EAST_1"),
})
if err != nil {
return err
}
// Create the peering connection request
testNetworkPeering, err := mongodbatlas.NewNetworkPeering(ctx, "test", &mongodbatlas.NetworkPeeringArgs{
AccepterRegionName: pulumi.String("us-east-1"),
ProjectId: pulumi.Any(projectId),
ContainerId: pulumi.String("507f1f77bcf86cd799439011"),
ProviderName: pulumi.String("AWS"),
RouteTableCidrBlock: pulumi.String("192.168.0.0/24"),
VpcId: pulumi.String("vpc-abc123abc123"),
AwsAccountId: pulumi.String("abc123abc123"),
})
if err != nil {
return err
}
// the following assumes an AWS provider is configured
// Accept the peering connection request
_, err = aws.NewVpcPeeringConnectionAccepter(ctx, "peer", &aws.VpcPeeringConnectionAccepterArgs{
VpcPeeringConnectionId: testNetworkPeering.ConnectionId,
AutoAccept: true,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
using Mongodbatlas = Pulumi.Mongodbatlas;
return await Deployment.RunAsync(() =>
{
// Container example provided but not always required,
// see network_container documentation for details.
var test = new Mongodbatlas.NetworkContainer("test", new()
{
ProjectId = projectId,
AtlasCidrBlock = "10.8.0.0/21",
ProviderName = "AWS",
RegionName = "US_EAST_1",
});
// Create the peering connection request
var testNetworkPeering = new Mongodbatlas.NetworkPeering("test", new()
{
AccepterRegionName = "us-east-1",
ProjectId = projectId,
ContainerId = "507f1f77bcf86cd799439011",
ProviderName = "AWS",
RouteTableCidrBlock = "192.168.0.0/24",
VpcId = "vpc-abc123abc123",
AwsAccountId = "abc123abc123",
});
// the following assumes an AWS provider is configured
// Accept the peering connection request
var peer = new Aws.Index.VpcPeeringConnectionAccepter("peer", new()
{
VpcPeeringConnectionId = testNetworkPeering.ConnectionId,
AutoAccept = true,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.NetworkContainer;
import com.pulumi.mongodbatlas.NetworkContainerArgs;
import com.pulumi.mongodbatlas.NetworkPeering;
import com.pulumi.mongodbatlas.NetworkPeeringArgs;
import com.pulumi.aws.vpcPeeringConnectionAccepter;
import com.pulumi.aws.VpcPeeringConnectionAccepterArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// Container example provided but not always required,
// see network_container documentation for details.
var test = new NetworkContainer("test", NetworkContainerArgs.builder()
.projectId(projectId)
.atlasCidrBlock("10.8.0.0/21")
.providerName("AWS")
.regionName("US_EAST_1")
.build());
// Create the peering connection request
var testNetworkPeering = new NetworkPeering("testNetworkPeering", NetworkPeeringArgs.builder()
.accepterRegionName("us-east-1")
.projectId(projectId)
.containerId("507f1f77bcf86cd799439011")
.providerName("AWS")
.routeTableCidrBlock("192.168.0.0/24")
.vpcId("vpc-abc123abc123")
.awsAccountId("abc123abc123")
.build());
// the following assumes an AWS provider is configured
// Accept the peering connection request
var peer = new VpcPeeringConnectionAccepter("peer", VpcPeeringConnectionAccepterArgs.builder()
.vpcPeeringConnectionId(testNetworkPeering.connectionId())
.autoAccept(true)
.build());
}
}
resources:
# Container example provided but not always required,
# see network_container documentation for details.
test:
type: mongodbatlas:NetworkContainer
properties:
projectId: ${projectId}
atlasCidrBlock: 10.8.0.0/21
providerName: AWS
regionName: US_EAST_1
# Create the peering connection request
testNetworkPeering:
type: mongodbatlas:NetworkPeering
name: test
properties:
accepterRegionName: us-east-1
projectId: ${projectId}
containerId: 507f1f77bcf86cd799439011
providerName: AWS
routeTableCidrBlock: 192.168.0.0/24
vpcId: vpc-abc123abc123
awsAccountId: abc123abc123
# the following assumes an AWS provider is configured
# Accept the peering connection request
peer:
type: aws:vpcPeeringConnectionAccepter
properties:
vpcPeeringConnectionId: ${testNetworkPeering.connectionId}
autoAccept: true
Example with Azure
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
// Ensure you have created the required Azure service principal first, see
// see https://docs.atlas.mongodb.com/security-vpc-peering/
// Container example provided but not always required,
// see network_container documentation for details.
const test = new mongodbatlas.NetworkContainer("test", {
projectId: projectId,
atlasCidrBlock: ATLAS_CIDR_BLOCK,
providerName: "AZURE",
region: "US_EAST_2",
});
// Create the peering connection request
const testNetworkPeering = new mongodbatlas.NetworkPeering("test", {
projectId: projectId,
containerId: test.containerId,
providerName: "AZURE",
azureDirectoryId: AZURE_DIRECTORY_ID,
azureSubscriptionId: AZURE_SUBSCRIPTION_ID,
resourceGroupName: AZURE_RESOURCES_GROUP_NAME,
vnetName: AZURE_VNET_NAME,
});
// Create the cluster once the peering connection is completed
const testCluster = new mongodbatlas.Cluster("test", {
projectId: projectId,
name: "terraform-manually-test",
clusterType: "REPLICASET",
replicationSpecs: [{
numShards: 1,
regionsConfigs: [{
regionName: "US_EAST_2",
electableNodes: 3,
priority: 7,
readOnlyNodes: 0,
}],
}],
autoScalingDiskGbEnabled: true,
mongoDbMajorVersion: "7.0",
providerName: "AZURE",
providerDiskTypeName: "P4",
providerInstanceSizeName: "M10",
}, {
dependsOn: [testNetworkPeering],
});
import pulumi
import pulumi_mongodbatlas as mongodbatlas
# Ensure you have created the required Azure service principal first, see
# see https://docs.atlas.mongodb.com/security-vpc-peering/
# Container example provided but not always required,
# see network_container documentation for details.
test = mongodbatlas.NetworkContainer("test",
project_id=project_id,
atlas_cidr_block=atla_s__cid_r__block,
provider_name="AZURE",
region="US_EAST_2")
# Create the peering connection request
test_network_peering = mongodbatlas.NetworkPeering("test",
project_id=project_id,
container_id=test.container_id,
provider_name="AZURE",
azure_directory_id=azur_e__director_y__id,
azure_subscription_id=azur_e__subscriptio_n__id,
resource_group_name=azur_e__resource_s__grou_p__name,
vnet_name=azur_e__vne_t__name)
# Create the cluster once the peering connection is completed
test_cluster = mongodbatlas.Cluster("test",
project_id=project_id,
name="terraform-manually-test",
cluster_type="REPLICASET",
replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(
num_shards=1,
regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(
region_name="US_EAST_2",
electable_nodes=3,
priority=7,
read_only_nodes=0,
)],
)],
auto_scaling_disk_gb_enabled=True,
mongo_db_major_version="7.0",
provider_name="AZURE",
provider_disk_type_name="P4",
provider_instance_size_name="M10",
opts=pulumi.ResourceOptions(depends_on=[test_network_peering]))
package main
import (
"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Ensure you have created the required Azure service principal first, see
// see https://docs.atlas.mongodb.com/security-vpc-peering/
// Container example provided but not always required,
// see network_container documentation for details.
test, err := mongodbatlas.NewNetworkContainer(ctx, "test", &mongodbatlas.NetworkContainerArgs{
ProjectId: pulumi.Any(projectId),
AtlasCidrBlock: pulumi.Any(ATLAS_CIDR_BLOCK),
ProviderName: pulumi.String("AZURE"),
Region: pulumi.String("US_EAST_2"),
})
if err != nil {
return err
}
// Create the peering connection request
testNetworkPeering, err := mongodbatlas.NewNetworkPeering(ctx, "test", &mongodbatlas.NetworkPeeringArgs{
ProjectId: pulumi.Any(projectId),
ContainerId: test.ContainerId,
ProviderName: pulumi.String("AZURE"),
AzureDirectoryId: pulumi.Any(AZURE_DIRECTORY_ID),
AzureSubscriptionId: pulumi.Any(AZURE_SUBSCRIPTION_ID),
ResourceGroupName: pulumi.Any(AZURE_RESOURCES_GROUP_NAME),
VnetName: pulumi.Any(AZURE_VNET_NAME),
})
if err != nil {
return err
}
// Create the cluster once the peering connection is completed
_, err = mongodbatlas.NewCluster(ctx, "test", &mongodbatlas.ClusterArgs{
ProjectId: pulumi.Any(projectId),
Name: pulumi.String("terraform-manually-test"),
ClusterType: pulumi.String("REPLICASET"),
ReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{
&mongodbatlas.ClusterReplicationSpecArgs{
NumShards: pulumi.Int(1),
RegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{
&mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{
RegionName: pulumi.String("US_EAST_2"),
ElectableNodes: pulumi.Int(3),
Priority: pulumi.Int(7),
ReadOnlyNodes: pulumi.Int(0),
},
},
},
},
AutoScalingDiskGbEnabled: pulumi.Bool(true),
MongoDbMajorVersion: pulumi.String("7.0"),
ProviderName: pulumi.String("AZURE"),
ProviderDiskTypeName: pulumi.String("P4"),
ProviderInstanceSizeName: pulumi.String("M10"),
}, pulumi.DependsOn([]pulumi.Resource{
testNetworkPeering,
}))
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
return await Deployment.RunAsync(() =>
{
// Ensure you have created the required Azure service principal first, see
// see https://docs.atlas.mongodb.com/security-vpc-peering/
// Container example provided but not always required,
// see network_container documentation for details.
var test = new Mongodbatlas.NetworkContainer("test", new()
{
ProjectId = projectId,
AtlasCidrBlock = ATLAS_CIDR_BLOCK,
ProviderName = "AZURE",
Region = "US_EAST_2",
});
// Create the peering connection request
var testNetworkPeering = new Mongodbatlas.NetworkPeering("test", new()
{
ProjectId = projectId,
ContainerId = test.ContainerId,
ProviderName = "AZURE",
AzureDirectoryId = AZURE_DIRECTORY_ID,
AzureSubscriptionId = AZURE_SUBSCRIPTION_ID,
ResourceGroupName = AZURE_RESOURCES_GROUP_NAME,
VnetName = AZURE_VNET_NAME,
});
// Create the cluster once the peering connection is completed
var testCluster = new Mongodbatlas.Cluster("test", new()
{
ProjectId = projectId,
Name = "terraform-manually-test",
ClusterType = "REPLICASET",
ReplicationSpecs = new[]
{
new Mongodbatlas.Inputs.ClusterReplicationSpecArgs
{
NumShards = 1,
RegionsConfigs = new[]
{
new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs
{
RegionName = "US_EAST_2",
ElectableNodes = 3,
Priority = 7,
ReadOnlyNodes = 0,
},
},
},
},
AutoScalingDiskGbEnabled = true,
MongoDbMajorVersion = "7.0",
ProviderName = "AZURE",
ProviderDiskTypeName = "P4",
ProviderInstanceSizeName = "M10",
}, new CustomResourceOptions
{
DependsOn =
{
testNetworkPeering,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.NetworkContainer;
import com.pulumi.mongodbatlas.NetworkContainerArgs;
import com.pulumi.mongodbatlas.NetworkPeering;
import com.pulumi.mongodbatlas.NetworkPeeringArgs;
import com.pulumi.mongodbatlas.Cluster;
import com.pulumi.mongodbatlas.ClusterArgs;
import com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// Ensure you have created the required Azure service principal first, see
// see https://docs.atlas.mongodb.com/security-vpc-peering/
// Container example provided but not always required,
// see network_container documentation for details.
var test = new NetworkContainer("test", NetworkContainerArgs.builder()
.projectId(projectId)
.atlasCidrBlock(ATLAS_CIDR_BLOCK)
.providerName("AZURE")
.region("US_EAST_2")
.build());
// Create the peering connection request
var testNetworkPeering = new NetworkPeering("testNetworkPeering", NetworkPeeringArgs.builder()
.projectId(projectId)
.containerId(test.containerId())
.providerName("AZURE")
.azureDirectoryId(AZURE_DIRECTORY_ID)
.azureSubscriptionId(AZURE_SUBSCRIPTION_ID)
.resourceGroupName(AZURE_RESOURCES_GROUP_NAME)
.vnetName(AZURE_VNET_NAME)
.build());
// Create the cluster once the peering connection is completed
var testCluster = new Cluster("testCluster", ClusterArgs.builder()
.projectId(projectId)
.name("terraform-manually-test")
.clusterType("REPLICASET")
.replicationSpecs(ClusterReplicationSpecArgs.builder()
.numShards(1)
.regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()
.regionName("US_EAST_2")
.electableNodes(3)
.priority(7)
.readOnlyNodes(0)
.build())
.build())
.autoScalingDiskGbEnabled(true)
.mongoDbMajorVersion("7.0")
.providerName("AZURE")
.providerDiskTypeName("P4")
.providerInstanceSizeName("M10")
.build(), CustomResourceOptions.builder()
.dependsOn(testNetworkPeering)
.build());
}
}
resources:
# Ensure you have created the required Azure service principal first, see
# see https://docs.atlas.mongodb.com/security-vpc-peering/
# Container example provided but not always required,
# see network_container documentation for details.
test:
type: mongodbatlas:NetworkContainer
properties:
projectId: ${projectId}
atlasCidrBlock: ${ATLAS_CIDR_BLOCK}
providerName: AZURE
region: US_EAST_2
# Create the peering connection request
testNetworkPeering:
type: mongodbatlas:NetworkPeering
name: test
properties:
projectId: ${projectId}
containerId: ${test.containerId}
providerName: AZURE
azureDirectoryId: ${AZURE_DIRECTORY_ID}
azureSubscriptionId: ${AZURE_SUBSCRIPTION_ID}
resourceGroupName: ${AZURE_RESOURCES_GROUP_NAME}
vnetName: ${AZURE_VNET_NAME}
# Create the cluster once the peering connection is completed
testCluster:
type: mongodbatlas:Cluster
name: test
properties:
projectId: ${projectId}
name: terraform-manually-test
clusterType: REPLICASET
replicationSpecs:
- numShards: 1
regionsConfigs:
- regionName: US_EAST_2
electableNodes: 3
priority: 7
readOnlyNodes: 0
autoScalingDiskGbEnabled: true
mongoDbMajorVersion: '7.0'
providerName: AZURE
providerDiskTypeName: P4
providerInstanceSizeName: M10
options:
dependson:
- ${testNetworkPeering}
Peering Connection Only, Container Exists
You can create a peering connection if an appropriate container for your cloud provider already exists in your project (see the network_container resource for more information). A container may already exist if you have already created a cluster in your project, if so you may obtain the container_id
from the cluster resource as shown in the examples below.
Example with AWS
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as mongodbatlas from "@pulumi/mongodbatlas";
// Create an Atlas cluster, this creates a container if one
// does not yet exist for this AWS region
const test = new mongodbatlas.Cluster("test", {
projectId: projectId,
name: "terraform-test",
clusterType: "REPLICASET",
replicationSpecs: [{
numShards: 1,
regionsConfigs: [{
regionName: "US_EAST_2",
electableNodes: 3,
priority: 7,
readOnlyNodes: 0,
}],
}],
autoScalingDiskGbEnabled: false,
mongoDbMajorVersion: "7.0",
providerName: "AWS",
providerInstanceSizeName: "M10",
});
// the following assumes an AWS provider is configured
const _default = new aws.index.DefaultVpc("default", {tags: {
name: "Default VPC",
}});
// Create the peering connection request
const mongoPeer = new mongodbatlas.NetworkPeering("mongo_peer", {
accepterRegionName: "us-east-2",
projectId: projectId,
containerId: test.containerId,
providerName: "AWS",
routeTableCidrBlock: "172.31.0.0/16",
vpcId: _default.id,
awsAccountId: AWS_ACCOUNT_ID,
});
// Accept the connection
const awsPeer = new aws.index.VpcPeeringConnectionAccepter("aws_peer", {
vpcPeeringConnectionId: mongoPeer.connectionId,
autoAccept: true,
tags: {
side: "Accepter",
},
});
import pulumi
import pulumi_aws as aws
import pulumi_mongodbatlas as mongodbatlas
# Create an Atlas cluster, this creates a container if one
# does not yet exist for this AWS region
test = mongodbatlas.Cluster("test",
project_id=project_id,
name="terraform-test",
cluster_type="REPLICASET",
replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(
num_shards=1,
regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(
region_name="US_EAST_2",
electable_nodes=3,
priority=7,
read_only_nodes=0,
)],
)],
auto_scaling_disk_gb_enabled=False,
mongo_db_major_version="7.0",
provider_name="AWS",
provider_instance_size_name="M10")
# the following assumes an AWS provider is configured
default = aws.index.DefaultVpc("default", tags={
name: Default VPC,
})
# Create the peering connection request
mongo_peer = mongodbatlas.NetworkPeering("mongo_peer",
accepter_region_name="us-east-2",
project_id=project_id,
container_id=test.container_id,
provider_name="AWS",
route_table_cidr_block="172.31.0.0/16",
vpc_id=default["id"],
aws_account_id=aw_s__accoun_t__id)
# Accept the connection
aws_peer = aws.index.VpcPeeringConnectionAccepter("aws_peer",
vpc_peering_connection_id=mongo_peer.connection_id,
auto_accept=True,
tags={
side: Accepter,
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws"
"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create an Atlas cluster, this creates a container if one
// does not yet exist for this AWS region
test, err := mongodbatlas.NewCluster(ctx, "test", &mongodbatlas.ClusterArgs{
ProjectId: pulumi.Any(projectId),
Name: pulumi.String("terraform-test"),
ClusterType: pulumi.String("REPLICASET"),
ReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{
&mongodbatlas.ClusterReplicationSpecArgs{
NumShards: pulumi.Int(1),
RegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{
&mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{
RegionName: pulumi.String("US_EAST_2"),
ElectableNodes: pulumi.Int(3),
Priority: pulumi.Int(7),
ReadOnlyNodes: pulumi.Int(0),
},
},
},
},
AutoScalingDiskGbEnabled: pulumi.Bool(false),
MongoDbMajorVersion: pulumi.String("7.0"),
ProviderName: pulumi.String("AWS"),
ProviderInstanceSizeName: pulumi.String("M10"),
})
if err != nil {
return err
}
// the following assumes an AWS provider is configured
_, err = aws.NewDefaultVpc(ctx, "default", &aws.DefaultVpcArgs{
Tags: map[string]interface{}{
"name": "Default VPC",
},
})
if err != nil {
return err
}
// Create the peering connection request
mongoPeer, err := mongodbatlas.NewNetworkPeering(ctx, "mongo_peer", &mongodbatlas.NetworkPeeringArgs{
AccepterRegionName: pulumi.String("us-east-2"),
ProjectId: pulumi.Any(projectId),
ContainerId: test.ContainerId,
ProviderName: pulumi.String("AWS"),
RouteTableCidrBlock: pulumi.String("172.31.0.0/16"),
VpcId: _default.Id,
AwsAccountId: pulumi.Any(AWS_ACCOUNT_ID),
})
if err != nil {
return err
}
// Accept the connection
_, err = aws.NewVpcPeeringConnectionAccepter(ctx, "aws_peer", &aws.VpcPeeringConnectionAccepterArgs{
VpcPeeringConnectionId: mongoPeer.ConnectionId,
AutoAccept: true,
Tags: map[string]interface{}{
"side": "Accepter",
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
using Mongodbatlas = Pulumi.Mongodbatlas;
return await Deployment.RunAsync(() =>
{
// Create an Atlas cluster, this creates a container if one
// does not yet exist for this AWS region
var test = new Mongodbatlas.Cluster("test", new()
{
ProjectId = projectId,
Name = "terraform-test",
ClusterType = "REPLICASET",
ReplicationSpecs = new[]
{
new Mongodbatlas.Inputs.ClusterReplicationSpecArgs
{
NumShards = 1,
RegionsConfigs = new[]
{
new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs
{
RegionName = "US_EAST_2",
ElectableNodes = 3,
Priority = 7,
ReadOnlyNodes = 0,
},
},
},
},
AutoScalingDiskGbEnabled = false,
MongoDbMajorVersion = "7.0",
ProviderName = "AWS",
ProviderInstanceSizeName = "M10",
});
// the following assumes an AWS provider is configured
var @default = new Aws.Index.DefaultVpc("default", new()
{
Tags =
{
{ "name", "Default VPC" },
},
});
// Create the peering connection request
var mongoPeer = new Mongodbatlas.NetworkPeering("mongo_peer", new()
{
AccepterRegionName = "us-east-2",
ProjectId = projectId,
ContainerId = test.ContainerId,
ProviderName = "AWS",
RouteTableCidrBlock = "172.31.0.0/16",
VpcId = @default.Id,
AwsAccountId = AWS_ACCOUNT_ID,
});
// Accept the connection
var awsPeer = new Aws.Index.VpcPeeringConnectionAccepter("aws_peer", new()
{
VpcPeeringConnectionId = mongoPeer.ConnectionId,
AutoAccept = true,
Tags =
{
{ "side", "Accepter" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.Cluster;
import com.pulumi.mongodbatlas.ClusterArgs;
import com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;
import com.pulumi.aws.defaultVpc;
import com.pulumi.aws.DefaultVpcArgs;
import com.pulumi.mongodbatlas.NetworkPeering;
import com.pulumi.mongodbatlas.NetworkPeeringArgs;
import com.pulumi.aws.vpcPeeringConnectionAccepter;
import com.pulumi.aws.VpcPeeringConnectionAccepterArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// Create an Atlas cluster, this creates a container if one
// does not yet exist for this AWS region
var test = new Cluster("test", ClusterArgs.builder()
.projectId(projectId)
.name("terraform-test")
.clusterType("REPLICASET")
.replicationSpecs(ClusterReplicationSpecArgs.builder()
.numShards(1)
.regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()
.regionName("US_EAST_2")
.electableNodes(3)
.priority(7)
.readOnlyNodes(0)
.build())
.build())
.autoScalingDiskGbEnabled(false)
.mongoDbMajorVersion("7.0")
.providerName("AWS")
.providerInstanceSizeName("M10")
.build());
// the following assumes an AWS provider is configured
var default_ = new DefaultVpc("default", DefaultVpcArgs.builder()
.tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build());
// Create the peering connection request
var mongoPeer = new NetworkPeering("mongoPeer", NetworkPeeringArgs.builder()
.accepterRegionName("us-east-2")
.projectId(projectId)
.containerId(test.containerId())
.providerName("AWS")
.routeTableCidrBlock("172.31.0.0/16")
.vpcId(default_.id())
.awsAccountId(AWS_ACCOUNT_ID)
.build());
// Accept the connection
var awsPeer = new VpcPeeringConnectionAccepter("awsPeer", VpcPeeringConnectionAccepterArgs.builder()
.vpcPeeringConnectionId(mongoPeer.connectionId())
.autoAccept(true)
.tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build());
}
}
resources:
# Create an Atlas cluster, this creates a container if one
# does not yet exist for this AWS region
test:
type: mongodbatlas:Cluster
properties:
projectId: ${projectId}
name: terraform-test
clusterType: REPLICASET
replicationSpecs:
- numShards: 1
regionsConfigs:
- regionName: US_EAST_2
electableNodes: 3
priority: 7
readOnlyNodes: 0
autoScalingDiskGbEnabled: false
mongoDbMajorVersion: '7.0'
providerName: AWS
providerInstanceSizeName: M10
# the following assumes an AWS provider is configured
default:
type: aws:defaultVpc
properties:
tags:
name: Default VPC
# Create the peering connection request
mongoPeer:
type: mongodbatlas:NetworkPeering
name: mongo_peer
properties:
accepterRegionName: us-east-2
projectId: ${projectId}
containerId: ${test.containerId}
providerName: AWS
routeTableCidrBlock: 172.31.0.0/16
vpcId: ${default.id}
awsAccountId: ${AWS_ACCOUNT_ID}
# Accept the connection
awsPeer:
type: aws:vpcPeeringConnectionAccepter
name: aws_peer
properties:
vpcPeeringConnectionId: ${mongoPeer.connectionId}
autoAccept: true
tags:
side: Accepter
Example with Azure
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
// Ensure you have created the required Azure service principal first, see
// see https://docs.atlas.mongodb.com/security-vpc-peering/
// Create an Atlas cluster, this creates a container if one
// does not yet exist for this AZURE region
const test = new mongodbatlas.Cluster("test", {
projectId: projectId,
name: "cluster-azure",
clusterType: "REPLICASET",
replicationSpecs: [{
numShards: 1,
regionsConfigs: [{
regionName: "US_EAST_2",
electableNodes: 3,
priority: 7,
readOnlyNodes: 0,
}],
}],
autoScalingDiskGbEnabled: false,
mongoDbMajorVersion: "7.0",
providerName: "AZURE",
providerInstanceSizeName: "M10",
});
// Create the peering connection request
const testNetworkPeering = new mongodbatlas.NetworkPeering("test", {
projectId: projectId,
containerId: test.containerId,
providerName: "AZURE",
azureDirectoryId: AZURE_DIRECTORY_ID,
azureSubscriptionId: AZURE_SUBSCRIPTION_ID,
resourceGroupName: AZURE_RESOURCE_GROUP_NAME,
vnetName: AZURE_VNET_NAME,
});
import pulumi
import pulumi_mongodbatlas as mongodbatlas
# Ensure you have created the required Azure service principal first, see
# see https://docs.atlas.mongodb.com/security-vpc-peering/
# Create an Atlas cluster, this creates a container if one
# does not yet exist for this AZURE region
test = mongodbatlas.Cluster("test",
project_id=project_id,
name="cluster-azure",
cluster_type="REPLICASET",
replication_specs=[mongodbatlas.ClusterReplicationSpecArgs(
num_shards=1,
regions_configs=[mongodbatlas.ClusterReplicationSpecRegionsConfigArgs(
region_name="US_EAST_2",
electable_nodes=3,
priority=7,
read_only_nodes=0,
)],
)],
auto_scaling_disk_gb_enabled=False,
mongo_db_major_version="7.0",
provider_name="AZURE",
provider_instance_size_name="M10")
# Create the peering connection request
test_network_peering = mongodbatlas.NetworkPeering("test",
project_id=project_id,
container_id=test.container_id,
provider_name="AZURE",
azure_directory_id=azur_e__director_y__id,
azure_subscription_id=azur_e__subscriptio_n__id,
resource_group_name=azur_e__resourc_e__grou_p__name,
vnet_name=azur_e__vne_t__name)
package main
import (
"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Ensure you have created the required Azure service principal first, see
// see https://docs.atlas.mongodb.com/security-vpc-peering/
// Create an Atlas cluster, this creates a container if one
// does not yet exist for this AZURE region
test, err := mongodbatlas.NewCluster(ctx, "test", &mongodbatlas.ClusterArgs{
ProjectId: pulumi.Any(projectId),
Name: pulumi.String("cluster-azure"),
ClusterType: pulumi.String("REPLICASET"),
ReplicationSpecs: mongodbatlas.ClusterReplicationSpecArray{
&mongodbatlas.ClusterReplicationSpecArgs{
NumShards: pulumi.Int(1),
RegionsConfigs: mongodbatlas.ClusterReplicationSpecRegionsConfigArray{
&mongodbatlas.ClusterReplicationSpecRegionsConfigArgs{
RegionName: pulumi.String("US_EAST_2"),
ElectableNodes: pulumi.Int(3),
Priority: pulumi.Int(7),
ReadOnlyNodes: pulumi.Int(0),
},
},
},
},
AutoScalingDiskGbEnabled: pulumi.Bool(false),
MongoDbMajorVersion: pulumi.String("7.0"),
ProviderName: pulumi.String("AZURE"),
ProviderInstanceSizeName: pulumi.String("M10"),
})
if err != nil {
return err
}
// Create the peering connection request
_, err = mongodbatlas.NewNetworkPeering(ctx, "test", &mongodbatlas.NetworkPeeringArgs{
ProjectId: pulumi.Any(projectId),
ContainerId: test.ContainerId,
ProviderName: pulumi.String("AZURE"),
AzureDirectoryId: pulumi.Any(AZURE_DIRECTORY_ID),
AzureSubscriptionId: pulumi.Any(AZURE_SUBSCRIPTION_ID),
ResourceGroupName: pulumi.Any(AZURE_RESOURCE_GROUP_NAME),
VnetName: pulumi.Any(AZURE_VNET_NAME),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
return await Deployment.RunAsync(() =>
{
// Ensure you have created the required Azure service principal first, see
// see https://docs.atlas.mongodb.com/security-vpc-peering/
// Create an Atlas cluster, this creates a container if one
// does not yet exist for this AZURE region
var test = new Mongodbatlas.Cluster("test", new()
{
ProjectId = projectId,
Name = "cluster-azure",
ClusterType = "REPLICASET",
ReplicationSpecs = new[]
{
new Mongodbatlas.Inputs.ClusterReplicationSpecArgs
{
NumShards = 1,
RegionsConfigs = new[]
{
new Mongodbatlas.Inputs.ClusterReplicationSpecRegionsConfigArgs
{
RegionName = "US_EAST_2",
ElectableNodes = 3,
Priority = 7,
ReadOnlyNodes = 0,
},
},
},
},
AutoScalingDiskGbEnabled = false,
MongoDbMajorVersion = "7.0",
ProviderName = "AZURE",
ProviderInstanceSizeName = "M10",
});
// Create the peering connection request
var testNetworkPeering = new Mongodbatlas.NetworkPeering("test", new()
{
ProjectId = projectId,
ContainerId = test.ContainerId,
ProviderName = "AZURE",
AzureDirectoryId = AZURE_DIRECTORY_ID,
AzureSubscriptionId = AZURE_SUBSCRIPTION_ID,
ResourceGroupName = AZURE_RESOURCE_GROUP_NAME,
VnetName = AZURE_VNET_NAME,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.Cluster;
import com.pulumi.mongodbatlas.ClusterArgs;
import com.pulumi.mongodbatlas.inputs.ClusterReplicationSpecArgs;
import com.pulumi.mongodbatlas.NetworkPeering;
import com.pulumi.mongodbatlas.NetworkPeeringArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// Ensure you have created the required Azure service principal first, see
// see https://docs.atlas.mongodb.com/security-vpc-peering/
// Create an Atlas cluster, this creates a container if one
// does not yet exist for this AZURE region
var test = new Cluster("test", ClusterArgs.builder()
.projectId(projectId)
.name("cluster-azure")
.clusterType("REPLICASET")
.replicationSpecs(ClusterReplicationSpecArgs.builder()
.numShards(1)
.regionsConfigs(ClusterReplicationSpecRegionsConfigArgs.builder()
.regionName("US_EAST_2")
.electableNodes(3)
.priority(7)
.readOnlyNodes(0)
.build())
.build())
.autoScalingDiskGbEnabled(false)
.mongoDbMajorVersion("7.0")
.providerName("AZURE")
.providerInstanceSizeName("M10")
.build());
// Create the peering connection request
var testNetworkPeering = new NetworkPeering("testNetworkPeering", NetworkPeeringArgs.builder()
.projectId(projectId)
.containerId(test.containerId())
.providerName("AZURE")
.azureDirectoryId(AZURE_DIRECTORY_ID)
.azureSubscriptionId(AZURE_SUBSCRIPTION_ID)
.resourceGroupName(AZURE_RESOURCE_GROUP_NAME)
.vnetName(AZURE_VNET_NAME)
.build());
}
}
resources:
# Ensure you have created the required Azure service principal first, see
# see https://docs.atlas.mongodb.com/security-vpc-peering/
# Create an Atlas cluster, this creates a container if one
# does not yet exist for this AZURE region
test:
type: mongodbatlas:Cluster
properties:
projectId: ${projectId}
name: cluster-azure
clusterType: REPLICASET
replicationSpecs:
- numShards: 1
regionsConfigs:
- regionName: US_EAST_2
electableNodes: 3
priority: 7
readOnlyNodes: 0
autoScalingDiskGbEnabled: false
mongoDbMajorVersion: '7.0'
providerName: AZURE
providerInstanceSizeName: M10
# Create the peering connection request
testNetworkPeering:
type: mongodbatlas:NetworkPeering
name: test
properties:
projectId: ${projectId}
containerId: ${test.containerId}
providerName: AZURE
azureDirectoryId: ${AZURE_DIRECTORY_ID}
azureSubscriptionId: ${AZURE_SUBSCRIPTION_ID}
resourceGroupName: ${AZURE_RESOURCE_GROUP_NAME}
vnetName: ${AZURE_VNET_NAME}
Create NetworkPeering Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new NetworkPeering(name: string, args: NetworkPeeringArgs, opts?: CustomResourceOptions);
@overload
def NetworkPeering(resource_name: str,
args: NetworkPeeringArgs,
opts: Optional[ResourceOptions] = None)
@overload
def NetworkPeering(resource_name: str,
opts: Optional[ResourceOptions] = None,
container_id: Optional[str] = None,
provider_name: Optional[str] = None,
project_id: Optional[str] = None,
gcp_project_id: Optional[str] = None,
aws_account_id: Optional[str] = None,
azure_directory_id: Optional[str] = None,
azure_subscription_id: Optional[str] = None,
atlas_vpc_name: Optional[str] = None,
accepter_region_name: Optional[str] = None,
network_name: Optional[str] = None,
atlas_gcp_project_id: Optional[str] = None,
atlas_cidr_block: Optional[str] = None,
resource_group_name: Optional[str] = None,
route_table_cidr_block: Optional[str] = None,
vnet_name: Optional[str] = None,
vpc_id: Optional[str] = None)
func NewNetworkPeering(ctx *Context, name string, args NetworkPeeringArgs, opts ...ResourceOption) (*NetworkPeering, error)
public NetworkPeering(string name, NetworkPeeringArgs args, CustomResourceOptions? opts = null)
public NetworkPeering(String name, NetworkPeeringArgs args)
public NetworkPeering(String name, NetworkPeeringArgs args, CustomResourceOptions options)
type: mongodbatlas:NetworkPeering
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args NetworkPeeringArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args NetworkPeeringArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args NetworkPeeringArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NetworkPeeringArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NetworkPeeringArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var networkPeeringResource = new Mongodbatlas.NetworkPeering("networkPeeringResource", new()
{
ContainerId = "string",
ProviderName = "string",
ProjectId = "string",
GcpProjectId = "string",
AwsAccountId = "string",
AzureDirectoryId = "string",
AzureSubscriptionId = "string",
AtlasVpcName = "string",
AccepterRegionName = "string",
NetworkName = "string",
AtlasGcpProjectId = "string",
AtlasCidrBlock = "string",
ResourceGroupName = "string",
RouteTableCidrBlock = "string",
VnetName = "string",
VpcId = "string",
});
example, err := mongodbatlas.NewNetworkPeering(ctx, "networkPeeringResource", &mongodbatlas.NetworkPeeringArgs{
ContainerId: pulumi.String("string"),
ProviderName: pulumi.String("string"),
ProjectId: pulumi.String("string"),
GcpProjectId: pulumi.String("string"),
AwsAccountId: pulumi.String("string"),
AzureDirectoryId: pulumi.String("string"),
AzureSubscriptionId: pulumi.String("string"),
AtlasVpcName: pulumi.String("string"),
AccepterRegionName: pulumi.String("string"),
NetworkName: pulumi.String("string"),
AtlasGcpProjectId: pulumi.String("string"),
AtlasCidrBlock: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
RouteTableCidrBlock: pulumi.String("string"),
VnetName: pulumi.String("string"),
VpcId: pulumi.String("string"),
})
var networkPeeringResource = new NetworkPeering("networkPeeringResource", NetworkPeeringArgs.builder()
.containerId("string")
.providerName("string")
.projectId("string")
.gcpProjectId("string")
.awsAccountId("string")
.azureDirectoryId("string")
.azureSubscriptionId("string")
.atlasVpcName("string")
.accepterRegionName("string")
.networkName("string")
.atlasGcpProjectId("string")
.atlasCidrBlock("string")
.resourceGroupName("string")
.routeTableCidrBlock("string")
.vnetName("string")
.vpcId("string")
.build());
network_peering_resource = mongodbatlas.NetworkPeering("networkPeeringResource",
container_id="string",
provider_name="string",
project_id="string",
gcp_project_id="string",
aws_account_id="string",
azure_directory_id="string",
azure_subscription_id="string",
atlas_vpc_name="string",
accepter_region_name="string",
network_name="string",
atlas_gcp_project_id="string",
atlas_cidr_block="string",
resource_group_name="string",
route_table_cidr_block="string",
vnet_name="string",
vpc_id="string")
const networkPeeringResource = new mongodbatlas.NetworkPeering("networkPeeringResource", {
containerId: "string",
providerName: "string",
projectId: "string",
gcpProjectId: "string",
awsAccountId: "string",
azureDirectoryId: "string",
azureSubscriptionId: "string",
atlasVpcName: "string",
accepterRegionName: "string",
networkName: "string",
atlasGcpProjectId: "string",
atlasCidrBlock: "string",
resourceGroupName: "string",
routeTableCidrBlock: "string",
vnetName: "string",
vpcId: "string",
});
type: mongodbatlas:NetworkPeering
properties:
accepterRegionName: string
atlasCidrBlock: string
atlasGcpProjectId: string
atlasVpcName: string
awsAccountId: string
azureDirectoryId: string
azureSubscriptionId: string
containerId: string
gcpProjectId: string
networkName: string
projectId: string
providerName: string
resourceGroupName: string
routeTableCidrBlock: string
vnetName: string
vpcId: string
NetworkPeering Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The NetworkPeering resource accepts the following input properties:
- Container
Id string - Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
- Project
Id string - The unique ID for the MongoDB Atlas project to create the database user.
- Provider
Name string Cloud provider to whom the peering connection is being made. (Possible Values
AWS
,AZURE
,GCP
).AWS ONLY:
- Accepter
Region stringName - Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
- Atlas
Cidr stringBlock - Atlas
Gcp stringProject Id - The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- Atlas
Vpc stringName - Name of the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- Aws
Account stringId - AWS Account ID of the owner of the peer VPC.
- Azure
Directory stringId - Unique identifier for an Azure AD directory.
- Azure
Subscription stringId - Unique identifier of the Azure subscription in which the VNet resides.
- Gcp
Project stringId - GCP project ID of the owner of the network peer.
- Network
Name string Name of the network peer to which Atlas connects.
AZURE ONLY:
- Resource
Group stringName - Name of your Azure resource group.
- Route
Table stringCidr Block AWS VPC CIDR block or subnet.
GCP ONLY:
- Vnet
Name string - Name of your Azure VNet.
- Vpc
Id string - Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
- Container
Id string - Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
- Project
Id string - The unique ID for the MongoDB Atlas project to create the database user.
- Provider
Name string Cloud provider to whom the peering connection is being made. (Possible Values
AWS
,AZURE
,GCP
).AWS ONLY:
- Accepter
Region stringName - Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
- Atlas
Cidr stringBlock - Atlas
Gcp stringProject Id - The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- Atlas
Vpc stringName - Name of the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- Aws
Account stringId - AWS Account ID of the owner of the peer VPC.
- Azure
Directory stringId - Unique identifier for an Azure AD directory.
- Azure
Subscription stringId - Unique identifier of the Azure subscription in which the VNet resides.
- Gcp
Project stringId - GCP project ID of the owner of the network peer.
- Network
Name string Name of the network peer to which Atlas connects.
AZURE ONLY:
- Resource
Group stringName - Name of your Azure resource group.
- Route
Table stringCidr Block AWS VPC CIDR block or subnet.
GCP ONLY:
- Vnet
Name string - Name of your Azure VNet.
- Vpc
Id string - Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
- container
Id String - Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
- project
Id String - The unique ID for the MongoDB Atlas project to create the database user.
- provider
Name String Cloud provider to whom the peering connection is being made. (Possible Values
AWS
,AZURE
,GCP
).AWS ONLY:
- accepter
Region StringName - Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
- atlas
Cidr StringBlock - atlas
Gcp StringProject Id - The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- atlas
Vpc StringName - Name of the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- aws
Account StringId - AWS Account ID of the owner of the peer VPC.
- azure
Directory StringId - Unique identifier for an Azure AD directory.
- azure
Subscription StringId - Unique identifier of the Azure subscription in which the VNet resides.
- gcp
Project StringId - GCP project ID of the owner of the network peer.
- network
Name String Name of the network peer to which Atlas connects.
AZURE ONLY:
- resource
Group StringName - Name of your Azure resource group.
- route
Table StringCidr Block AWS VPC CIDR block or subnet.
GCP ONLY:
- vnet
Name String - Name of your Azure VNet.
- vpc
Id String - Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
- container
Id string - Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
- project
Id string - The unique ID for the MongoDB Atlas project to create the database user.
- provider
Name string Cloud provider to whom the peering connection is being made. (Possible Values
AWS
,AZURE
,GCP
).AWS ONLY:
- accepter
Region stringName - Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
- atlas
Cidr stringBlock - atlas
Gcp stringProject Id - The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- atlas
Vpc stringName - Name of the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- aws
Account stringId - AWS Account ID of the owner of the peer VPC.
- azure
Directory stringId - Unique identifier for an Azure AD directory.
- azure
Subscription stringId - Unique identifier of the Azure subscription in which the VNet resides.
- gcp
Project stringId - GCP project ID of the owner of the network peer.
- network
Name string Name of the network peer to which Atlas connects.
AZURE ONLY:
- resource
Group stringName - Name of your Azure resource group.
- route
Table stringCidr Block AWS VPC CIDR block or subnet.
GCP ONLY:
- vnet
Name string - Name of your Azure VNet.
- vpc
Id string - Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
- container_
id str - Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
- project_
id str - The unique ID for the MongoDB Atlas project to create the database user.
- provider_
name str Cloud provider to whom the peering connection is being made. (Possible Values
AWS
,AZURE
,GCP
).AWS ONLY:
- accepter_
region_ strname - Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
- atlas_
cidr_ strblock - atlas_
gcp_ strproject_ id - The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- atlas_
vpc_ strname - Name of the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- aws_
account_ strid - AWS Account ID of the owner of the peer VPC.
- azure_
directory_ strid - Unique identifier for an Azure AD directory.
- azure_
subscription_ strid - Unique identifier of the Azure subscription in which the VNet resides.
- gcp_
project_ strid - GCP project ID of the owner of the network peer.
- network_
name str Name of the network peer to which Atlas connects.
AZURE ONLY:
- resource_
group_ strname - Name of your Azure resource group.
- route_
table_ strcidr_ block AWS VPC CIDR block or subnet.
GCP ONLY:
- vnet_
name str - Name of your Azure VNet.
- vpc_
id str - Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
- container
Id String - Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
- project
Id String - The unique ID for the MongoDB Atlas project to create the database user.
- provider
Name String Cloud provider to whom the peering connection is being made. (Possible Values
AWS
,AZURE
,GCP
).AWS ONLY:
- accepter
Region StringName - Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
- atlas
Cidr StringBlock - atlas
Gcp StringProject Id - The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- atlas
Vpc StringName - Name of the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- aws
Account StringId - AWS Account ID of the owner of the peer VPC.
- azure
Directory StringId - Unique identifier for an Azure AD directory.
- azure
Subscription StringId - Unique identifier of the Azure subscription in which the VNet resides.
- gcp
Project StringId - GCP project ID of the owner of the network peer.
- network
Name String Name of the network peer to which Atlas connects.
AZURE ONLY:
- resource
Group StringName - Name of your Azure resource group.
- route
Table StringCidr Block AWS VPC CIDR block or subnet.
GCP ONLY:
- vnet
Name String - Name of your Azure VNet.
- vpc
Id String - Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
Outputs
All input properties are implicitly available as output properties. Additionally, the NetworkPeering resource produces the following output properties:
- Atlas
Id string - Connection
Id string - Unique identifier of the Atlas network peering container.
- Error
Message string - When
"status" : "FAILED"
, Atlas provides a description of the error. - Error
State string - Description of the Atlas error when
status
isFailed
, Otherwise, Atlas returnsnull
. - Error
State stringName - Error state, if any. The VPC peering connection error state value can be one of the following:
REJECTED
,EXPIRED
,INVALID_ARGUMENT
. - Id string
- The provider-assigned unique ID for this managed resource.
- Peer
Id string - Unique identifier of the Atlas network peer.
- Status string
- Status of the Atlas network peering connection. Azure/GCP:
ADDING_PEER
,AVAILABLE
,FAILED
,DELETING
GCP Only:WAITING_FOR_USER
. - Status
Name string - (AWS Only) The VPC peering connection status value can be one of the following:
INITIATING
,PENDING_ACCEPTANCE
,FAILED
,FINALIZING
,AVAILABLE
,TERMINATING
.
- Atlas
Id string - Connection
Id string - Unique identifier of the Atlas network peering container.
- Error
Message string - When
"status" : "FAILED"
, Atlas provides a description of the error. - Error
State string - Description of the Atlas error when
status
isFailed
, Otherwise, Atlas returnsnull
. - Error
State stringName - Error state, if any. The VPC peering connection error state value can be one of the following:
REJECTED
,EXPIRED
,INVALID_ARGUMENT
. - Id string
- The provider-assigned unique ID for this managed resource.
- Peer
Id string - Unique identifier of the Atlas network peer.
- Status string
- Status of the Atlas network peering connection. Azure/GCP:
ADDING_PEER
,AVAILABLE
,FAILED
,DELETING
GCP Only:WAITING_FOR_USER
. - Status
Name string - (AWS Only) The VPC peering connection status value can be one of the following:
INITIATING
,PENDING_ACCEPTANCE
,FAILED
,FINALIZING
,AVAILABLE
,TERMINATING
.
- atlas
Id String - connection
Id String - Unique identifier of the Atlas network peering container.
- error
Message String - When
"status" : "FAILED"
, Atlas provides a description of the error. - error
State String - Description of the Atlas error when
status
isFailed
, Otherwise, Atlas returnsnull
. - error
State StringName - Error state, if any. The VPC peering connection error state value can be one of the following:
REJECTED
,EXPIRED
,INVALID_ARGUMENT
. - id String
- The provider-assigned unique ID for this managed resource.
- peer
Id String - Unique identifier of the Atlas network peer.
- status String
- Status of the Atlas network peering connection. Azure/GCP:
ADDING_PEER
,AVAILABLE
,FAILED
,DELETING
GCP Only:WAITING_FOR_USER
. - status
Name String - (AWS Only) The VPC peering connection status value can be one of the following:
INITIATING
,PENDING_ACCEPTANCE
,FAILED
,FINALIZING
,AVAILABLE
,TERMINATING
.
- atlas
Id string - connection
Id string - Unique identifier of the Atlas network peering container.
- error
Message string - When
"status" : "FAILED"
, Atlas provides a description of the error. - error
State string - Description of the Atlas error when
status
isFailed
, Otherwise, Atlas returnsnull
. - error
State stringName - Error state, if any. The VPC peering connection error state value can be one of the following:
REJECTED
,EXPIRED
,INVALID_ARGUMENT
. - id string
- The provider-assigned unique ID for this managed resource.
- peer
Id string - Unique identifier of the Atlas network peer.
- status string
- Status of the Atlas network peering connection. Azure/GCP:
ADDING_PEER
,AVAILABLE
,FAILED
,DELETING
GCP Only:WAITING_FOR_USER
. - status
Name string - (AWS Only) The VPC peering connection status value can be one of the following:
INITIATING
,PENDING_ACCEPTANCE
,FAILED
,FINALIZING
,AVAILABLE
,TERMINATING
.
- atlas_
id str - connection_
id str - Unique identifier of the Atlas network peering container.
- error_
message str - When
"status" : "FAILED"
, Atlas provides a description of the error. - error_
state str - Description of the Atlas error when
status
isFailed
, Otherwise, Atlas returnsnull
. - error_
state_ strname - Error state, if any. The VPC peering connection error state value can be one of the following:
REJECTED
,EXPIRED
,INVALID_ARGUMENT
. - id str
- The provider-assigned unique ID for this managed resource.
- peer_
id str - Unique identifier of the Atlas network peer.
- status str
- Status of the Atlas network peering connection. Azure/GCP:
ADDING_PEER
,AVAILABLE
,FAILED
,DELETING
GCP Only:WAITING_FOR_USER
. - status_
name str - (AWS Only) The VPC peering connection status value can be one of the following:
INITIATING
,PENDING_ACCEPTANCE
,FAILED
,FINALIZING
,AVAILABLE
,TERMINATING
.
- atlas
Id String - connection
Id String - Unique identifier of the Atlas network peering container.
- error
Message String - When
"status" : "FAILED"
, Atlas provides a description of the error. - error
State String - Description of the Atlas error when
status
isFailed
, Otherwise, Atlas returnsnull
. - error
State StringName - Error state, if any. The VPC peering connection error state value can be one of the following:
REJECTED
,EXPIRED
,INVALID_ARGUMENT
. - id String
- The provider-assigned unique ID for this managed resource.
- peer
Id String - Unique identifier of the Atlas network peer.
- status String
- Status of the Atlas network peering connection. Azure/GCP:
ADDING_PEER
,AVAILABLE
,FAILED
,DELETING
GCP Only:WAITING_FOR_USER
. - status
Name String - (AWS Only) The VPC peering connection status value can be one of the following:
INITIATING
,PENDING_ACCEPTANCE
,FAILED
,FINALIZING
,AVAILABLE
,TERMINATING
.
Look up Existing NetworkPeering Resource
Get an existing NetworkPeering resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: NetworkPeeringState, opts?: CustomResourceOptions): NetworkPeering
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
accepter_region_name: Optional[str] = None,
atlas_cidr_block: Optional[str] = None,
atlas_gcp_project_id: Optional[str] = None,
atlas_id: Optional[str] = None,
atlas_vpc_name: Optional[str] = None,
aws_account_id: Optional[str] = None,
azure_directory_id: Optional[str] = None,
azure_subscription_id: Optional[str] = None,
connection_id: Optional[str] = None,
container_id: Optional[str] = None,
error_message: Optional[str] = None,
error_state: Optional[str] = None,
error_state_name: Optional[str] = None,
gcp_project_id: Optional[str] = None,
network_name: Optional[str] = None,
peer_id: Optional[str] = None,
project_id: Optional[str] = None,
provider_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
route_table_cidr_block: Optional[str] = None,
status: Optional[str] = None,
status_name: Optional[str] = None,
vnet_name: Optional[str] = None,
vpc_id: Optional[str] = None) -> NetworkPeering
func GetNetworkPeering(ctx *Context, name string, id IDInput, state *NetworkPeeringState, opts ...ResourceOption) (*NetworkPeering, error)
public static NetworkPeering Get(string name, Input<string> id, NetworkPeeringState? state, CustomResourceOptions? opts = null)
public static NetworkPeering get(String name, Output<String> id, NetworkPeeringState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Accepter
Region stringName - Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
- Atlas
Cidr stringBlock - Atlas
Gcp stringProject Id - The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- Atlas
Id string - Atlas
Vpc stringName - Name of the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- Aws
Account stringId - AWS Account ID of the owner of the peer VPC.
- Azure
Directory stringId - Unique identifier for an Azure AD directory.
- Azure
Subscription stringId - Unique identifier of the Azure subscription in which the VNet resides.
- Connection
Id string - Unique identifier of the Atlas network peering container.
- Container
Id string - Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
- Error
Message string - When
"status" : "FAILED"
, Atlas provides a description of the error. - Error
State string - Description of the Atlas error when
status
isFailed
, Otherwise, Atlas returnsnull
. - Error
State stringName - Error state, if any. The VPC peering connection error state value can be one of the following:
REJECTED
,EXPIRED
,INVALID_ARGUMENT
. - Gcp
Project stringId - GCP project ID of the owner of the network peer.
- Network
Name string Name of the network peer to which Atlas connects.
AZURE ONLY:
- Peer
Id string - Unique identifier of the Atlas network peer.
- Project
Id string - The unique ID for the MongoDB Atlas project to create the database user.
- Provider
Name string Cloud provider to whom the peering connection is being made. (Possible Values
AWS
,AZURE
,GCP
).AWS ONLY:
- Resource
Group stringName - Name of your Azure resource group.
- Route
Table stringCidr Block AWS VPC CIDR block or subnet.
GCP ONLY:
- Status string
- Status of the Atlas network peering connection. Azure/GCP:
ADDING_PEER
,AVAILABLE
,FAILED
,DELETING
GCP Only:WAITING_FOR_USER
. - Status
Name string - (AWS Only) The VPC peering connection status value can be one of the following:
INITIATING
,PENDING_ACCEPTANCE
,FAILED
,FINALIZING
,AVAILABLE
,TERMINATING
. - Vnet
Name string - Name of your Azure VNet.
- Vpc
Id string - Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
- Accepter
Region stringName - Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
- Atlas
Cidr stringBlock - Atlas
Gcp stringProject Id - The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- Atlas
Id string - Atlas
Vpc stringName - Name of the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- Aws
Account stringId - AWS Account ID of the owner of the peer VPC.
- Azure
Directory stringId - Unique identifier for an Azure AD directory.
- Azure
Subscription stringId - Unique identifier of the Azure subscription in which the VNet resides.
- Connection
Id string - Unique identifier of the Atlas network peering container.
- Container
Id string - Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
- Error
Message string - When
"status" : "FAILED"
, Atlas provides a description of the error. - Error
State string - Description of the Atlas error when
status
isFailed
, Otherwise, Atlas returnsnull
. - Error
State stringName - Error state, if any. The VPC peering connection error state value can be one of the following:
REJECTED
,EXPIRED
,INVALID_ARGUMENT
. - Gcp
Project stringId - GCP project ID of the owner of the network peer.
- Network
Name string Name of the network peer to which Atlas connects.
AZURE ONLY:
- Peer
Id string - Unique identifier of the Atlas network peer.
- Project
Id string - The unique ID for the MongoDB Atlas project to create the database user.
- Provider
Name string Cloud provider to whom the peering connection is being made. (Possible Values
AWS
,AZURE
,GCP
).AWS ONLY:
- Resource
Group stringName - Name of your Azure resource group.
- Route
Table stringCidr Block AWS VPC CIDR block or subnet.
GCP ONLY:
- Status string
- Status of the Atlas network peering connection. Azure/GCP:
ADDING_PEER
,AVAILABLE
,FAILED
,DELETING
GCP Only:WAITING_FOR_USER
. - Status
Name string - (AWS Only) The VPC peering connection status value can be one of the following:
INITIATING
,PENDING_ACCEPTANCE
,FAILED
,FINALIZING
,AVAILABLE
,TERMINATING
. - Vnet
Name string - Name of your Azure VNet.
- Vpc
Id string - Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
- accepter
Region StringName - Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
- atlas
Cidr StringBlock - atlas
Gcp StringProject Id - The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- atlas
Id String - atlas
Vpc StringName - Name of the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- aws
Account StringId - AWS Account ID of the owner of the peer VPC.
- azure
Directory StringId - Unique identifier for an Azure AD directory.
- azure
Subscription StringId - Unique identifier of the Azure subscription in which the VNet resides.
- connection
Id String - Unique identifier of the Atlas network peering container.
- container
Id String - Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
- error
Message String - When
"status" : "FAILED"
, Atlas provides a description of the error. - error
State String - Description of the Atlas error when
status
isFailed
, Otherwise, Atlas returnsnull
. - error
State StringName - Error state, if any. The VPC peering connection error state value can be one of the following:
REJECTED
,EXPIRED
,INVALID_ARGUMENT
. - gcp
Project StringId - GCP project ID of the owner of the network peer.
- network
Name String Name of the network peer to which Atlas connects.
AZURE ONLY:
- peer
Id String - Unique identifier of the Atlas network peer.
- project
Id String - The unique ID for the MongoDB Atlas project to create the database user.
- provider
Name String Cloud provider to whom the peering connection is being made. (Possible Values
AWS
,AZURE
,GCP
).AWS ONLY:
- resource
Group StringName - Name of your Azure resource group.
- route
Table StringCidr Block AWS VPC CIDR block or subnet.
GCP ONLY:
- status String
- Status of the Atlas network peering connection. Azure/GCP:
ADDING_PEER
,AVAILABLE
,FAILED
,DELETING
GCP Only:WAITING_FOR_USER
. - status
Name String - (AWS Only) The VPC peering connection status value can be one of the following:
INITIATING
,PENDING_ACCEPTANCE
,FAILED
,FINALIZING
,AVAILABLE
,TERMINATING
. - vnet
Name String - Name of your Azure VNet.
- vpc
Id String - Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
- accepter
Region stringName - Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
- atlas
Cidr stringBlock - atlas
Gcp stringProject Id - The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- atlas
Id string - atlas
Vpc stringName - Name of the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- aws
Account stringId - AWS Account ID of the owner of the peer VPC.
- azure
Directory stringId - Unique identifier for an Azure AD directory.
- azure
Subscription stringId - Unique identifier of the Azure subscription in which the VNet resides.
- connection
Id string - Unique identifier of the Atlas network peering container.
- container
Id string - Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
- error
Message string - When
"status" : "FAILED"
, Atlas provides a description of the error. - error
State string - Description of the Atlas error when
status
isFailed
, Otherwise, Atlas returnsnull
. - error
State stringName - Error state, if any. The VPC peering connection error state value can be one of the following:
REJECTED
,EXPIRED
,INVALID_ARGUMENT
. - gcp
Project stringId - GCP project ID of the owner of the network peer.
- network
Name string Name of the network peer to which Atlas connects.
AZURE ONLY:
- peer
Id string - Unique identifier of the Atlas network peer.
- project
Id string - The unique ID for the MongoDB Atlas project to create the database user.
- provider
Name string Cloud provider to whom the peering connection is being made. (Possible Values
AWS
,AZURE
,GCP
).AWS ONLY:
- resource
Group stringName - Name of your Azure resource group.
- route
Table stringCidr Block AWS VPC CIDR block or subnet.
GCP ONLY:
- status string
- Status of the Atlas network peering connection. Azure/GCP:
ADDING_PEER
,AVAILABLE
,FAILED
,DELETING
GCP Only:WAITING_FOR_USER
. - status
Name string - (AWS Only) The VPC peering connection status value can be one of the following:
INITIATING
,PENDING_ACCEPTANCE
,FAILED
,FINALIZING
,AVAILABLE
,TERMINATING
. - vnet
Name string - Name of your Azure VNet.
- vpc
Id string - Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
- accepter_
region_ strname - Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
- atlas_
cidr_ strblock - atlas_
gcp_ strproject_ id - The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- atlas_
id str - atlas_
vpc_ strname - Name of the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- aws_
account_ strid - AWS Account ID of the owner of the peer VPC.
- azure_
directory_ strid - Unique identifier for an Azure AD directory.
- azure_
subscription_ strid - Unique identifier of the Azure subscription in which the VNet resides.
- connection_
id str - Unique identifier of the Atlas network peering container.
- container_
id str - Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
- error_
message str - When
"status" : "FAILED"
, Atlas provides a description of the error. - error_
state str - Description of the Atlas error when
status
isFailed
, Otherwise, Atlas returnsnull
. - error_
state_ strname - Error state, if any. The VPC peering connection error state value can be one of the following:
REJECTED
,EXPIRED
,INVALID_ARGUMENT
. - gcp_
project_ strid - GCP project ID of the owner of the network peer.
- network_
name str Name of the network peer to which Atlas connects.
AZURE ONLY:
- peer_
id str - Unique identifier of the Atlas network peer.
- project_
id str - The unique ID for the MongoDB Atlas project to create the database user.
- provider_
name str Cloud provider to whom the peering connection is being made. (Possible Values
AWS
,AZURE
,GCP
).AWS ONLY:
- resource_
group_ strname - Name of your Azure resource group.
- route_
table_ strcidr_ block AWS VPC CIDR block or subnet.
GCP ONLY:
- status str
- Status of the Atlas network peering connection. Azure/GCP:
ADDING_PEER
,AVAILABLE
,FAILED
,DELETING
GCP Only:WAITING_FOR_USER
. - status_
name str - (AWS Only) The VPC peering connection status value can be one of the following:
INITIATING
,PENDING_ACCEPTANCE
,FAILED
,FINALIZING
,AVAILABLE
,TERMINATING
. - vnet_
name str - Name of your Azure VNet.
- vpc_
id str - Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
- accepter
Region StringName - Specifies the AWS region where the peer VPC resides. For complete lists of supported regions, see Amazon Web Services.
- atlas
Cidr StringBlock - atlas
Gcp StringProject Id - The Atlas GCP Project ID for the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- atlas
Id String - atlas
Vpc StringName - Name of the GCP VPC used by your atlas cluster that is needed to set up the reciprocal connection.
- aws
Account StringId - AWS Account ID of the owner of the peer VPC.
- azure
Directory StringId - Unique identifier for an Azure AD directory.
- azure
Subscription StringId - Unique identifier of the Azure subscription in which the VNet resides.
- connection
Id String - Unique identifier of the Atlas network peering container.
- container
Id String - Unique identifier of the MongoDB Atlas container for the provider (GCP) or provider/region (AWS, AZURE). You can create an MongoDB Atlas container using the network_container resource or it can be obtained from the cluster returned values if a cluster has been created before the first container.
- error
Message String - When
"status" : "FAILED"
, Atlas provides a description of the error. - error
State String - Description of the Atlas error when
status
isFailed
, Otherwise, Atlas returnsnull
. - error
State StringName - Error state, if any. The VPC peering connection error state value can be one of the following:
REJECTED
,EXPIRED
,INVALID_ARGUMENT
. - gcp
Project StringId - GCP project ID of the owner of the network peer.
- network
Name String Name of the network peer to which Atlas connects.
AZURE ONLY:
- peer
Id String - Unique identifier of the Atlas network peer.
- project
Id String - The unique ID for the MongoDB Atlas project to create the database user.
- provider
Name String Cloud provider to whom the peering connection is being made. (Possible Values
AWS
,AZURE
,GCP
).AWS ONLY:
- resource
Group StringName - Name of your Azure resource group.
- route
Table StringCidr Block AWS VPC CIDR block or subnet.
GCP ONLY:
- status String
- Status of the Atlas network peering connection. Azure/GCP:
ADDING_PEER
,AVAILABLE
,FAILED
,DELETING
GCP Only:WAITING_FOR_USER
. - status
Name String - (AWS Only) The VPC peering connection status value can be one of the following:
INITIATING
,PENDING_ACCEPTANCE
,FAILED
,FINALIZING
,AVAILABLE
,TERMINATING
. - vnet
Name String - Name of your Azure VNet.
- vpc
Id String - Unique identifier of the AWS peer VPC (Note: this is not the same as the Atlas AWS VPC that is returned by the network_container resource).
Import
Network Peering Connections can be imported using project ID and network peering id, in the format PROJECTID-PEERID-PROVIDERNAME
, e.g.
$ pulumi import mongodbatlas:index/networkPeering:NetworkPeering my_peering 1112222b3bf99403840e8934-5cbf563d87d9d67253be590a-AWS
See detailed information for arguments and attributes: MongoDB API Network Peering Connection
-> NOTE: If you need to get an existing container ID see the How-To Guide.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- MongoDB Atlas pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mongodbatlas
Terraform Provider.