published on Monday, Mar 9, 2026 by Byteplus
published on Monday, Mar 9, 2026 by Byteplus
创建 Kafka 实例时,可以按需为其绑定白名单,绑定白名单与 Kafka 实例之后,仅配置在白名单中的 IP 地址与地址段才能访问消息队列 Kafka版实例。安全起见,建议您创建白名单,并将客户端的 IP 地址或 IP 地址段添加到 Kafka 实例的白名单中。建议您定期维护和管理白名单,提高 Kafka 实例访问的安全性。
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as bytepluscc from "@pulumi/bytepluscc";
const kafkaAllowListDemo = new bytepluscc.index.KafkaAllowlist("KafkaAllowListDemo", {
allowList: "127.0.0.2",
allowListDesc: "test",
allowListName: "ccapi-text",
associatedInstances: [
{
instanceId: "kafka-cnng9x9s***",
},
{
instanceId: "kafka-cnnghf99**",
},
],
applyInstanceNum: 2,
});
import pulumi
import pulumi_bytepluscc as bytepluscc
kafka_allow_list_demo = bytepluscc.index.KafkaAllowlist("KafkaAllowListDemo",
allow_list=127.0.0.2,
allow_list_desc=test,
allow_list_name=ccapi-text,
associated_instances=[
{
instanceId: kafka-cnng9x9s***,
},
{
instanceId: kafka-cnnghf99**,
},
],
apply_instance_num=2)
package main
import (
"github.com/byteplus-sdk/pulumi-bytepluscc/sdk/go/bytepluscc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := bytepluscc.NewKafkaAllowlist(ctx, "KafkaAllowListDemo", &bytepluscc.KafkaAllowlistArgs{
AllowList: "127.0.0.2",
AllowListDesc: "test",
AllowListName: "ccapi-text",
AssociatedInstances: []map[string]interface{}{
map[string]interface{}{
"instanceId": "kafka-cnng9x9s***",
},
map[string]interface{}{
"instanceId": "kafka-cnnghf99**",
},
},
ApplyInstanceNum: 2,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Bytepluscc = Pulumi.Bytepluscc;
return await Deployment.RunAsync(() =>
{
var kafkaAllowListDemo = new Bytepluscc.Index.KafkaAllowlist("KafkaAllowListDemo", new()
{
AllowList = "127.0.0.2",
AllowListDesc = "test",
AllowListName = "ccapi-text",
AssociatedInstances = new[]
{
{
{ "instanceId", "kafka-cnng9x9s***" },
},
{
{ "instanceId", "kafka-cnnghf99**" },
},
},
ApplyInstanceNum = 2,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.bytepluscc.kafkaAllowlist;
import com.pulumi.bytepluscc.kafkaAllowlistArgs;
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 kafkaAllowListDemo = new KafkaAllowlist("kafkaAllowListDemo", KafkaAllowlistArgs.builder()
.allowList("127.0.0.2")
.allowListDesc("test")
.allowListName("ccapi-text")
.associatedInstances(List.of(
Map.of("instanceId", "kafka-cnng9x9s***"),
Map.of("instanceId", "kafka-cnnghf99**")))
.applyInstanceNum(2)
.build());
}
}
resources:
kafkaAllowListDemo:
type: bytepluscc:kafkaAllowlist
name: KafkaAllowListDemo
properties:
allowList: 127.0.0.2
allowListDesc: test
allowListName: ccapi-text
associatedInstances:
- instanceId: kafka-cnng9x9s***
- instanceId: kafka-cnnghf99**
applyInstanceNum: 2
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: Optional[str] = None,
allow_list_name: Optional[str] = None,
allow_list_desc: Optional[str] = None,
apply_instance_num: Optional[int] = None,
associated_instances: Optional[Sequence[AllowListAssociatedInstanceArgs]] = 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:kafka: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 allowListResource = new Bytepluscc.Kafka.AllowList("allowListResource", new()
{
AllowListValue = "string",
AllowListName = "string",
AllowListDesc = "string",
ApplyInstanceNum = 0,
AssociatedInstances = new[]
{
new Bytepluscc.Kafka.Inputs.AllowListAssociatedInstanceArgs
{
InstanceId = "string",
},
},
});
example, err := kafka.NewAllowList(ctx, "allowListResource", &kafka.AllowListArgs{
AllowList: pulumi.String("string"),
AllowListName: pulumi.String("string"),
AllowListDesc: pulumi.String("string"),
ApplyInstanceNum: pulumi.Int(0),
AssociatedInstances: kafka.AllowListAssociatedInstanceArray{
&kafka.AllowListAssociatedInstanceArgs{
InstanceId: pulumi.String("string"),
},
},
})
var allowListResource = new com.byteplus.bytepluscc.kafka.AllowList("allowListResource", com.byteplus.bytepluscc.kafka.AllowListArgs.builder()
.allowList("string")
.allowListName("string")
.allowListDesc("string")
.applyInstanceNum(0)
.associatedInstances(AllowListAssociatedInstanceArgs.builder()
.instanceId("string")
.build())
.build());
allow_list_resource = bytepluscc.kafka.AllowList("allowListResource",
allow_list="string",
allow_list_name="string",
allow_list_desc="string",
apply_instance_num=0,
associated_instances=[{
"instance_id": "string",
}])
const allowListResource = new bytepluscc.kafka.AllowList("allowListResource", {
allowList: "string",
allowListName: "string",
allowListDesc: "string",
applyInstanceNum: 0,
associatedInstances: [{
instanceId: "string",
}],
});
type: bytepluscc:kafka:AllowList
properties:
allowList: string
allowListDesc: string
allowListName: string
applyInstanceNum: 0
associatedInstances:
- instanceId: 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 stringValue - 白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号(,)分隔。每个白名单最多可配置 300 个 IP 地址或网段。
- Allow
List stringDesc - 白名单描述。长度不超过200个字符。
- Apply
Instance intNum - 此白名单已绑定的实例数量。若指定 AllowList 参数,则此字段必填,用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符,则请求失败。
- Associated
Instances List<Byteplus.Allow List Associated Instance>
- Allow
List string - 白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号(,)分隔。每个白名单最多可配置 300 个 IP 地址或网段。
- Allow
List stringName - 白名单规则名称。长度为 1~128 个字符。只能包含中文、字母、数字、下划线和连字符(-)。不能以数字或连字符(-)开头。白名单名称在当前地域下唯一。
- Allow
List stringDesc - 白名单描述。长度不超过200个字符。
- Apply
Instance intNum - 此白名单已绑定的实例数量。若指定 AllowList 参数,则此字段必填,用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符,则请求失败。
- Associated
Instances []AllowList Associated Instance Args
- allow
List String - 白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号(,)分隔。每个白名单最多可配置 300 个 IP 地址或网段。
- allow
List StringName - 白名单规则名称。长度为 1~128 个字符。只能包含中文、字母、数字、下划线和连字符(-)。不能以数字或连字符(-)开头。白名单名称在当前地域下唯一。
- allow
List StringDesc - 白名单描述。长度不超过200个字符。
- apply
Instance IntegerNum - 此白名单已绑定的实例数量。若指定 AllowList 参数,则此字段必填,用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符,则请求失败。
- associated
Instances List<AllowList Associated Instance>
- allow
List string - 白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号(,)分隔。每个白名单最多可配置 300 个 IP 地址或网段。
- allow
List stringName - 白名单规则名称。长度为 1~128 个字符。只能包含中文、字母、数字、下划线和连字符(-)。不能以数字或连字符(-)开头。白名单名称在当前地域下唯一。
- allow
List stringDesc - 白名单描述。长度不超过200个字符。
- apply
Instance numberNum - 此白名单已绑定的实例数量。若指定 AllowList 参数,则此字段必填,用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符,则请求失败。
- associated
Instances AllowList Associated Instance[]
- allow_
list str - 白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号(,)分隔。每个白名单最多可配置 300 个 IP 地址或网段。
- allow_
list_ strname - 白名单规则名称。长度为 1~128 个字符。只能包含中文、字母、数字、下划线和连字符(-)。不能以数字或连字符(-)开头。白名单名称在当前地域下唯一。
- allow_
list_ strdesc - 白名单描述。长度不超过200个字符。
- apply_
instance_ intnum - 此白名单已绑定的实例数量。若指定 AllowList 参数,则此字段必填,用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符,则请求失败。
- associated_
instances Sequence[AllowList Associated Instance Args]
- allow
List String - 白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号(,)分隔。每个白名单最多可配置 300 个 IP 地址或网段。
- allow
List StringName - 白名单规则名称。长度为 1~128 个字符。只能包含中文、字母、数字、下划线和连字符(-)。不能以数字或连字符(-)开头。白名单名称在当前地域下唯一。
- allow
List StringDesc - 白名单描述。长度不超过200个字符。
- apply
Instance NumberNum - 此白名单已绑定的实例数量。若指定 AllowList 参数,则此字段必填,用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符,则请求失败。
- associated
Instances List<Property Map>
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 - 白名单指定的规则个数。
- Associated
Instance intNum - 白名单绑定的实例个数。
- Id string
- The provider-assigned unique ID for this managed resource.
- Allow
List stringId - 白名单 ID。
- Allow
List intIp Num - 白名单指定的规则个数。
- Associated
Instance intNum - 白名单绑定的实例个数。
- Id string
- The provider-assigned unique ID for this managed resource.
- allow
List StringId - 白名单 ID。
- allow
List IntegerIp Num - 白名单指定的规则个数。
- associated
Instance IntegerNum - 白名单绑定的实例个数。
- id String
- The provider-assigned unique ID for this managed resource.
- allow
List stringId - 白名单 ID。
- allow
List numberIp Num - 白名单指定的规则个数。
- associated
Instance numberNum - 白名单绑定的实例个数。
- id string
- The provider-assigned unique ID for this managed resource.
- allow_
list_ strid - 白名单 ID。
- allow_
list_ intip_ num - 白名单指定的规则个数。
- associated_
instance_ intnum - 白名单绑定的实例个数。
- id str
- The provider-assigned unique ID for this managed resource.
- allow
List StringId - 白名单 ID。
- allow
List NumberIp Num - 白名单指定的规则个数。
- 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: 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,
apply_instance_num: Optional[int] = None,
associated_instance_num: Optional[int] = None,
associated_instances: Optional[Sequence[AllowListAssociatedInstanceArgs]] = 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:kafka: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 stringDesc - 白名单描述。长度不超过200个字符。
- Allow
List stringId - 白名单 ID。
- Allow
List intIp Num - 白名单指定的规则个数。
- Allow
List stringName - 白名单规则名称。长度为 1~128 个字符。只能包含中文、字母、数字、下划线和连字符(-)。不能以数字或连字符(-)开头。白名单名称在当前地域下唯一。
- Allow
List stringValue - 白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号(,)分隔。每个白名单最多可配置 300 个 IP 地址或网段。
- Apply
Instance intNum - 此白名单已绑定的实例数量。若指定 AllowList 参数,则此字段必填,用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符,则请求失败。
- Associated
Instance intNum - 白名单绑定的实例个数。
- Associated
Instances List<Byteplus.Allow List Associated Instance>
- Allow
List string - 白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号(,)分隔。每个白名单最多可配置 300 个 IP 地址或网段。
- Allow
List stringDesc - 白名单描述。长度不超过200个字符。
- Allow
List stringId - 白名单 ID。
- Allow
List intIp Num - 白名单指定的规则个数。
- Allow
List stringName - 白名单规则名称。长度为 1~128 个字符。只能包含中文、字母、数字、下划线和连字符(-)。不能以数字或连字符(-)开头。白名单名称在当前地域下唯一。
- Apply
Instance intNum - 此白名单已绑定的实例数量。若指定 AllowList 参数,则此字段必填,用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符,则请求失败。
- Associated
Instance intNum - 白名单绑定的实例个数。
- Associated
Instances []AllowList Associated Instance Args
- allow
List String - 白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号(,)分隔。每个白名单最多可配置 300 个 IP 地址或网段。
- allow
List StringDesc - 白名单描述。长度不超过200个字符。
- allow
List StringId - 白名单 ID。
- allow
List IntegerIp Num - 白名单指定的规则个数。
- allow
List StringName - 白名单规则名称。长度为 1~128 个字符。只能包含中文、字母、数字、下划线和连字符(-)。不能以数字或连字符(-)开头。白名单名称在当前地域下唯一。
- apply
Instance IntegerNum - 此白名单已绑定的实例数量。若指定 AllowList 参数,则此字段必填,用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符,则请求失败。
- associated
Instance IntegerNum - 白名单绑定的实例个数。
- associated
Instances List<AllowList Associated Instance>
- allow
List string - 白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号(,)分隔。每个白名单最多可配置 300 个 IP 地址或网段。
- allow
List stringDesc - 白名单描述。长度不超过200个字符。
- allow
List stringId - 白名单 ID。
- allow
List numberIp Num - 白名单指定的规则个数。
- allow
List stringName - 白名单规则名称。长度为 1~128 个字符。只能包含中文、字母、数字、下划线和连字符(-)。不能以数字或连字符(-)开头。白名单名称在当前地域下唯一。
- apply
Instance numberNum - 此白名单已绑定的实例数量。若指定 AllowList 参数,则此字段必填,用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符,则请求失败。
- associated
Instance numberNum - 白名单绑定的实例个数。
- associated
Instances AllowList Associated Instance[]
- allow_
list str - 白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号(,)分隔。每个白名单最多可配置 300 个 IP 地址或网段。
- allow_
list_ strdesc - 白名单描述。长度不超过200个字符。
- allow_
list_ strid - 白名单 ID。
- allow_
list_ intip_ num - 白名单指定的规则个数。
- allow_
list_ strname - 白名单规则名称。长度为 1~128 个字符。只能包含中文、字母、数字、下划线和连字符(-)。不能以数字或连字符(-)开头。白名单名称在当前地域下唯一。
- apply_
instance_ intnum - 此白名单已绑定的实例数量。若指定 AllowList 参数,则此字段必填,用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符,则请求失败。
- associated_
instance_ intnum - 白名单绑定的实例个数。
- associated_
instances Sequence[AllowList Associated Instance Args]
- allow
List String - 白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号(,)分隔。每个白名单最多可配置 300 个 IP 地址或网段。
- allow
List StringDesc - 白名单描述。长度不超过200个字符。
- allow
List StringId - 白名单 ID。
- allow
List NumberIp Num - 白名单指定的规则个数。
- allow
List StringName - 白名单规则名称。长度为 1~128 个字符。只能包含中文、字母、数字、下划线和连字符(-)。不能以数字或连字符(-)开头。白名单名称在当前地域下唯一。
- apply
Instance NumberNum - 此白名单已绑定的实例数量。若指定 AllowList 参数,则此字段必填,用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符,则请求失败。
- associated
Instance NumberNum - 白名单绑定的实例个数。
- associated
Instances List<Property Map>
Supporting Types
AllowListAssociatedInstance, AllowListAssociatedInstanceArgs
- Instance
Id string - 白名单绑定的实例ID。
- Instance
Id string - 白名单绑定的实例ID。
- instance
Id String - 白名单绑定的实例ID。
- instance
Id string - 白名单绑定的实例ID。
- instance_
id str - 白名单绑定的实例ID。
- instance
Id String - 白名单绑定的实例ID。
Import
$ pulumi import bytepluscc:kafka/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 Monday, Mar 9, 2026 by Byteplus
