1. Packages
  2. Volcengine
  3. API Docs
  4. nlb
  5. Listener
Viewing docs for Volcengine v0.0.47
published on Friday, Mar 13, 2026 by Volcengine
volcengine logo
Viewing docs for Volcengine v0.0.47
published on Friday, Mar 13, 2026 by Volcengine

    Create Listener Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Listener(name: string, args: ListenerArgs, opts?: CustomResourceOptions);
    @overload
    def Listener(resource_name: str,
                 args: ListenerArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Listener(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 load_balancer_id: Optional[str] = None,
                 port: Optional[int] = None,
                 protocol: Optional[str] = None,
                 server_group_id: Optional[str] = None,
                 connection_timeout: Optional[int] = None,
                 description: Optional[str] = None,
                 enabled: Optional[bool] = None,
                 end_port: Optional[int] = None,
                 listener_name: Optional[str] = None,
                 start_port: Optional[int] = None,
                 tags: Optional[Sequence[ListenerTagArgs]] = None)
    func NewListener(ctx *Context, name string, args ListenerArgs, opts ...ResourceOption) (*Listener, error)
    public Listener(string name, ListenerArgs args, CustomResourceOptions? opts = null)
    public Listener(String name, ListenerArgs args)
    public Listener(String name, ListenerArgs args, CustomResourceOptions options)
    
    type: volcengine:nlb:Listener
    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 ListenerArgs
    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 ListenerArgs
    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 ListenerArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ListenerArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ListenerArgs
    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 examplelistenerResourceResourceFromNlblistener = new Volcengine.Nlb.Listener("examplelistenerResourceResourceFromNlblistener", new()
    {
        LoadBalancerId = "string",
        Port = 0,
        Protocol = "string",
        ServerGroupId = "string",
        ConnectionTimeout = 0,
        Description = "string",
        Enabled = false,
        EndPort = 0,
        ListenerName = "string",
        StartPort = 0,
        Tags = new[]
        {
            new Volcengine.Nlb.Inputs.ListenerTagArgs
            {
                Key = "string",
                Value = "string",
            },
        },
    });
    
    example, err := nlb.NewListener(ctx, "examplelistenerResourceResourceFromNlblistener", &nlb.ListenerArgs{
    	LoadBalancerId:    pulumi.String("string"),
    	Port:              pulumi.Int(0),
    	Protocol:          pulumi.String("string"),
    	ServerGroupId:     pulumi.String("string"),
    	ConnectionTimeout: pulumi.Int(0),
    	Description:       pulumi.String("string"),
    	Enabled:           pulumi.Bool(false),
    	EndPort:           pulumi.Int(0),
    	ListenerName:      pulumi.String("string"),
    	StartPort:         pulumi.Int(0),
    	Tags: nlb.ListenerTagArray{
    		&nlb.ListenerTagArgs{
    			Key:   pulumi.String("string"),
    			Value: pulumi.String("string"),
    		},
    	},
    })
    
    var examplelistenerResourceResourceFromNlblistener = new com.pulumi.volcengine.nlb.Listener("examplelistenerResourceResourceFromNlblistener", com.pulumi.volcengine.nlb.ListenerArgs.builder()
        .loadBalancerId("string")
        .port(0)
        .protocol("string")
        .serverGroupId("string")
        .connectionTimeout(0)
        .description("string")
        .enabled(false)
        .endPort(0)
        .listenerName("string")
        .startPort(0)
        .tags(ListenerTagArgs.builder()
            .key("string")
            .value("string")
            .build())
        .build());
    
    examplelistener_resource_resource_from_nlblistener = volcengine.nlb.Listener("examplelistenerResourceResourceFromNlblistener",
        load_balancer_id="string",
        port=0,
        protocol="string",
        server_group_id="string",
        connection_timeout=0,
        description="string",
        enabled=False,
        end_port=0,
        listener_name="string",
        start_port=0,
        tags=[{
            "key": "string",
            "value": "string",
        }])
    
    const examplelistenerResourceResourceFromNlblistener = new volcengine.nlb.Listener("examplelistenerResourceResourceFromNlblistener", {
        loadBalancerId: "string",
        port: 0,
        protocol: "string",
        serverGroupId: "string",
        connectionTimeout: 0,
        description: "string",
        enabled: false,
        endPort: 0,
        listenerName: "string",
        startPort: 0,
        tags: [{
            key: "string",
            value: "string",
        }],
    });
    
    type: volcengine:nlb:Listener
    properties:
        connectionTimeout: 0
        description: string
        enabled: false
        endPort: 0
        listenerName: string
        loadBalancerId: string
        port: 0
        protocol: string
        serverGroupId: string
        startPort: 0
        tags:
            - key: string
              value: string
    

    Listener 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 Listener resource accepts the following input properties:

    LoadBalancerId string
    The id of the NLB.
    Port int
    The port of the listener. Range: 0-65535.
    Protocol string
    The protocol of the listener. Valid values: TCP, UDP.
    ServerGroupId string
    The id of the server group.
    ConnectionTimeout int
    The connection timeout of the listener.
    Description string
    The description of the listener.
    Enabled bool
    Whether to enable the listener.
    EndPort int
    The end port of the listener. Range: 0-65535.
    ListenerName string
    The name of the listener.
    StartPort int
    The start port of the listener. Range: 0-65535.
    Tags List<ListenerTag>
    Tags.
    LoadBalancerId string
    The id of the NLB.
    Port int
    The port of the listener. Range: 0-65535.
    Protocol string
    The protocol of the listener. Valid values: TCP, UDP.
    ServerGroupId string
    The id of the server group.
    ConnectionTimeout int
    The connection timeout of the listener.
    Description string
    The description of the listener.
    Enabled bool
    Whether to enable the listener.
    EndPort int
    The end port of the listener. Range: 0-65535.
    ListenerName string
    The name of the listener.
    StartPort int
    The start port of the listener. Range: 0-65535.
    Tags []ListenerTagArgs
    Tags.
    loadBalancerId String
    The id of the NLB.
    port Integer
    The port of the listener. Range: 0-65535.
    protocol String
    The protocol of the listener. Valid values: TCP, UDP.
    serverGroupId String
    The id of the server group.
    connectionTimeout Integer
    The connection timeout of the listener.
    description String
    The description of the listener.
    enabled Boolean
    Whether to enable the listener.
    endPort Integer
    The end port of the listener. Range: 0-65535.
    listenerName String
    The name of the listener.
    startPort Integer
    The start port of the listener. Range: 0-65535.
    tags List<ListenerTag>
    Tags.
    loadBalancerId string
    The id of the NLB.
    port number
    The port of the listener. Range: 0-65535.
    protocol string
    The protocol of the listener. Valid values: TCP, UDP.
    serverGroupId string
    The id of the server group.
    connectionTimeout number
    The connection timeout of the listener.
    description string
    The description of the listener.
    enabled boolean
    Whether to enable the listener.
    endPort number
    The end port of the listener. Range: 0-65535.
    listenerName string
    The name of the listener.
    startPort number
    The start port of the listener. Range: 0-65535.
    tags ListenerTag[]
    Tags.
    load_balancer_id str
    The id of the NLB.
    port int
    The port of the listener. Range: 0-65535.
    protocol str
    The protocol of the listener. Valid values: TCP, UDP.
    server_group_id str
    The id of the server group.
    connection_timeout int
    The connection timeout of the listener.
    description str
    The description of the listener.
    enabled bool
    Whether to enable the listener.
    end_port int
    The end port of the listener. Range: 0-65535.
    listener_name str
    The name of the listener.
    start_port int
    The start port of the listener. Range: 0-65535.
    tags Sequence[ListenerTagArgs]
    Tags.
    loadBalancerId String
    The id of the NLB.
    port Number
    The port of the listener. Range: 0-65535.
    protocol String
    The protocol of the listener. Valid values: TCP, UDP.
    serverGroupId String
    The id of the server group.
    connectionTimeout Number
    The connection timeout of the listener.
    description String
    The description of the listener.
    enabled Boolean
    Whether to enable the listener.
    endPort Number
    The end port of the listener. Range: 0-65535.
    listenerName String
    The name of the listener.
    startPort Number
    The start port of the listener. Range: 0-65535.
    tags List<Property Map>
    Tags.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Listener resource produces the following output properties:

    CreateTime string
    The create time of the listener.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the listener.
    UpdateTime string
    The update time of the listener.
    CreateTime string
    The create time of the listener.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the listener.
    UpdateTime string
    The update time of the listener.
    createTime String
    The create time of the listener.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the listener.
    updateTime String
    The update time of the listener.
    createTime string
    The create time of the listener.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the listener.
    updateTime string
    The update time of the listener.
    create_time str
    The create time of the listener.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the listener.
    update_time str
    The update time of the listener.
    createTime String
    The create time of the listener.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the listener.
    updateTime String
    The update time of the listener.

    Look up Existing Listener Resource

    Get an existing Listener 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?: ListenerState, opts?: CustomResourceOptions): Listener
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            connection_timeout: Optional[int] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            enabled: Optional[bool] = None,
            end_port: Optional[int] = None,
            listener_name: Optional[str] = None,
            load_balancer_id: Optional[str] = None,
            port: Optional[int] = None,
            protocol: Optional[str] = None,
            server_group_id: Optional[str] = None,
            start_port: Optional[int] = None,
            status: Optional[str] = None,
            tags: Optional[Sequence[ListenerTagArgs]] = None,
            update_time: Optional[str] = None) -> Listener
    func GetListener(ctx *Context, name string, id IDInput, state *ListenerState, opts ...ResourceOption) (*Listener, error)
    public static Listener Get(string name, Input<string> id, ListenerState? state, CustomResourceOptions? opts = null)
    public static Listener get(String name, Output<String> id, ListenerState state, CustomResourceOptions options)
    resources:  _:    type: volcengine:nlb:Listener    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.
    The following state arguments are supported:
    ConnectionTimeout int
    The connection timeout of the listener.
    CreateTime string
    The create time of the listener.
    Description string
    The description of the listener.
    Enabled bool
    Whether to enable the listener.
    EndPort int
    The end port of the listener. Range: 0-65535.
    ListenerName string
    The name of the listener.
    LoadBalancerId string
    The id of the NLB.
    Port int
    The port of the listener. Range: 0-65535.
    Protocol string
    The protocol of the listener. Valid values: TCP, UDP.
    ServerGroupId string
    The id of the server group.
    StartPort int
    The start port of the listener. Range: 0-65535.
    Status string
    The status of the listener.
    Tags List<ListenerTag>
    Tags.
    UpdateTime string
    The update time of the listener.
    ConnectionTimeout int
    The connection timeout of the listener.
    CreateTime string
    The create time of the listener.
    Description string
    The description of the listener.
    Enabled bool
    Whether to enable the listener.
    EndPort int
    The end port of the listener. Range: 0-65535.
    ListenerName string
    The name of the listener.
    LoadBalancerId string
    The id of the NLB.
    Port int
    The port of the listener. Range: 0-65535.
    Protocol string
    The protocol of the listener. Valid values: TCP, UDP.
    ServerGroupId string
    The id of the server group.
    StartPort int
    The start port of the listener. Range: 0-65535.
    Status string
    The status of the listener.
    Tags []ListenerTagArgs
    Tags.
    UpdateTime string
    The update time of the listener.
    connectionTimeout Integer
    The connection timeout of the listener.
    createTime String
    The create time of the listener.
    description String
    The description of the listener.
    enabled Boolean
    Whether to enable the listener.
    endPort Integer
    The end port of the listener. Range: 0-65535.
    listenerName String
    The name of the listener.
    loadBalancerId String
    The id of the NLB.
    port Integer
    The port of the listener. Range: 0-65535.
    protocol String
    The protocol of the listener. Valid values: TCP, UDP.
    serverGroupId String
    The id of the server group.
    startPort Integer
    The start port of the listener. Range: 0-65535.
    status String
    The status of the listener.
    tags List<ListenerTag>
    Tags.
    updateTime String
    The update time of the listener.
    connectionTimeout number
    The connection timeout of the listener.
    createTime string
    The create time of the listener.
    description string
    The description of the listener.
    enabled boolean
    Whether to enable the listener.
    endPort number
    The end port of the listener. Range: 0-65535.
    listenerName string
    The name of the listener.
    loadBalancerId string
    The id of the NLB.
    port number
    The port of the listener. Range: 0-65535.
    protocol string
    The protocol of the listener. Valid values: TCP, UDP.
    serverGroupId string
    The id of the server group.
    startPort number
    The start port of the listener. Range: 0-65535.
    status string
    The status of the listener.
    tags ListenerTag[]
    Tags.
    updateTime string
    The update time of the listener.
    connection_timeout int
    The connection timeout of the listener.
    create_time str
    The create time of the listener.
    description str
    The description of the listener.
    enabled bool
    Whether to enable the listener.
    end_port int
    The end port of the listener. Range: 0-65535.
    listener_name str
    The name of the listener.
    load_balancer_id str
    The id of the NLB.
    port int
    The port of the listener. Range: 0-65535.
    protocol str
    The protocol of the listener. Valid values: TCP, UDP.
    server_group_id str
    The id of the server group.
    start_port int
    The start port of the listener. Range: 0-65535.
    status str
    The status of the listener.
    tags Sequence[ListenerTagArgs]
    Tags.
    update_time str
    The update time of the listener.
    connectionTimeout Number
    The connection timeout of the listener.
    createTime String
    The create time of the listener.
    description String
    The description of the listener.
    enabled Boolean
    Whether to enable the listener.
    endPort Number
    The end port of the listener. Range: 0-65535.
    listenerName String
    The name of the listener.
    loadBalancerId String
    The id of the NLB.
    port Number
    The port of the listener. Range: 0-65535.
    protocol String
    The protocol of the listener. Valid values: TCP, UDP.
    serverGroupId String
    The id of the server group.
    startPort Number
    The start port of the listener. Range: 0-65535.
    status String
    The status of the listener.
    tags List<Property Map>
    Tags.
    updateTime String
    The update time of the listener.

    Supporting Types

    ListenerTag, ListenerTagArgs

    Key string
    The Key of Tags.
    Value string
    The Value of Tags.
    Key string
    The Key of Tags.
    Value string
    The Value of Tags.
    key String
    The Key of Tags.
    value String
    The Value of Tags.
    key string
    The Key of Tags.
    value string
    The Value of Tags.
    key str
    The Key of Tags.
    value str
    The Value of Tags.
    key String
    The Key of Tags.
    value String
    The Value of Tags.

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Viewing docs for Volcengine v0.0.47
    published on Friday, Mar 13, 2026 by Volcengine
      Try Pulumi Cloud free. Your team will thank you.