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
groupIdin 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>",
});
}
}
Coming soon!
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test = mongodbatlas.ProjectIpWhitelist("test",
cidr_block="1.2.3.4/32",
comment="cidr block for tf acc testing",
project_id="<PROJECT-ID>")import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const test = new mongodbatlas.ProjectIpWhitelist("test", {
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>",
});
}
}
Coming soon!
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test = mongodbatlas.ProjectIpWhitelist("test",
comment="ip address for tf acc testing",
ip_address="2.3.4.5",
project_id="<PROJECT-ID>")import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const test = new mongodbatlas.ProjectIpWhitelist("test", {
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",
});
}
}
Coming soon!
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test_network_container = mongodbatlas.NetworkContainer("testNetworkContainer",
project_id="<PROJECT-ID>",
atlas_cidr_block="192.168.208.0/21",
provider_name="AWS",
region_name="US_EAST_1")
test_network_peering = mongodbatlas.NetworkPeering("testNetworkPeering",
project_id="<PROJECT-ID>",
container_id=test_network_container.container_id,
accepter_region_name="us-east-1",
provider_name="AWS",
route_table_cidr_block="172.31.0.0/16",
vpc_id="vpc-0d93d6f69f1578bd8",
aws_account_id="232589400519")
test_project_ip_whitelist = mongodbatlas.ProjectIpWhitelist("testProjectIpWhitelist",
project_id="<PROJECT-ID>",
aws_security_group="sg-0026348ec11780bd1",
comment="TestAcc for awsSecurityGroup")import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const testNetworkContainer = new mongodbatlas.NetworkContainer("testNetworkContainer", {
projectId: "<PROJECT-ID>",
atlasCidrBlock: "192.168.208.0/21",
providerName: "AWS",
regionName: "US_EAST_1",
});
const testNetworkPeering = new mongodbatlas.NetworkPeering("testNetworkPeering", {
projectId: "<PROJECT-ID>",
containerId: testNetworkContainer.containerId,
accepterRegionName: "us-east-1",
providerName: "AWS",
routeTableCidrBlock: "172.31.0.0/16",
vpcId: "vpc-0d93d6f69f1578bd8",
awsAccountId: "232589400519",
});
const testProjectIpWhitelist = new mongodbatlas.ProjectIpWhitelist("testProjectIpWhitelist", {
projectId: "<PROJECT-ID>",
awsSecurityGroup: "sg-0026348ec11780bd1",
comment: "TestAcc for awsSecurityGroup",
});Create a ProjectIpWhitelist Resource
new ProjectIpWhitelist(name: string, args: ProjectIpWhitelistArgs, opts?: CustomResourceOptions);def ProjectIpWhitelist(resource_name, opts=None, aws_security_group=None, cidr_block=None, comment=None, ip_address=None, project_id=None, __props__=None);func NewProjectIpWhitelist(ctx *Context, name string, args ProjectIpWhitelistArgs, opts ...ResourceOption) (*ProjectIpWhitelist, error)public ProjectIpWhitelist(string name, ProjectIpWhitelistArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args ProjectIpWhitelistArgs
- 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 ProjectIpWhitelistArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectIpWhitelistArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
ProjectIpWhitelist Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The ProjectIpWhitelist resource accepts the following input properties:
- Project
Id string The ID of the project in which to add the whitelist entry.
- Aws
Security stringGroup ID of the whitelisted AWS security group. Mutually exclusive with
cidr_blockandip_address.- Cidr
Block string Whitelist entry in Classless Inter-Domain Routing (CIDR) notation. Mutually exclusive with
aws_security_groupandip_address.- Comment string
Comment to add to the whitelist entry.
- Ip
Address string Whitelisted IP address. Mutually exclusive with
aws_security_groupandcidr_block.
- Project
Id string The ID of the project in which to add the whitelist entry.
- Aws
Security stringGroup ID of the whitelisted AWS security group. Mutually exclusive with
cidr_blockandip_address.- Cidr
Block string Whitelist entry in Classless Inter-Domain Routing (CIDR) notation. Mutually exclusive with
aws_security_groupandip_address.- Comment string
Comment to add to the whitelist entry.
- Ip
Address string Whitelisted IP address. Mutually exclusive with
aws_security_groupandcidr_block.
- project
Id string The ID of the project in which to add the whitelist entry.
- aws
Security stringGroup ID of the whitelisted AWS security group. Mutually exclusive with
cidr_blockandip_address.- cidr
Block string Whitelist entry in Classless Inter-Domain Routing (CIDR) notation. Mutually exclusive with
aws_security_groupandip_address.- comment string
Comment to add to the whitelist entry.
- ip
Address string Whitelisted IP address. Mutually exclusive with
aws_security_groupandcidr_block.
- project_
id str The ID of the project in which to add the whitelist entry.
- aws_
security_ strgroup ID of the whitelisted AWS security group. Mutually exclusive with
cidr_blockandip_address.- cidr_
block str Whitelist entry in Classless Inter-Domain Routing (CIDR) notation. Mutually exclusive with
aws_security_groupandip_address.- comment str
Comment to add to the whitelist entry.
- ip_
address str Whitelisted IP address. Mutually exclusive with
aws_security_groupandcidr_block.
Outputs
All input properties are implicitly available as output properties. Additionally, the ProjectIpWhitelist resource produces the following output properties:
Look up an Existing ProjectIpWhitelist Resource
Get an existing ProjectIpWhitelist 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?: ProjectIpWhitelistState, opts?: CustomResourceOptions): ProjectIpWhiteliststatic get(resource_name, id, opts=None, aws_security_group=None, cidr_block=None, comment=None, ip_address=None, project_id=None, __props__=None);func GetProjectIpWhitelist(ctx *Context, name string, id IDInput, state *ProjectIpWhitelistState, opts ...ResourceOption) (*ProjectIpWhitelist, error)public static ProjectIpWhitelist Get(string name, Input<string> id, ProjectIpWhitelistState? 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:
- Aws
Security stringGroup ID of the whitelisted AWS security group. Mutually exclusive with
cidr_blockandip_address.- Cidr
Block string Whitelist entry in Classless Inter-Domain Routing (CIDR) notation. Mutually exclusive with
aws_security_groupandip_address.- Comment string
Comment to add to the whitelist entry.
- Ip
Address string Whitelisted IP address. Mutually exclusive with
aws_security_groupandcidr_block.- Project
Id string The ID of the project in which to add the whitelist entry.
- Aws
Security stringGroup ID of the whitelisted AWS security group. Mutually exclusive with
cidr_blockandip_address.- Cidr
Block string Whitelist entry in Classless Inter-Domain Routing (CIDR) notation. Mutually exclusive with
aws_security_groupandip_address.- Comment string
Comment to add to the whitelist entry.
- Ip
Address string Whitelisted IP address. Mutually exclusive with
aws_security_groupandcidr_block.- Project
Id string The ID of the project in which to add the whitelist entry.
- aws
Security stringGroup ID of the whitelisted AWS security group. Mutually exclusive with
cidr_blockandip_address.- cidr
Block string Whitelist entry in Classless Inter-Domain Routing (CIDR) notation. Mutually exclusive with
aws_security_groupandip_address.- comment string
Comment to add to the whitelist entry.
- ip
Address string Whitelisted IP address. Mutually exclusive with
aws_security_groupandcidr_block.- project
Id string The ID of the project in which to add the whitelist entry.
- aws_
security_ strgroup ID of the whitelisted AWS security group. Mutually exclusive with
cidr_blockandip_address.- cidr_
block str Whitelist entry in Classless Inter-Domain Routing (CIDR) notation. Mutually exclusive with
aws_security_groupandip_address.- comment str
Comment to add to the whitelist entry.
- ip_
address str Whitelisted IP address. Mutually exclusive with
aws_security_groupandcidr_block.- project_
id str The ID of the project in which to add the whitelist entry.
Package Details
- Repository
- https://github.com/pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mongodbatlasTerraform Provider.