published on Thursday, Mar 26, 2026 by Volcengine
published on Thursday, Mar 26, 2026 by Volcengine
文档数据库 MongoDB 版实例创建成功后,您可以为实例设置白名单,以允许外部设备访问该实例。本文介绍如何通过控制台设置白名单。
Example Usage
Example coming soon!
Example coming soon!
Example coming soon!
Example coming soon!
Example coming soon!
resources:
mongoDBAllowListDemo:
type: volcenginecc: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: volcenginecc: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 volcengineccAllowListResource = new Volcenginecc.Mongodb.AllowList("volcengineccAllowListResource", new()
{
AllowListName = "string",
AllowListValue = new[]
{
"string",
},
AllowListCategory = "string",
AllowListDesc = "string",
AllowListType = "string",
AssociatedInstances = new[]
{
new Volcenginecc.Mongodb.Inputs.AllowListAssociatedInstanceArgs
{
InstanceId = "string",
InstanceName = "string",
ProjectName = "string",
Vpc = "string",
},
},
ProjectName = "string",
});
example, err := mongodb.NewAllowList(ctx, "volcengineccAllowListResource", &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 volcengineccAllowListResource = new com.volcengine.volcenginecc.mongodb.AllowList("volcengineccAllowListResource", com.volcengine.volcenginecc.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());
volcenginecc_allow_list_resource = volcenginecc.mongodb.AllowList("volcengineccAllowListResource",
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 volcengineccAllowListResource = new volcenginecc.mongodb.AllowList("volcengineccAllowListResource", {
allowListName: "string",
allowLists: ["string"],
allowListCategory: "string",
allowListDesc: "string",
allowListType: "string",
associatedInstances: [{
instanceId: "string",
instanceName: "string",
projectName: "string",
vpc: "string",
}],
projectName: "string",
});
type: volcenginecc: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 - 白名单名称,名称需同时满足如下要求:不能以数字、中划线(-)开头。只能包含中文、字母、数字、下划线(_)和中划线(-)。长度需为 1~128 个字符。
- Allow
List List<string>Value - 输入 IP 地址或 CIDR 格式的 IP 地址段。
- Allow
List stringCategory - 白名单类型。取值范围如下:Ordinary:普通白名单;Default:默认白名单。
- Allow
List stringDesc - 白名单的备注信息,长度不可超过 200 个字符。
- Allow
List stringType - 白名单内的 IP 地址类型。当前仅支持 IPv4 地址。
- Associated
Instances List<Volcengine.Allow List Associated Instance> - Project
Name string - 当前白名单所属的项目。
- Allow
List stringName - 白名单名称,名称需同时满足如下要求:不能以数字、中划线(-)开头。只能包含中文、字母、数字、下划线(_)和中划线(-)。长度需为 1~128 个字符。
- Allow
Lists []string - 输入 IP 地址或 CIDR 格式的 IP 地址段。
- Allow
List stringCategory - 白名单类型。取值范围如下:Ordinary:普通白名单;Default:默认白名单。
- Allow
List stringDesc - 白名单的备注信息,长度不可超过 200 个字符。
- Allow
List stringType - 白名单内的 IP 地址类型。当前仅支持 IPv4 地址。
- Associated
Instances []AllowList Associated Instance Args - Project
Name string - 当前白名单所属的项目。
- allow
List StringName - 白名单名称,名称需同时满足如下要求:不能以数字、中划线(-)开头。只能包含中文、字母、数字、下划线(_)和中划线(-)。长度需为 1~128 个字符。
- allow
Lists List<String> - 输入 IP 地址或 CIDR 格式的 IP 地址段。
- allow
List StringCategory - 白名单类型。取值范围如下:Ordinary:普通白名单;Default:默认白名单。
- allow
List StringDesc - 白名单的备注信息,长度不可超过 200 个字符。
- allow
List StringType - 白名单内的 IP 地址类型。当前仅支持 IPv4 地址。
- associated
Instances List<AllowList Associated Instance> - project
Name String - 当前白名单所属的项目。
- allow
List stringName - 白名单名称,名称需同时满足如下要求:不能以数字、中划线(-)开头。只能包含中文、字母、数字、下划线(_)和中划线(-)。长度需为 1~128 个字符。
- allow
Lists string[] - 输入 IP 地址或 CIDR 格式的 IP 地址段。
- allow
List stringCategory - 白名单类型。取值范围如下:Ordinary:普通白名单;Default:默认白名单。
- allow
List stringDesc - 白名单的备注信息,长度不可超过 200 个字符。
- allow
List stringType - 白名单内的 IP 地址类型。当前仅支持 IPv4 地址。
- associated
Instances AllowList Associated Instance[] - project
Name string - 当前白名单所属的项目。
- allow_
list_ strname - 白名单名称,名称需同时满足如下要求:不能以数字、中划线(-)开头。只能包含中文、字母、数字、下划线(_)和中划线(-)。长度需为 1~128 个字符。
- allow_
lists Sequence[str] - 输入 IP 地址或 CIDR 格式的 IP 地址段。
- allow_
list_ strcategory - 白名单类型。取值范围如下:Ordinary:普通白名单;Default:默认白名单。
- allow_
list_ strdesc - 白名单的备注信息,长度不可超过 200 个字符。
- allow_
list_ strtype - 白名单内的 IP 地址类型。当前仅支持 IPv4 地址。
- associated_
instances Sequence[AllowList Associated Instance Args] - project_
name str - 当前白名单所属的项目。
- allow
List StringName - 白名单名称,名称需同时满足如下要求:不能以数字、中划线(-)开头。只能包含中文、字母、数字、下划线(_)和中划线(-)。长度需为 1~128 个字符。
- allow
Lists List<String> - 输入 IP 地址或 CIDR 格式的 IP 地址段。
- allow
List StringCategory - 白名单类型。取值范围如下:Ordinary:普通白名单;Default:默认白名单。
- allow
List StringDesc - 白名单的备注信息,长度不可超过 200 个字符。
- allow
List StringType - 白名单内的 IP 地址类型。当前仅支持 IPv4 地址。
- associated
Instances List<Property Map> - project
Name String - 当前白名单所属的项目。
Outputs
All input properties are implicitly available as output properties. Additionally, the AllowList resource produces the following output properties:
- Allow
List stringId - 白名单 ID。
- Allow
List intIp Num - 白名单内的 IP 地址(或地址段)总数。
- Associated
Instance intNum - 已绑定当前白名单的实例总数。
- Id string
- The provider-assigned unique ID for this managed resource.
- Allow
List stringId - 白名单 ID。
- Allow
List intIp Num - 白名单内的 IP 地址(或地址段)总数。
- Associated
Instance intNum - 已绑定当前白名单的实例总数。
- Id string
- The provider-assigned unique ID for this managed resource.
- allow
List StringId - 白名单 ID。
- allow
List IntegerIp Num - 白名单内的 IP 地址(或地址段)总数。
- associated
Instance IntegerNum - 已绑定当前白名单的实例总数。
- id String
- The provider-assigned unique ID for this managed resource.
- allow
List stringId - 白名单 ID。
- allow
List numberIp Num - 白名单内的 IP 地址(或地址段)总数。
- associated
Instance numberNum - 已绑定当前白名单的实例总数。
- id string
- The provider-assigned unique ID for this managed resource.
- allow_
list_ strid - 白名单 ID。
- allow_
list_ intip_ num - 白名单内的 IP 地址(或地址段)总数。
- associated_
instance_ intnum - 已绑定当前白名单的实例总数。
- id str
- The provider-assigned unique ID for this managed resource.
- allow
List StringId - 白名单 ID。
- allow
List NumberIp Num - 白名单内的 IP 地址(或地址段)总数。
- associated
Instance NumberNum - 已绑定当前白名单的实例总数。
- 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: volcenginecc: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 - 白名单类型。取值范围如下:Ordinary:普通白名单;Default:默认白名单。
- Allow
List stringDesc - 白名单的备注信息,长度不可超过 200 个字符。
- Allow
List stringId - 白名单 ID。
- Allow
List intIp Num - 白名单内的 IP 地址(或地址段)总数。
- Allow
List stringName - 白名单名称,名称需同时满足如下要求:不能以数字、中划线(-)开头。只能包含中文、字母、数字、下划线(_)和中划线(-)。长度需为 1~128 个字符。
- Allow
List stringType - 白名单内的 IP 地址类型。当前仅支持 IPv4 地址。
- Allow
List List<string>Value - 输入 IP 地址或 CIDR 格式的 IP 地址段。
- Associated
Instance intNum - 已绑定当前白名单的实例总数。
- Associated
Instances List<Volcengine.Allow List Associated Instance> - Project
Name string - 当前白名单所属的项目。
- Allow
List stringCategory - 白名单类型。取值范围如下:Ordinary:普通白名单;Default:默认白名单。
- Allow
List stringDesc - 白名单的备注信息,长度不可超过 200 个字符。
- Allow
List stringId - 白名单 ID。
- Allow
List intIp Num - 白名单内的 IP 地址(或地址段)总数。
- Allow
List stringName - 白名单名称,名称需同时满足如下要求:不能以数字、中划线(-)开头。只能包含中文、字母、数字、下划线(_)和中划线(-)。长度需为 1~128 个字符。
- Allow
List stringType - 白名单内的 IP 地址类型。当前仅支持 IPv4 地址。
- Allow
Lists []string - 输入 IP 地址或 CIDR 格式的 IP 地址段。
- Associated
Instance intNum - 已绑定当前白名单的实例总数。
- Associated
Instances []AllowList Associated Instance Args - Project
Name string - 当前白名单所属的项目。
- allow
List StringCategory - 白名单类型。取值范围如下:Ordinary:普通白名单;Default:默认白名单。
- allow
List StringDesc - 白名单的备注信息,长度不可超过 200 个字符。
- allow
List StringId - 白名单 ID。
- allow
List IntegerIp Num - 白名单内的 IP 地址(或地址段)总数。
- allow
List StringName - 白名单名称,名称需同时满足如下要求:不能以数字、中划线(-)开头。只能包含中文、字母、数字、下划线(_)和中划线(-)。长度需为 1~128 个字符。
- allow
List StringType - 白名单内的 IP 地址类型。当前仅支持 IPv4 地址。
- allow
Lists List<String> - 输入 IP 地址或 CIDR 格式的 IP 地址段。
- associated
Instance IntegerNum - 已绑定当前白名单的实例总数。
- associated
Instances List<AllowList Associated Instance> - project
Name String - 当前白名单所属的项目。
- allow
List stringCategory - 白名单类型。取值范围如下:Ordinary:普通白名单;Default:默认白名单。
- allow
List stringDesc - 白名单的备注信息,长度不可超过 200 个字符。
- allow
List stringId - 白名单 ID。
- allow
List numberIp Num - 白名单内的 IP 地址(或地址段)总数。
- allow
List stringName - 白名单名称,名称需同时满足如下要求:不能以数字、中划线(-)开头。只能包含中文、字母、数字、下划线(_)和中划线(-)。长度需为 1~128 个字符。
- allow
List stringType - 白名单内的 IP 地址类型。当前仅支持 IPv4 地址。
- allow
Lists string[] - 输入 IP 地址或 CIDR 格式的 IP 地址段。
- associated
Instance numberNum - 已绑定当前白名单的实例总数。
- associated
Instances AllowList Associated Instance[] - project
Name string - 当前白名单所属的项目。
- allow_
list_ strcategory - 白名单类型。取值范围如下:Ordinary:普通白名单;Default:默认白名单。
- allow_
list_ strdesc - 白名单的备注信息,长度不可超过 200 个字符。
- allow_
list_ strid - 白名单 ID。
- allow_
list_ intip_ num - 白名单内的 IP 地址(或地址段)总数。
- allow_
list_ strname - 白名单名称,名称需同时满足如下要求:不能以数字、中划线(-)开头。只能包含中文、字母、数字、下划线(_)和中划线(-)。长度需为 1~128 个字符。
- allow_
list_ strtype - 白名单内的 IP 地址类型。当前仅支持 IPv4 地址。
- allow_
lists Sequence[str] - 输入 IP 地址或 CIDR 格式的 IP 地址段。
- associated_
instance_ intnum - 已绑定当前白名单的实例总数。
- associated_
instances Sequence[AllowList Associated Instance Args] - project_
name str - 当前白名单所属的项目。
- allow
List StringCategory - 白名单类型。取值范围如下:Ordinary:普通白名单;Default:默认白名单。
- allow
List StringDesc - 白名单的备注信息,长度不可超过 200 个字符。
- allow
List StringId - 白名单 ID。
- allow
List NumberIp Num - 白名单内的 IP 地址(或地址段)总数。
- allow
List StringName - 白名单名称,名称需同时满足如下要求:不能以数字、中划线(-)开头。只能包含中文、字母、数字、下划线(_)和中划线(-)。长度需为 1~128 个字符。
- allow
List StringType - 白名单内的 IP 地址类型。当前仅支持 IPv4 地址。
- allow
Lists List<String> - 输入 IP 地址或 CIDR 格式的 IP 地址段。
- associated
Instance NumberNum - 已绑定当前白名单的实例总数。
- associated
Instances List<Property Map> - project
Name String - 当前白名单所属的项目。
Supporting Types
AllowListAssociatedInstance, AllowListAssociatedInstanceArgs
- Instance
Id string - 已绑定当前白名单的实例 ID。
- Instance
Name string - 已绑定当前白名单的实例名称。
- Project
Name string - 实例所属的项目名称。
- Vpc string
- 实例所属的私有网络 ID。
- Instance
Id string - 已绑定当前白名单的实例 ID。
- Instance
Name string - 已绑定当前白名单的实例名称。
- Project
Name string - 实例所属的项目名称。
- Vpc string
- 实例所属的私有网络 ID。
- instance
Id String - 已绑定当前白名单的实例 ID。
- instance
Name String - 已绑定当前白名单的实例名称。
- project
Name String - 实例所属的项目名称。
- vpc String
- 实例所属的私有网络 ID。
- instance
Id string - 已绑定当前白名单的实例 ID。
- instance
Name string - 已绑定当前白名单的实例名称。
- project
Name string - 实例所属的项目名称。
- vpc string
- 实例所属的私有网络 ID。
- instance_
id str - 已绑定当前白名单的实例 ID。
- instance_
name str - 已绑定当前白名单的实例名称。
- project_
name str - 实例所属的项目名称。
- vpc str
- 实例所属的私有网络 ID。
- instance
Id String - 已绑定当前白名单的实例 ID。
- instance
Name String - 已绑定当前白名单的实例名称。
- project
Name String - 实例所属的项目名称。
- vpc String
- 实例所属的私有网络 ID。
Import
$ pulumi import volcenginecc:mongodb/allowList:AllowList example "allow_list_id"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- volcenginecc volcengine/pulumi-volcenginecc
- License
- MPL-2.0
- Notes
- This Pulumi package is based on the
volcengineccTerraform Provider.
published on Thursday, Mar 26, 2026 by Volcengine
