published on Friday, Mar 13, 2026 by Volcengine
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:
- Load
Balancer stringId - 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. - Server
Group stringId - The id of the server group.
- Connection
Timeout int - The connection timeout of the listener.
- Description string
- 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 string - The name of the listener.
- Start
Port int - The start port of the listener. Range: 0-65535.
-
List<Listener
Tag> - Tags.
- Load
Balancer stringId - 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. - Server
Group stringId - The id of the server group.
- Connection
Timeout int - The connection timeout of the listener.
- Description string
- 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 string - The name of the listener.
- Start
Port int - The start port of the listener. Range: 0-65535.
-
[]Listener
Tag Args - Tags.
- load
Balancer StringId - 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. - server
Group StringId - The id of the server group.
- connection
Timeout Integer - The connection timeout of the listener.
- description String
- The description of the listener.
- enabled Boolean
- Whether to enable the listener.
- end
Port Integer - The end port of the listener. Range: 0-65535.
- listener
Name String - The name of the listener.
- start
Port Integer - The start port of the listener. Range: 0-65535.
-
List<Listener
Tag> - Tags.
- load
Balancer stringId - 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. - server
Group stringId - The id of the server group.
- connection
Timeout number - The connection timeout of the listener.
- description string
- The description of the listener.
- enabled boolean
- Whether to enable the listener.
- end
Port number - The end port of the listener. Range: 0-65535.
- listener
Name string - The name of the listener.
- start
Port number - The start port of the listener. Range: 0-65535.
-
Listener
Tag[] - Tags.
- load_
balancer_ strid - 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_ strid - 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.
-
Sequence[Listener
Tag Args] - Tags.
- load
Balancer StringId - 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. - server
Group StringId - The id of the server group.
- connection
Timeout Number - The connection timeout of the listener.
- description String
- The description of the listener.
- enabled Boolean
- Whether to enable the listener.
- end
Port Number - The end port of the listener. Range: 0-65535.
- listener
Name String - The name of the listener.
- start
Port Number - The start port of the listener. Range: 0-65535.
- List<Property Map>
- Tags.
Outputs
All input properties are implicitly available as output properties. Additionally, the Listener resource produces the following output properties:
- Create
Time 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.
- Update
Time string - The update time of the listener.
- Create
Time 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.
- Update
Time string - The update time of the listener.
- create
Time 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.
- update
Time String - The update time of the listener.
- create
Time 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.
- update
Time 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.
- create
Time 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.
- update
Time 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) -> Listenerfunc 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.
- Connection
Timeout int - The connection timeout of the listener.
- Create
Time string - The create time of the listener.
- Description string
- 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 string - The name of the listener.
- Load
Balancer stringId - 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. - Server
Group stringId - The id of the server group.
- Start
Port int - The start port of the listener. Range: 0-65535.
- Status string
- The status of the listener.
-
List<Listener
Tag> - Tags.
- Update
Time string - The update time of the listener.
- Connection
Timeout int - The connection timeout of the listener.
- Create
Time string - The create time of the listener.
- Description string
- 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 string - The name of the listener.
- Load
Balancer stringId - 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. - Server
Group stringId - The id of the server group.
- Start
Port int - The start port of the listener. Range: 0-65535.
- Status string
- The status of the listener.
-
[]Listener
Tag Args - Tags.
- Update
Time string - The update time of the listener.
- connection
Timeout Integer - The connection timeout of the listener.
- create
Time String - The create time of the listener.
- description String
- The description of the listener.
- enabled Boolean
- Whether to enable the listener.
- end
Port Integer - The end port of the listener. Range: 0-65535.
- listener
Name String - The name of the listener.
- load
Balancer StringId - 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. - server
Group StringId - The id of the server group.
- start
Port Integer - The start port of the listener. Range: 0-65535.
- status String
- The status of the listener.
-
List<Listener
Tag> - Tags.
- update
Time String - The update time of the listener.
- connection
Timeout number - The connection timeout of the listener.
- create
Time string - The create time of the listener.
- description string
- The description of the listener.
- enabled boolean
- Whether to enable the listener.
- end
Port number - The end port of the listener. Range: 0-65535.
- listener
Name string - The name of the listener.
- load
Balancer stringId - 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. - server
Group stringId - The id of the server group.
- start
Port number - The start port of the listener. Range: 0-65535.
- status string
- The status of the listener.
-
Listener
Tag[] - Tags.
- update
Time 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_ strid - 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_ strid - 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.
-
Sequence[Listener
Tag Args] - Tags.
- update_
time str - The update time of the listener.
- connection
Timeout Number - The connection timeout of the listener.
- create
Time String - The create time of the listener.
- description String
- The description of the listener.
- enabled Boolean
- Whether to enable the listener.
- end
Port Number - The end port of the listener. Range: 0-65535.
- listener
Name String - The name of the listener.
- load
Balancer StringId - 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. - server
Group StringId - The id of the server group.
- start
Port Number - The start port of the listener. Range: 0-65535.
- status String
- The status of the listener.
- List<Property Map>
- Tags.
- update
Time String - The update time of the listener.
Supporting Types
ListenerTag, ListenerTagArgs
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
volcengineTerraform Provider.
published on Friday, Mar 13, 2026 by Volcengine
