Want to learn about running containers in Lambda? Join our free hands-on workshop. Register Now

NetworkContainer

mongodbatlas.NetworkContainer provides a Network Peering Container resource. The resource lets you create, edit and delete network peering containers. The resource requires your Project ID. Each cloud provider requires slightly different attributes so read the argument reference carefully.

Network peering container is a general term used to describe any cloud providers’ VPC/VNet concept. Containers only need to be created if the peering connection to the cloud provider will be created before the first cluster that requires the container. If the cluster has been/will be created first Atlas automatically creates the required container per the “containers per cloud provider” information that follows (in this case you can obtain the container id from the cluster resource attribute container_id).

The following is the maximum number of Network Peering containers per cloud provider:
• GCP - One container per project.
• AWS and Azure - One container per cloud provider region.

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

Example Usage

Example with AWS

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
    public MyStack()
    {
        var test = new Mongodbatlas.NetworkContainer("test", new Mongodbatlas.NetworkContainerArgs
        {
            AtlasCidrBlock = "10.8.0.0/21",
            ProjectId = "<YOUR-PROJECT-ID>",
            ProviderName = "AWS",
            RegionName = "US_EAST_1",
        });
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := mongodbatlas.NewNetworkContainer(ctx, "test", &mongodbatlas.NetworkContainerArgs{
            AtlasCidrBlock: pulumi.String("10.8.0.0/21"),
            ProjectId:      pulumi.String("<YOUR-PROJECT-ID>"),
            ProviderName:   pulumi.String("AWS"),
            RegionName:     pulumi.String("US_EAST_1"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_mongodbatlas as mongodbatlas

test = mongodbatlas.NetworkContainer("test",
    atlas_cidr_block="10.8.0.0/21",
    project_id="<YOUR-PROJECT-ID>",
    provider_name="AWS",
    region_name="US_EAST_1")
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";

const test = new mongodbatlas.NetworkContainer("test", {
    atlasCidrBlock: "10.8.0.0/21",
    projectId: "<YOUR-PROJECT-ID>",
    providerName: "AWS",
    regionName: "US_EAST_1",
});

Example with GCP

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
    public MyStack()
    {
        var test = new Mongodbatlas.NetworkContainer("test", new Mongodbatlas.NetworkContainerArgs
        {
            AtlasCidrBlock = "10.8.0.0/21",
            ProjectId = "<YOUR-PROJECT-ID>",
            ProviderName = "GCP",
        });
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := mongodbatlas.NewNetworkContainer(ctx, "test", &mongodbatlas.NetworkContainerArgs{
            AtlasCidrBlock: pulumi.String("10.8.0.0/21"),
            ProjectId:      pulumi.String("<YOUR-PROJECT-ID>"),
            ProviderName:   pulumi.String("GCP"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_mongodbatlas as mongodbatlas

test = mongodbatlas.NetworkContainer("test",
    atlas_cidr_block="10.8.0.0/21",
    project_id="<YOUR-PROJECT-ID>",
    provider_name="GCP")
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";

const test = new mongodbatlas.NetworkContainer("test", {
    atlasCidrBlock: "10.8.0.0/21",
    projectId: "<YOUR-PROJECT-ID>",
    providerName: "GCP",
});

Example with Azure

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
    public MyStack()
    {
        var test = new Mongodbatlas.NetworkContainer("test", new Mongodbatlas.NetworkContainerArgs
        {
            AtlasCidrBlock = "10.8.0.0/21",
            ProjectId = "<YOUR-PROJECT-ID>",
            ProviderName = "AZURE",
            Region = "US_EAST_2",
        });
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := mongodbatlas.NewNetworkContainer(ctx, "test", &mongodbatlas.NetworkContainerArgs{
            AtlasCidrBlock: pulumi.String("10.8.0.0/21"),
            ProjectId:      pulumi.String("<YOUR-PROJECT-ID>"),
            ProviderName:   pulumi.String("AZURE"),
            Region:         pulumi.String("US_EAST_2"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_mongodbatlas as mongodbatlas

test = mongodbatlas.NetworkContainer("test",
    atlas_cidr_block="10.8.0.0/21",
    project_id="<YOUR-PROJECT-ID>",
    provider_name="AZURE",
    region="US_EAST_2")
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";

const test = new mongodbatlas.NetworkContainer("test", {
    atlasCidrBlock: "10.8.0.0/21",
    projectId: "<YOUR-PROJECT-ID>",
    providerName: "AZURE",
    region: "US_EAST_2",
});

Create a NetworkContainer Resource

def NetworkContainer(resource_name: str, opts: Optional[ResourceOptions] = None, atlas_cidr_block: Optional[str] = None, project_id: Optional[str] = None, provider_name: Optional[str] = None, region: Optional[str] = None, region_name: Optional[str] = None)
name string
The unique name of the resource.
args NetworkContainerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args NetworkContainerArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args NetworkContainerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

NetworkContainer Resource Properties

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

Inputs

The NetworkContainer resource accepts the following input properties:

AtlasCidrBlock string

CIDR block that Atlas uses for the Network Peering containers in your project. Atlas uses the specified CIDR block for all other Network Peering connections created in the project. The Atlas CIDR block must be at least a /24 and at most a /21 in one of the following private networks: * Lower bound: 10.0.0.0 - Upper bound: 10.255.255.255 - Prefix: 10/8 * Lower bound: 172.16.0.0 - Upper bound:172.31.255.255 - Prefix: 172.16/12 * Lower bound: 192.168.0.0 - Upper bound:192.168.255.255 - Prefix: 192.168/16

ProjectId string

Unique identifier for the Atlas project for this Network Peering Container.

ProviderName string

Cloud provider for this Network Peering connection. Accepted values are GCP, AWS, AZURE. If omitted, Atlas sets this parameter to AWS.

Region string

Atlas region where the container resides, see the reference list for Atlas Azure region names Azure.

RegionName string

The Atlas AWS region name for where this container will exist, see the reference list for Atlas AWS region names AWS.

AtlasCidrBlock string

CIDR block that Atlas uses for the Network Peering containers in your project. Atlas uses the specified CIDR block for all other Network Peering connections created in the project. The Atlas CIDR block must be at least a /24 and at most a /21 in one of the following private networks: * Lower bound: 10.0.0.0 - Upper bound: 10.255.255.255 - Prefix: 10/8 * Lower bound: 172.16.0.0 - Upper bound:172.31.255.255 - Prefix: 172.16/12 * Lower bound: 192.168.0.0 - Upper bound:192.168.255.255 - Prefix: 192.168/16

ProjectId string

Unique identifier for the Atlas project for this Network Peering Container.

ProviderName string

Cloud provider for this Network Peering connection. Accepted values are GCP, AWS, AZURE. If omitted, Atlas sets this parameter to AWS.

Region string

Atlas region where the container resides, see the reference list for Atlas Azure region names Azure.

RegionName string

The Atlas AWS region name for where this container will exist, see the reference list for Atlas AWS region names AWS.

atlasCidrBlock string

CIDR block that Atlas uses for the Network Peering containers in your project. Atlas uses the specified CIDR block for all other Network Peering connections created in the project. The Atlas CIDR block must be at least a /24 and at most a /21 in one of the following private networks: * Lower bound: 10.0.0.0 - Upper bound: 10.255.255.255 - Prefix: 10/8 * Lower bound: 172.16.0.0 - Upper bound:172.31.255.255 - Prefix: 172.16/12 * Lower bound: 192.168.0.0 - Upper bound:192.168.255.255 - Prefix: 192.168/16

projectId string

Unique identifier for the Atlas project for this Network Peering Container.

providerName string

Cloud provider for this Network Peering connection. Accepted values are GCP, AWS, AZURE. If omitted, Atlas sets this parameter to AWS.

region string

Atlas region where the container resides, see the reference list for Atlas Azure region names Azure.

regionName string

The Atlas AWS region name for where this container will exist, see the reference list for Atlas AWS region names AWS.

atlas_cidr_block str

CIDR block that Atlas uses for the Network Peering containers in your project. Atlas uses the specified CIDR block for all other Network Peering connections created in the project. The Atlas CIDR block must be at least a /24 and at most a /21 in one of the following private networks: * Lower bound: 10.0.0.0 - Upper bound: 10.255.255.255 - Prefix: 10/8 * Lower bound: 172.16.0.0 - Upper bound:172.31.255.255 - Prefix: 172.16/12 * Lower bound: 192.168.0.0 - Upper bound:192.168.255.255 - Prefix: 192.168/16

project_id str

Unique identifier for the Atlas project for this Network Peering Container.

provider_name str

Cloud provider for this Network Peering connection. Accepted values are GCP, AWS, AZURE. If omitted, Atlas sets this parameter to AWS.

region str

Atlas region where the container resides, see the reference list for Atlas Azure region names Azure.

region_name str

The Atlas AWS region name for where this container will exist, see the reference list for Atlas AWS region names AWS.

Outputs

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

AzureSubscriptionId string

Unique identifier of the Azure subscription in which the VNet resides. * * vnet_name - The name of the Azure VNet. Returns null. This value is populated once you create a new network peering connection with the network peering resource.

ContainerId string

The Network Peering Container ID.

GcpProjectId string

Unique identifier of the GCP project in which the network peer resides. Returns null. This value is populated once you create a new network peering connection with the network peering resource.

Id string
The provider-assigned unique ID for this managed resource.
NetworkName string

Unique identifier of the Network Peering connection in the Atlas project. Returns null. This value is populated once you create a new network peering connection with the network peering resource. AZURE ONLY:

Provisioned bool

Indicates whether the project has Network Peering connections deployed in the container. AWS ONLY:

VnetName string
VpcId string

Unique identifier of Atlas’ AWS VPC. CGP ONLY:

AzureSubscriptionId string

Unique identifier of the Azure subscription in which the VNet resides. * * vnet_name - The name of the Azure VNet. Returns null. This value is populated once you create a new network peering connection with the network peering resource.

ContainerId string

The Network Peering Container ID.

GcpProjectId string

Unique identifier of the GCP project in which the network peer resides. Returns null. This value is populated once you create a new network peering connection with the network peering resource.

Id string
The provider-assigned unique ID for this managed resource.
NetworkName string

Unique identifier of the Network Peering connection in the Atlas project. Returns null. This value is populated once you create a new network peering connection with the network peering resource. AZURE ONLY:

Provisioned bool

Indicates whether the project has Network Peering connections deployed in the container. AWS ONLY:

VnetName string
VpcId string

Unique identifier of Atlas’ AWS VPC. CGP ONLY:

azureSubscriptionId string

Unique identifier of the Azure subscription in which the VNet resides. * * vnet_name - The name of the Azure VNet. Returns null. This value is populated once you create a new network peering connection with the network peering resource.

containerId string

The Network Peering Container ID.

gcpProjectId string

Unique identifier of the GCP project in which the network peer resides. Returns null. This value is populated once you create a new network peering connection with the network peering resource.

id string
The provider-assigned unique ID for this managed resource.
networkName string

Unique identifier of the Network Peering connection in the Atlas project. Returns null. This value is populated once you create a new network peering connection with the network peering resource. AZURE ONLY:

provisioned boolean

Indicates whether the project has Network Peering connections deployed in the container. AWS ONLY:

vnetName string
vpcId string

Unique identifier of Atlas’ AWS VPC. CGP ONLY:

azure_subscription_id str

Unique identifier of the Azure subscription in which the VNet resides. * * vnet_name - The name of the Azure VNet. Returns null. This value is populated once you create a new network peering connection with the network peering resource.

container_id str

The Network Peering Container ID.

gcp_project_id str

Unique identifier of the GCP project in which the network peer resides. Returns null. This value is populated once you create a new network peering connection with the network peering resource.

id str
The provider-assigned unique ID for this managed resource.
network_name str

Unique identifier of the Network Peering connection in the Atlas project. Returns null. This value is populated once you create a new network peering connection with the network peering resource. AZURE ONLY:

provisioned bool

Indicates whether the project has Network Peering connections deployed in the container. AWS ONLY:

vnet_name str
vpc_id str

Unique identifier of Atlas’ AWS VPC. CGP ONLY:

Look up an Existing NetworkContainer Resource

Get an existing NetworkContainer 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?: NetworkContainerState, opts?: CustomResourceOptions): NetworkContainer
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, atlas_cidr_block: Optional[str] = None, azure_subscription_id: Optional[str] = None, container_id: Optional[str] = None, gcp_project_id: Optional[str] = None, network_name: Optional[str] = None, project_id: Optional[str] = None, provider_name: Optional[str] = None, provisioned: Optional[bool] = None, region: Optional[str] = None, region_name: Optional[str] = None, vnet_name: Optional[str] = None, vpc_id: Optional[str] = None) -> NetworkContainer
func GetNetworkContainer(ctx *Context, name string, id IDInput, state *NetworkContainerState, opts ...ResourceOption) (*NetworkContainer, error)
public static NetworkContainer Get(string name, Input<string> id, NetworkContainerState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

AtlasCidrBlock string

CIDR block that Atlas uses for the Network Peering containers in your project. Atlas uses the specified CIDR block for all other Network Peering connections created in the project. The Atlas CIDR block must be at least a /24 and at most a /21 in one of the following private networks: * Lower bound: 10.0.0.0 - Upper bound: 10.255.255.255 - Prefix: 10/8 * Lower bound: 172.16.0.0 - Upper bound:172.31.255.255 - Prefix: 172.16/12 * Lower bound: 192.168.0.0 - Upper bound:192.168.255.255 - Prefix: 192.168/16

AzureSubscriptionId string

Unique identifier of the Azure subscription in which the VNet resides. * * vnet_name - The name of the Azure VNet. Returns null. This value is populated once you create a new network peering connection with the network peering resource.

ContainerId string

The Network Peering Container ID.

GcpProjectId string

Unique identifier of the GCP project in which the network peer resides. Returns null. This value is populated once you create a new network peering connection with the network peering resource.

NetworkName string

Unique identifier of the Network Peering connection in the Atlas project. Returns null. This value is populated once you create a new network peering connection with the network peering resource. AZURE ONLY:

ProjectId string

Unique identifier for the Atlas project for this Network Peering Container.

ProviderName string

Cloud provider for this Network Peering connection. Accepted values are GCP, AWS, AZURE. If omitted, Atlas sets this parameter to AWS.

Provisioned bool

Indicates whether the project has Network Peering connections deployed in the container. AWS ONLY:

Region string

Atlas region where the container resides, see the reference list for Atlas Azure region names Azure.

RegionName string

The Atlas AWS region name for where this container will exist, see the reference list for Atlas AWS region names AWS.

VnetName string
VpcId string

Unique identifier of Atlas’ AWS VPC. CGP ONLY:

AtlasCidrBlock string

CIDR block that Atlas uses for the Network Peering containers in your project. Atlas uses the specified CIDR block for all other Network Peering connections created in the project. The Atlas CIDR block must be at least a /24 and at most a /21 in one of the following private networks: * Lower bound: 10.0.0.0 - Upper bound: 10.255.255.255 - Prefix: 10/8 * Lower bound: 172.16.0.0 - Upper bound:172.31.255.255 - Prefix: 172.16/12 * Lower bound: 192.168.0.0 - Upper bound:192.168.255.255 - Prefix: 192.168/16

AzureSubscriptionId string

Unique identifier of the Azure subscription in which the VNet resides. * * vnet_name - The name of the Azure VNet. Returns null. This value is populated once you create a new network peering connection with the network peering resource.

ContainerId string

The Network Peering Container ID.

GcpProjectId string

Unique identifier of the GCP project in which the network peer resides. Returns null. This value is populated once you create a new network peering connection with the network peering resource.

NetworkName string

Unique identifier of the Network Peering connection in the Atlas project. Returns null. This value is populated once you create a new network peering connection with the network peering resource. AZURE ONLY:

ProjectId string

Unique identifier for the Atlas project for this Network Peering Container.

ProviderName string

Cloud provider for this Network Peering connection. Accepted values are GCP, AWS, AZURE. If omitted, Atlas sets this parameter to AWS.

Provisioned bool

Indicates whether the project has Network Peering connections deployed in the container. AWS ONLY:

Region string

Atlas region where the container resides, see the reference list for Atlas Azure region names Azure.

RegionName string

The Atlas AWS region name for where this container will exist, see the reference list for Atlas AWS region names AWS.

VnetName string
VpcId string

Unique identifier of Atlas’ AWS VPC. CGP ONLY:

atlasCidrBlock string

CIDR block that Atlas uses for the Network Peering containers in your project. Atlas uses the specified CIDR block for all other Network Peering connections created in the project. The Atlas CIDR block must be at least a /24 and at most a /21 in one of the following private networks: * Lower bound: 10.0.0.0 - Upper bound: 10.255.255.255 - Prefix: 10/8 * Lower bound: 172.16.0.0 - Upper bound:172.31.255.255 - Prefix: 172.16/12 * Lower bound: 192.168.0.0 - Upper bound:192.168.255.255 - Prefix: 192.168/16

azureSubscriptionId string

Unique identifier of the Azure subscription in which the VNet resides. * * vnet_name - The name of the Azure VNet. Returns null. This value is populated once you create a new network peering connection with the network peering resource.

containerId string

The Network Peering Container ID.

gcpProjectId string

Unique identifier of the GCP project in which the network peer resides. Returns null. This value is populated once you create a new network peering connection with the network peering resource.

networkName string

Unique identifier of the Network Peering connection in the Atlas project. Returns null. This value is populated once you create a new network peering connection with the network peering resource. AZURE ONLY:

projectId string

Unique identifier for the Atlas project for this Network Peering Container.

providerName string

Cloud provider for this Network Peering connection. Accepted values are GCP, AWS, AZURE. If omitted, Atlas sets this parameter to AWS.

provisioned boolean

Indicates whether the project has Network Peering connections deployed in the container. AWS ONLY:

region string

Atlas region where the container resides, see the reference list for Atlas Azure region names Azure.

regionName string

The Atlas AWS region name for where this container will exist, see the reference list for Atlas AWS region names AWS.

vnetName string
vpcId string

Unique identifier of Atlas’ AWS VPC. CGP ONLY:

atlas_cidr_block str

CIDR block that Atlas uses for the Network Peering containers in your project. Atlas uses the specified CIDR block for all other Network Peering connections created in the project. The Atlas CIDR block must be at least a /24 and at most a /21 in one of the following private networks: * Lower bound: 10.0.0.0 - Upper bound: 10.255.255.255 - Prefix: 10/8 * Lower bound: 172.16.0.0 - Upper bound:172.31.255.255 - Prefix: 172.16/12 * Lower bound: 192.168.0.0 - Upper bound:192.168.255.255 - Prefix: 192.168/16

azure_subscription_id str

Unique identifier of the Azure subscription in which the VNet resides. * * vnet_name - The name of the Azure VNet. Returns null. This value is populated once you create a new network peering connection with the network peering resource.

container_id str

The Network Peering Container ID.

gcp_project_id str

Unique identifier of the GCP project in which the network peer resides. Returns null. This value is populated once you create a new network peering connection with the network peering resource.

network_name str

Unique identifier of the Network Peering connection in the Atlas project. Returns null. This value is populated once you create a new network peering connection with the network peering resource. AZURE ONLY:

project_id str

Unique identifier for the Atlas project for this Network Peering Container.

provider_name str

Cloud provider for this Network Peering connection. Accepted values are GCP, AWS, AZURE. If omitted, Atlas sets this parameter to AWS.

provisioned bool

Indicates whether the project has Network Peering connections deployed in the container. AWS ONLY:

region str

Atlas region where the container resides, see the reference list for Atlas Azure region names Azure.

region_name str

The Atlas AWS region name for where this container will exist, see the reference list for Atlas AWS region names AWS.

vnet_name str
vpc_id str

Unique identifier of Atlas’ AWS VPC. CGP ONLY:

Package Details

Repository
https://github.com/pulumi/pulumi-mongodbatlas
License
Apache-2.0
Notes
This Pulumi package is based on the mongodbatlas Terraform Provider.