published on Thursday, Apr 2, 2026 by Byteplus
published on Thursday, Apr 2, 2026 by Byteplus
After you create a MongoDB document database instance, you can set an allowlist for the instance to permit external devices to access it. This article describes how to set an allowlist in the console.
Example Usage
Example coming soon!
Example coming soon!
Example coming soon!
Example coming soon!
Example coming soon!
resources:
mongoDBAllowListDemo:
type: bytepluscc:mongodb:AllowList
name: MongoDBAllowListDemo
properties:
allowListName: mongodb_allowlist-1
allowListType: IPv4
projectName: default
allowListDesc: test
allowListCategory: Ordinary
allowLists:
- 0.0.0.0/0
- 127.0.0.1
- 192.168.1.0/24
associatedInstances:
- instance_id: mongo-shard-d838exxxxx
- instance_id: mongo-replica-63axxxxx
Create AllowList Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AllowList(name: string, args: AllowListArgs, opts?: CustomResourceOptions);@overload
def AllowList(resource_name: str,
args: AllowListArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AllowList(resource_name: str,
opts: Optional[ResourceOptions] = None,
allow_list_name: Optional[str] = None,
allow_lists: Optional[Sequence[str]] = None,
allow_list_category: Optional[str] = None,
allow_list_desc: Optional[str] = None,
allow_list_type: Optional[str] = None,
associated_instances: Optional[Sequence[AllowListAssociatedInstanceArgs]] = None,
project_name: Optional[str] = None)func NewAllowList(ctx *Context, name string, args AllowListArgs, opts ...ResourceOption) (*AllowList, error)public AllowList(string name, AllowListArgs args, CustomResourceOptions? opts = null)
public AllowList(String name, AllowListArgs args)
public AllowList(String name, AllowListArgs args, CustomResourceOptions options)
type: bytepluscc:mongodb:AllowList
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AllowListArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AllowListArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AllowListArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AllowListArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AllowListArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var byteplusccAllowListResource = new Bytepluscc.Mongodb.AllowList("byteplusccAllowListResource", new()
{
AllowListName = "string",
AllowListValue = new[]
{
"string",
},
AllowListCategory = "string",
AllowListDesc = "string",
AllowListType = "string",
AssociatedInstances = new[]
{
new Bytepluscc.Mongodb.Inputs.AllowListAssociatedInstanceArgs
{
InstanceId = "string",
InstanceName = "string",
ProjectName = "string",
Vpc = "string",
},
},
ProjectName = "string",
});
example, err := mongodb.NewAllowList(ctx, "byteplusccAllowListResource", &mongodb.AllowListArgs{
AllowListName: pulumi.String("string"),
AllowLists: pulumi.StringArray{
pulumi.String("string"),
},
AllowListCategory: pulumi.String("string"),
AllowListDesc: pulumi.String("string"),
AllowListType: pulumi.String("string"),
AssociatedInstances: mongodb.AllowListAssociatedInstanceArray{
&mongodb.AllowListAssociatedInstanceArgs{
InstanceId: pulumi.String("string"),
InstanceName: pulumi.String("string"),
ProjectName: pulumi.String("string"),
Vpc: pulumi.String("string"),
},
},
ProjectName: pulumi.String("string"),
})
var byteplusccAllowListResource = new com.byteplus.bytepluscc.mongodb.AllowList("byteplusccAllowListResource", com.byteplus.bytepluscc.mongodb.AllowListArgs.builder()
.allowListName("string")
.allowLists("string")
.allowListCategory("string")
.allowListDesc("string")
.allowListType("string")
.associatedInstances(AllowListAssociatedInstanceArgs.builder()
.instanceId("string")
.instanceName("string")
.projectName("string")
.vpc("string")
.build())
.projectName("string")
.build());
bytepluscc_allow_list_resource = bytepluscc.mongodb.AllowList("byteplusccAllowListResource",
allow_list_name="string",
allow_lists=["string"],
allow_list_category="string",
allow_list_desc="string",
allow_list_type="string",
associated_instances=[{
"instance_id": "string",
"instance_name": "string",
"project_name": "string",
"vpc": "string",
}],
project_name="string")
const byteplusccAllowListResource = new bytepluscc.mongodb.AllowList("byteplusccAllowListResource", {
allowListName: "string",
allowLists: ["string"],
allowListCategory: "string",
allowListDesc: "string",
allowListType: "string",
associatedInstances: [{
instanceId: "string",
instanceName: "string",
projectName: "string",
vpc: "string",
}],
projectName: "string",
});
type: bytepluscc:mongodb:AllowList
properties:
allowListCategory: string
allowListDesc: string
allowListName: string
allowListType: string
allowLists:
- string
associatedInstances:
- instanceId: string
instanceName: string
projectName: string
vpc: string
projectName: string
AllowList Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The AllowList resource accepts the following input properties:
- Allow
List stringName - Allowlist name. The name must meet the following requirements: Cannot start with a digit or hyphen (-). Can only contain Chinese characters, letters, digits, underscores (_), and hyphens (-). Length must be 1β128 characters.
- Allow
List List<string>Value - Enter an IP address or a CIDR-format IP address range.
- Allow
List stringCategory - Allowlist type. Valid values: Ordinary: ordinary allowlist; Default: default allowlist.
- Allow
List stringDesc - Allowlist remarks. Maximum length: 200 characters.
- Allow
List stringType - IP address type in the allowlist. Only IPv4 addresses are currently supported.
- Associated
Instances List<Byteplus.Allow List Associated Instance> - Project
Name string - Project to which the current allowlist belongs.
- Allow
List stringName - Allowlist name. The name must meet the following requirements: Cannot start with a digit or hyphen (-). Can only contain Chinese characters, letters, digits, underscores (_), and hyphens (-). Length must be 1β128 characters.
- Allow
Lists []string - Enter an IP address or a CIDR-format IP address range.
- Allow
List stringCategory - Allowlist type. Valid values: Ordinary: ordinary allowlist; Default: default allowlist.
- Allow
List stringDesc - Allowlist remarks. Maximum length: 200 characters.
- Allow
List stringType - IP address type in the allowlist. Only IPv4 addresses are currently supported.
- Associated
Instances []AllowList Associated Instance Args - Project
Name string - Project to which the current allowlist belongs.
- allow
List StringName - Allowlist name. The name must meet the following requirements: Cannot start with a digit or hyphen (-). Can only contain Chinese characters, letters, digits, underscores (_), and hyphens (-). Length must be 1β128 characters.
- allow
Lists List<String> - Enter an IP address or a CIDR-format IP address range.
- allow
List StringCategory - Allowlist type. Valid values: Ordinary: ordinary allowlist; Default: default allowlist.
- allow
List StringDesc - Allowlist remarks. Maximum length: 200 characters.
- allow
List StringType - IP address type in the allowlist. Only IPv4 addresses are currently supported.
- associated
Instances List<AllowList Associated Instance> - project
Name String - Project to which the current allowlist belongs.
- allow
List stringName - Allowlist name. The name must meet the following requirements: Cannot start with a digit or hyphen (-). Can only contain Chinese characters, letters, digits, underscores (_), and hyphens (-). Length must be 1β128 characters.
- allow
Lists string[] - Enter an IP address or a CIDR-format IP address range.
- allow
List stringCategory - Allowlist type. Valid values: Ordinary: ordinary allowlist; Default: default allowlist.
- allow
List stringDesc - Allowlist remarks. Maximum length: 200 characters.
- allow
List stringType - IP address type in the allowlist. Only IPv4 addresses are currently supported.
- associated
Instances AllowList Associated Instance[] - project
Name string - Project to which the current allowlist belongs.
- allow_
list_ strname - Allowlist name. The name must meet the following requirements: Cannot start with a digit or hyphen (-). Can only contain Chinese characters, letters, digits, underscores (_), and hyphens (-). Length must be 1β128 characters.
- allow_
lists Sequence[str] - Enter an IP address or a CIDR-format IP address range.
- allow_
list_ strcategory - Allowlist type. Valid values: Ordinary: ordinary allowlist; Default: default allowlist.
- allow_
list_ strdesc - Allowlist remarks. Maximum length: 200 characters.
- allow_
list_ strtype - IP address type in the allowlist. Only IPv4 addresses are currently supported.
- associated_
instances Sequence[AllowList Associated Instance Args] - project_
name str - Project to which the current allowlist belongs.
- allow
List StringName - Allowlist name. The name must meet the following requirements: Cannot start with a digit or hyphen (-). Can only contain Chinese characters, letters, digits, underscores (_), and hyphens (-). Length must be 1β128 characters.
- allow
Lists List<String> - Enter an IP address or a CIDR-format IP address range.
- allow
List StringCategory - Allowlist type. Valid values: Ordinary: ordinary allowlist; Default: default allowlist.
- allow
List StringDesc - Allowlist remarks. Maximum length: 200 characters.
- allow
List StringType - IP address type in the allowlist. Only IPv4 addresses are currently supported.
- associated
Instances List<Property Map> - project
Name String - Project to which the current allowlist belongs.
Outputs
All input properties are implicitly available as output properties. Additionally, the AllowList resource produces the following output properties:
- Allow
List stringId - Allowlist ID.
- Allow
List intIp Num - Total number of IP addresses (or address ranges) in the allowlist.
- Associated
Instance intNum - Total number of instances bound to the current allowlist.
- Id string
- The provider-assigned unique ID for this managed resource.
- Allow
List stringId - Allowlist ID.
- Allow
List intIp Num - Total number of IP addresses (or address ranges) in the allowlist.
- Associated
Instance intNum - Total number of instances bound to the current allowlist.
- Id string
- The provider-assigned unique ID for this managed resource.
- allow
List StringId - Allowlist ID.
- allow
List IntegerIp Num - Total number of IP addresses (or address ranges) in the allowlist.
- associated
Instance IntegerNum - Total number of instances bound to the current allowlist.
- id String
- The provider-assigned unique ID for this managed resource.
- allow
List stringId - Allowlist ID.
- allow
List numberIp Num - Total number of IP addresses (or address ranges) in the allowlist.
- associated
Instance numberNum - Total number of instances bound to the current allowlist.
- id string
- The provider-assigned unique ID for this managed resource.
- allow_
list_ strid - Allowlist ID.
- allow_
list_ intip_ num - Total number of IP addresses (or address ranges) in the allowlist.
- associated_
instance_ intnum - Total number of instances bound to the current allowlist.
- id str
- The provider-assigned unique ID for this managed resource.
- allow
List StringId - Allowlist ID.
- allow
List NumberIp Num - Total number of IP addresses (or address ranges) in the allowlist.
- associated
Instance NumberNum - Total number of instances bound to the current allowlist.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing AllowList Resource
Get an existing AllowList 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?: AllowListState, opts?: CustomResourceOptions): AllowList@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
allow_list_category: Optional[str] = None,
allow_list_desc: Optional[str] = None,
allow_list_id: Optional[str] = None,
allow_list_ip_num: Optional[int] = None,
allow_list_name: Optional[str] = None,
allow_list_type: Optional[str] = None,
allow_lists: Optional[Sequence[str]] = None,
associated_instance_num: Optional[int] = None,
associated_instances: Optional[Sequence[AllowListAssociatedInstanceArgs]] = None,
project_name: Optional[str] = None) -> AllowListfunc GetAllowList(ctx *Context, name string, id IDInput, state *AllowListState, opts ...ResourceOption) (*AllowList, error)public static AllowList Get(string name, Input<string> id, AllowListState? state, CustomResourceOptions? opts = null)public static AllowList get(String name, Output<String> id, AllowListState state, CustomResourceOptions options)resources: _: type: bytepluscc:mongodb:AllowList get: id: ${id}- 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.
- 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.
- Allow
List stringCategory - Allowlist type. Valid values: Ordinary: ordinary allowlist; Default: default allowlist.
- Allow
List stringDesc - Allowlist remarks. Maximum length: 200 characters.
- Allow
List stringId - Allowlist ID.
- Allow
List intIp Num - Total number of IP addresses (or address ranges) in the allowlist.
- Allow
List stringName - Allowlist name. The name must meet the following requirements: Cannot start with a digit or hyphen (-). Can only contain Chinese characters, letters, digits, underscores (_), and hyphens (-). Length must be 1β128 characters.
- Allow
List stringType - IP address type in the allowlist. Only IPv4 addresses are currently supported.
- Allow
List List<string>Value - Enter an IP address or a CIDR-format IP address range.
- Associated
Instance intNum - Total number of instances bound to the current allowlist.
- Associated
Instances List<Byteplus.Allow List Associated Instance> - Project
Name string - Project to which the current allowlist belongs.
- Allow
List stringCategory - Allowlist type. Valid values: Ordinary: ordinary allowlist; Default: default allowlist.
- Allow
List stringDesc - Allowlist remarks. Maximum length: 200 characters.
- Allow
List stringId - Allowlist ID.
- Allow
List intIp Num - Total number of IP addresses (or address ranges) in the allowlist.
- Allow
List stringName - Allowlist name. The name must meet the following requirements: Cannot start with a digit or hyphen (-). Can only contain Chinese characters, letters, digits, underscores (_), and hyphens (-). Length must be 1β128 characters.
- Allow
List stringType - IP address type in the allowlist. Only IPv4 addresses are currently supported.
- Allow
Lists []string - Enter an IP address or a CIDR-format IP address range.
- Associated
Instance intNum - Total number of instances bound to the current allowlist.
- Associated
Instances []AllowList Associated Instance Args - Project
Name string - Project to which the current allowlist belongs.
- allow
List StringCategory - Allowlist type. Valid values: Ordinary: ordinary allowlist; Default: default allowlist.
- allow
List StringDesc - Allowlist remarks. Maximum length: 200 characters.
- allow
List StringId - Allowlist ID.
- allow
List IntegerIp Num - Total number of IP addresses (or address ranges) in the allowlist.
- allow
List StringName - Allowlist name. The name must meet the following requirements: Cannot start with a digit or hyphen (-). Can only contain Chinese characters, letters, digits, underscores (_), and hyphens (-). Length must be 1β128 characters.
- allow
List StringType - IP address type in the allowlist. Only IPv4 addresses are currently supported.
- allow
Lists List<String> - Enter an IP address or a CIDR-format IP address range.
- associated
Instance IntegerNum - Total number of instances bound to the current allowlist.
- associated
Instances List<AllowList Associated Instance> - project
Name String - Project to which the current allowlist belongs.
- allow
List stringCategory - Allowlist type. Valid values: Ordinary: ordinary allowlist; Default: default allowlist.
- allow
List stringDesc - Allowlist remarks. Maximum length: 200 characters.
- allow
List stringId - Allowlist ID.
- allow
List numberIp Num - Total number of IP addresses (or address ranges) in the allowlist.
- allow
List stringName - Allowlist name. The name must meet the following requirements: Cannot start with a digit or hyphen (-). Can only contain Chinese characters, letters, digits, underscores (_), and hyphens (-). Length must be 1β128 characters.
- allow
List stringType - IP address type in the allowlist. Only IPv4 addresses are currently supported.
- allow
Lists string[] - Enter an IP address or a CIDR-format IP address range.
- associated
Instance numberNum - Total number of instances bound to the current allowlist.
- associated
Instances AllowList Associated Instance[] - project
Name string - Project to which the current allowlist belongs.
- allow_
list_ strcategory - Allowlist type. Valid values: Ordinary: ordinary allowlist; Default: default allowlist.
- allow_
list_ strdesc - Allowlist remarks. Maximum length: 200 characters.
- allow_
list_ strid - Allowlist ID.
- allow_
list_ intip_ num - Total number of IP addresses (or address ranges) in the allowlist.
- allow_
list_ strname - Allowlist name. The name must meet the following requirements: Cannot start with a digit or hyphen (-). Can only contain Chinese characters, letters, digits, underscores (_), and hyphens (-). Length must be 1β128 characters.
- allow_
list_ strtype - IP address type in the allowlist. Only IPv4 addresses are currently supported.
- allow_
lists Sequence[str] - Enter an IP address or a CIDR-format IP address range.
- associated_
instance_ intnum - Total number of instances bound to the current allowlist.
- associated_
instances Sequence[AllowList Associated Instance Args] - project_
name str - Project to which the current allowlist belongs.
- allow
List StringCategory - Allowlist type. Valid values: Ordinary: ordinary allowlist; Default: default allowlist.
- allow
List StringDesc - Allowlist remarks. Maximum length: 200 characters.
- allow
List StringId - Allowlist ID.
- allow
List NumberIp Num - Total number of IP addresses (or address ranges) in the allowlist.
- allow
List StringName - Allowlist name. The name must meet the following requirements: Cannot start with a digit or hyphen (-). Can only contain Chinese characters, letters, digits, underscores (_), and hyphens (-). Length must be 1β128 characters.
- allow
List StringType - IP address type in the allowlist. Only IPv4 addresses are currently supported.
- allow
Lists List<String> - Enter an IP address or a CIDR-format IP address range.
- associated
Instance NumberNum - Total number of instances bound to the current allowlist.
- associated
Instances List<Property Map> - project
Name String - Project to which the current allowlist belongs.
Supporting Types
AllowListAssociatedInstance, AllowListAssociatedInstanceArgs
- Instance
Id string - Instance ID bound to the current allowlist.
- Instance
Name string - Instance name bound to the current allowlist.
- Project
Name string - Project name of the instance.
- Vpc string
- Private network ID of the instance.
- Instance
Id string - Instance ID bound to the current allowlist.
- Instance
Name string - Instance name bound to the current allowlist.
- Project
Name string - Project name of the instance.
- Vpc string
- Private network ID of the instance.
- instance
Id String - Instance ID bound to the current allowlist.
- instance
Name String - Instance name bound to the current allowlist.
- project
Name String - Project name of the instance.
- vpc String
- Private network ID of the instance.
- instance
Id string - Instance ID bound to the current allowlist.
- instance
Name string - Instance name bound to the current allowlist.
- project
Name string - Project name of the instance.
- vpc string
- Private network ID of the instance.
- instance_
id str - Instance ID bound to the current allowlist.
- instance_
name str - Instance name bound to the current allowlist.
- project_
name str - Project name of the instance.
- vpc str
- Private network ID of the instance.
- instance
Id String - Instance ID bound to the current allowlist.
- instance
Name String - Instance name bound to the current allowlist.
- project
Name String - Project name of the instance.
- vpc String
- Private network ID of the instance.
Import
$ pulumi import bytepluscc:mongodb/allowList:AllowList example "allow_list_id"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- bytepluscc byteplus-sdk/pulumi-bytepluscc
- License
- MPL-2.0
- Notes
- This Pulumi package is based on the
byteplusccTerraform Provider.
published on Thursday, Apr 2, 2026 by Byteplus
