1. Packages
  2. MongoDB Atlas
  3. API Docs
  4. getNetworkContainer
MongoDB Atlas v3.16.2 published on Friday, Jun 21, 2024 by Pulumi

mongodbatlas.getNetworkContainer

Explore with Pulumi AI

mongodbatlas logo
MongoDB Atlas v3.16.2 published on Friday, Jun 21, 2024 by Pulumi

    mongodbatlas.NetworkContainer describes a Network Peering Container. The resource requires your Project ID and container ID.

    IMPORTANT: This resource creates one Network Peering container into which Atlas can deploy Network Peering connections. An Atlas project can have a maximum of one container for each cloud provider. You must have either the Project Owner or Organization Owner role to successfully call this endpoint.

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

    Example Usage

    Basic Example.

    import * as pulumi from "@pulumi/pulumi";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    const testNetworkContainer = new mongodbatlas.NetworkContainer("test", {
        projectId: "<YOUR-PROJECT-ID>",
        atlasCidrBlock: "10.8.0.0/21",
        providerName: "AWS",
        regionName: "US_EAST_1",
    });
    const test = mongodbatlas.getNetworkContainerOutput({
        projectId: testNetworkContainer.projectId,
        containerId: testNetworkContainer.id,
    });
    
    import pulumi
    import pulumi_mongodbatlas as mongodbatlas
    
    test_network_container = mongodbatlas.NetworkContainer("test",
        project_id="<YOUR-PROJECT-ID>",
        atlas_cidr_block="10.8.0.0/21",
        provider_name="AWS",
        region_name="US_EAST_1")
    test = mongodbatlas.get_network_container_output(project_id=test_network_container.project_id,
        container_id=test_network_container.id)
    
    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 {
    		testNetworkContainer, err := mongodbatlas.NewNetworkContainer(ctx, "test", &mongodbatlas.NetworkContainerArgs{
    			ProjectId:      pulumi.String("<YOUR-PROJECT-ID>"),
    			AtlasCidrBlock: pulumi.String("10.8.0.0/21"),
    			ProviderName:   pulumi.String("AWS"),
    			RegionName:     pulumi.String("US_EAST_1"),
    		})
    		if err != nil {
    			return err
    		}
    		_ = mongodbatlas.LookupNetworkContainerOutput(ctx, mongodbatlas.GetNetworkContainerOutputArgs{
    			ProjectId:   testNetworkContainer.ProjectId,
    			ContainerId: testNetworkContainer.ID(),
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        var testNetworkContainer = new Mongodbatlas.NetworkContainer("test", new()
        {
            ProjectId = "<YOUR-PROJECT-ID>",
            AtlasCidrBlock = "10.8.0.0/21",
            ProviderName = "AWS",
            RegionName = "US_EAST_1",
        });
    
        var test = Mongodbatlas.GetNetworkContainer.Invoke(new()
        {
            ProjectId = testNetworkContainer.ProjectId,
            ContainerId = testNetworkContainer.Id,
        });
    
    });
    
    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.MongodbatlasFunctions;
    import com.pulumi.mongodbatlas.inputs.GetNetworkContainerArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var testNetworkContainer = new NetworkContainer("testNetworkContainer", NetworkContainerArgs.builder()
                .projectId("<YOUR-PROJECT-ID>")
                .atlasCidrBlock("10.8.0.0/21")
                .providerName("AWS")
                .regionName("US_EAST_1")
                .build());
    
            final var test = MongodbatlasFunctions.getNetworkContainer(GetNetworkContainerArgs.builder()
                .projectId(testNetworkContainer.projectId())
                .containerId(testNetworkContainer.id())
                .build());
    
        }
    }
    
    resources:
      testNetworkContainer:
        type: mongodbatlas:NetworkContainer
        name: test
        properties:
          projectId: <YOUR-PROJECT-ID>
          atlasCidrBlock: 10.8.0.0/21
          providerName: AWS
          regionName: US_EAST_1
    variables:
      test:
        fn::invoke:
          Function: mongodbatlas:getNetworkContainer
          Arguments:
            projectId: ${testNetworkContainer.projectId}
            containerId: ${testNetworkContainer.id}
    

    Using getNetworkContainer

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getNetworkContainer(args: GetNetworkContainerArgs, opts?: InvokeOptions): Promise<GetNetworkContainerResult>
    function getNetworkContainerOutput(args: GetNetworkContainerOutputArgs, opts?: InvokeOptions): Output<GetNetworkContainerResult>
    def get_network_container(container_id: Optional[str] = None,
                              project_id: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetNetworkContainerResult
    def get_network_container_output(container_id: Optional[pulumi.Input[str]] = None,
                              project_id: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetNetworkContainerResult]
    func LookupNetworkContainer(ctx *Context, args *LookupNetworkContainerArgs, opts ...InvokeOption) (*LookupNetworkContainerResult, error)
    func LookupNetworkContainerOutput(ctx *Context, args *LookupNetworkContainerOutputArgs, opts ...InvokeOption) LookupNetworkContainerResultOutput

    > Note: This function is named LookupNetworkContainer in the Go SDK.

    public static class GetNetworkContainer 
    {
        public static Task<GetNetworkContainerResult> InvokeAsync(GetNetworkContainerArgs args, InvokeOptions? opts = null)
        public static Output<GetNetworkContainerResult> Invoke(GetNetworkContainerInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNetworkContainerResult> getNetworkContainer(GetNetworkContainerArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: mongodbatlas:index/getNetworkContainer:getNetworkContainer
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ContainerId string
    The Network Peering Container ID.
    ProjectId string
    The unique ID for the project to create the database user.
    ContainerId string
    The Network Peering Container ID.
    ProjectId string
    The unique ID for the project to create the database user.
    containerId String
    The Network Peering Container ID.
    projectId String
    The unique ID for the project to create the database user.
    containerId string
    The Network Peering Container ID.
    projectId string
    The unique ID for the project to create the database user.
    container_id str
    The Network Peering Container ID.
    project_id str
    The unique ID for the project to create the database user.
    containerId String
    The Network Peering Container ID.
    projectId String
    The unique ID for the project to create the database user.

    getNetworkContainer Result

    The following output properties are available:

    AtlasCidrBlock string
    CIDR block that Atlas uses for your clusters. 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.
    AzureSubscriptionId string
    Unique identifer of the Azure subscription in which the VNet resides.
    ContainerId string
    GcpProjectId string
    Unique identifier of the GCP project in which the Network Peering connection resides.
    Id string
    The provider-assigned unique ID for this managed resource.
    NetworkName string
    Name of the Network Peering connection in the Atlas project.
    ProjectId string
    ProviderName string
    Cloud provider for this Network Peering connection. If omitted, Atlas sets this parameter to AWS.
    Provisioned bool
    Indicates whether the project has Network Peering connections deployed in the container.
    Region string
    The Atlas Azure region name for where this container will exist.
    RegionName string
    The Atlas AWS region name for where this container will exist.
    Regions List<string>
    Atlas GCP regions where the container resides.
    VnetName string
    The name of the Azure VNet. This value is null until you provision an Azure VNet in the container.
    VpcId string
    Unique identifier of the project’s VPC.
    AtlasCidrBlock string
    CIDR block that Atlas uses for your clusters. 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.
    AzureSubscriptionId string
    Unique identifer of the Azure subscription in which the VNet resides.
    ContainerId string
    GcpProjectId string
    Unique identifier of the GCP project in which the Network Peering connection resides.
    Id string
    The provider-assigned unique ID for this managed resource.
    NetworkName string
    Name of the Network Peering connection in the Atlas project.
    ProjectId string
    ProviderName string
    Cloud provider for this Network Peering connection. If omitted, Atlas sets this parameter to AWS.
    Provisioned bool
    Indicates whether the project has Network Peering connections deployed in the container.
    Region string
    The Atlas Azure region name for where this container will exist.
    RegionName string
    The Atlas AWS region name for where this container will exist.
    Regions []string
    Atlas GCP regions where the container resides.
    VnetName string
    The name of the Azure VNet. This value is null until you provision an Azure VNet in the container.
    VpcId string
    Unique identifier of the project’s VPC.
    atlasCidrBlock String
    CIDR block that Atlas uses for your clusters. 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.
    azureSubscriptionId String
    Unique identifer of the Azure subscription in which the VNet resides.
    containerId String
    gcpProjectId String
    Unique identifier of the GCP project in which the Network Peering connection resides.
    id String
    The provider-assigned unique ID for this managed resource.
    networkName String
    Name of the Network Peering connection in the Atlas project.
    projectId String
    providerName String
    Cloud provider for this Network Peering connection. If omitted, Atlas sets this parameter to AWS.
    provisioned Boolean
    Indicates whether the project has Network Peering connections deployed in the container.
    region String
    The Atlas Azure region name for where this container will exist.
    regionName String
    The Atlas AWS region name for where this container will exist.
    regions List<String>
    Atlas GCP regions where the container resides.
    vnetName String
    The name of the Azure VNet. This value is null until you provision an Azure VNet in the container.
    vpcId String
    Unique identifier of the project’s VPC.
    atlasCidrBlock string
    CIDR block that Atlas uses for your clusters. 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.
    azureSubscriptionId string
    Unique identifer of the Azure subscription in which the VNet resides.
    containerId string
    gcpProjectId string
    Unique identifier of the GCP project in which the Network Peering connection resides.
    id string
    The provider-assigned unique ID for this managed resource.
    networkName string
    Name of the Network Peering connection in the Atlas project.
    projectId string
    providerName string
    Cloud provider for this Network Peering connection. If omitted, Atlas sets this parameter to AWS.
    provisioned boolean
    Indicates whether the project has Network Peering connections deployed in the container.
    region string
    The Atlas Azure region name for where this container will exist.
    regionName string
    The Atlas AWS region name for where this container will exist.
    regions string[]
    Atlas GCP regions where the container resides.
    vnetName string
    The name of the Azure VNet. This value is null until you provision an Azure VNet in the container.
    vpcId string
    Unique identifier of the project’s VPC.
    atlas_cidr_block str
    CIDR block that Atlas uses for your clusters. 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.
    azure_subscription_id str
    Unique identifer of the Azure subscription in which the VNet resides.
    container_id str
    gcp_project_id str
    Unique identifier of the GCP project in which the Network Peering connection resides.
    id str
    The provider-assigned unique ID for this managed resource.
    network_name str
    Name of the Network Peering connection in the Atlas project.
    project_id str
    provider_name str
    Cloud provider for this Network Peering connection. If omitted, Atlas sets this parameter to AWS.
    provisioned bool
    Indicates whether the project has Network Peering connections deployed in the container.
    region str
    The Atlas Azure region name for where this container will exist.
    region_name str
    The Atlas AWS region name for where this container will exist.
    regions Sequence[str]
    Atlas GCP regions where the container resides.
    vnet_name str
    The name of the Azure VNet. This value is null until you provision an Azure VNet in the container.
    vpc_id str
    Unique identifier of the project’s VPC.
    atlasCidrBlock String
    CIDR block that Atlas uses for your clusters. 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.
    azureSubscriptionId String
    Unique identifer of the Azure subscription in which the VNet resides.
    containerId String
    gcpProjectId String
    Unique identifier of the GCP project in which the Network Peering connection resides.
    id String
    The provider-assigned unique ID for this managed resource.
    networkName String
    Name of the Network Peering connection in the Atlas project.
    projectId String
    providerName String
    Cloud provider for this Network Peering connection. If omitted, Atlas sets this parameter to AWS.
    provisioned Boolean
    Indicates whether the project has Network Peering connections deployed in the container.
    region String
    The Atlas Azure region name for where this container will exist.
    regionName String
    The Atlas AWS region name for where this container will exist.
    regions List<String>
    Atlas GCP regions where the container resides.
    vnetName String
    The name of the Azure VNet. This value is null until you provision an Azure VNet in the container.
    vpcId String
    Unique identifier of the project’s VPC.

    Package Details

    Repository
    MongoDB Atlas pulumi/pulumi-mongodbatlas
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the mongodbatlas Terraform Provider.
    mongodbatlas logo
    MongoDB Atlas v3.16.2 published on Friday, Jun 21, 2024 by Pulumi