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
new NetworkContainer(name: string, args: NetworkContainerArgs, opts?: CustomResourceOptions);
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)
func NewNetworkContainer(ctx *Context, name string, args NetworkContainerArgs, opts ...ResourceOption) (*NetworkContainer, error)
public NetworkContainer(string name, NetworkContainerArgs args, CustomResourceOptions? opts = null)
- 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:
- Atlas
Cidr stringBlock 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 string Unique identifier for the Atlas project for this Network Peering Container.
- Provider
Name 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.
- Region
Name string The Atlas AWS region name for where this container will exist, see the reference list for Atlas AWS region names AWS.
- Atlas
Cidr stringBlock 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 string Unique identifier for the Atlas project for this Network Peering Container.
- Provider
Name 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.
- Region
Name string The Atlas AWS region name for where this container will exist, see the reference list for Atlas AWS region names AWS.
- atlas
Cidr stringBlock 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 string Unique identifier for the Atlas project for this Network Peering Container.
- provider
Name 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.
- region
Name string The Atlas AWS region name for where this container will exist, see the reference list for Atlas AWS region names AWS.
- atlas_
cidr_ strblock 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:
- Azure
Subscription stringId 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 string The Network Peering Container ID.
- Gcp
Project stringId 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.
- Network
Name 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:
- Vnet
Name string - Vpc
Id string Unique identifier of Atlas’ AWS VPC. CGP ONLY:
- Azure
Subscription stringId 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 string The Network Peering Container ID.
- Gcp
Project stringId 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.
- Network
Name 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:
- Vnet
Name string - Vpc
Id string Unique identifier of Atlas’ AWS VPC. CGP ONLY:
- azure
Subscription stringId 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 string The Network Peering Container ID.
- gcp
Project stringId 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.
- network
Name 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:
- vnet
Name string - vpc
Id string Unique identifier of Atlas’ AWS VPC. CGP ONLY:
- azure_
subscription_ strid 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_ strid 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:
- Atlas
Cidr stringBlock 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 stringId 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 string The Network Peering Container ID.
- Gcp
Project stringId 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 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:
- Project
Id string Unique identifier for the Atlas project for this Network Peering Container.
- Provider
Name 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.
- Region
Name string The Atlas AWS region name for where this container will exist, see the reference list for Atlas AWS region names AWS.
- Vnet
Name string - Vpc
Id string Unique identifier of Atlas’ AWS VPC. CGP ONLY:
- Atlas
Cidr stringBlock 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 stringId 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 string The Network Peering Container ID.
- Gcp
Project stringId 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 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:
- Project
Id string Unique identifier for the Atlas project for this Network Peering Container.
- Provider
Name 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.
- Region
Name string The Atlas AWS region name for where this container will exist, see the reference list for Atlas AWS region names AWS.
- Vnet
Name string - Vpc
Id string Unique identifier of Atlas’ AWS VPC. CGP ONLY:
- atlas
Cidr stringBlock 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 stringId 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 string The Network Peering Container ID.
- gcp
Project stringId 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 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:
- project
Id string Unique identifier for the Atlas project for this Network Peering Container.
- provider
Name 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.
- region
Name string The Atlas AWS region name for where this container will exist, see the reference list for Atlas AWS region names AWS.
- vnet
Name string - vpc
Id string Unique identifier of Atlas’ AWS VPC. CGP ONLY:
- atlas_
cidr_ strblock 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_ strid 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_ strid 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:
Import
Clusters can be imported using project ID and network peering container id, in the format PROJECTID-CONTAINER-ID
, e.g.
$ pulumi import mongodbatlas:index/networkContainer:NetworkContainer my_container 1112222b3bf99403840e8934-5cbf563d87d9d67253be590a
See detailed information for arguments and attributesMongoDB API Network Peering Container
Package Details
- Repository
- https://github.com/pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mongodbatlas
Terraform Provider.