Show / Hide Table of Contents

Class ProjectIpWhitelist

mongodbatlas..ProjectIpWhitelist provides an IP Whitelist entry resource. The whitelist grants access from IPs, CIDRs or AWS Security Groups (if VPC Peering is enabled) to clusters within the Project.

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

IMPORTANT: When you remove an entry from the whitelist, existing connections from the removed address(es) may remain open for a variable amount of time. How much time passes before Atlas closes the connection depends on several factors, including how the connection was established, the particular behavior of the application or driver using the address, and the connection protocol (e.g., TCP or UDP). This is particularly important to consider when changing an existing IP address or CIDR block as they cannot be updated via the Provider (comments can however), hence a change will force the destruction and recreation of entries.

Example Usage

Using CIDR Block

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var test = new Mongodbatlas.ProjectIpWhitelist("test", new Mongodbatlas.ProjectIpWhitelistArgs
    {
        CidrBlock = "1.2.3.4/32",
        Comment = "cidr block for tf acc testing",
        ProjectId = "<PROJECT-ID>",
    });
}

}

Using IP Address

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var test = new Mongodbatlas.ProjectIpWhitelist("test", new Mongodbatlas.ProjectIpWhitelistArgs
    {
        Comment = "ip address for tf acc testing",
        IpAddress = "2.3.4.5",
        ProjectId = "<PROJECT-ID>",
    });
}

}

Using an AWS Security Group

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var testNetworkContainer = new Mongodbatlas.NetworkContainer("testNetworkContainer", new Mongodbatlas.NetworkContainerArgs
    {
        ProjectId = "<PROJECT-ID>",
        AtlasCidrBlock = "192.168.208.0/21",
        ProviderName = "AWS",
        RegionName = "US_EAST_1",
    });
    var testNetworkPeering = new Mongodbatlas.NetworkPeering("testNetworkPeering", new Mongodbatlas.NetworkPeeringArgs
    {
        ProjectId = "<PROJECT-ID>",
        ContainerId = testNetworkContainer.ContainerId,
        AccepterRegionName = "us-east-1",
        ProviderName = "AWS",
        RouteTableCidrBlock = "172.31.0.0/16",
        VpcId = "vpc-0d93d6f69f1578bd8",
        AwsAccountId = "232589400519",
    });
    var testProjectIpWhitelist = new Mongodbatlas.ProjectIpWhitelist("testProjectIpWhitelist", new Mongodbatlas.ProjectIpWhitelistArgs
    {
        ProjectId = "<PROJECT-ID>",
        AwsSecurityGroup = "sg-0026348ec11780bd1",
        Comment = "TestAcc for awsSecurityGroup",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
ProjectIpWhitelist
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Mongodbatlas
Assembly: Pulumi.Mongodbatlas.dll
Syntax
public class ProjectIpWhitelist : CustomResource

Constructors

View Source

ProjectIpWhitelist(String, ProjectIpWhitelistArgs, CustomResourceOptions)

Create a ProjectIpWhitelist resource with the given unique name, arguments, and options.

Declaration
public ProjectIpWhitelist(string name, ProjectIpWhitelistArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

ProjectIpWhitelistArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

AwsSecurityGroup

ID of the whitelisted AWS security group. Mutually exclusive with cidr_block and ip_address.

Declaration
public Output<string> AwsSecurityGroup { get; }
Property Value
Type Description
Output<System.String>
View Source

CidrBlock

Whitelist entry in Classless Inter-Domain Routing (CIDR) notation. Mutually exclusive with aws_security_group and ip_address.

Declaration
public Output<string> CidrBlock { get; }
Property Value
Type Description
Output<System.String>
View Source

Comment

Comment to add to the whitelist entry.

Declaration
public Output<string> Comment { get; }
Property Value
Type Description
Output<System.String>
View Source

IpAddress

Whitelisted IP address. Mutually exclusive with aws_security_group and cidr_block.

Declaration
public Output<string> IpAddress { get; }
Property Value
Type Description
Output<System.String>
View Source

ProjectId

The ID of the project in which to add the whitelist entry.

Declaration
public Output<string> ProjectId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, ProjectIpWhitelistState, CustomResourceOptions)

Get an existing ProjectIpWhitelist resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static ProjectIpWhitelist Get(string name, Input<string> id, ProjectIpWhitelistState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

ProjectIpWhitelistState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
ProjectIpWhitelist
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.