1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. NetworkLoadBalancer
  5. getListeners
Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi

oci.NetworkLoadBalancer.getListeners

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi

This data source provides the list of Listeners in Oracle Cloud Infrastructure Network Load Balancer service.

Lists all listeners associated with a given network load balancer.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testListeners = oci.NetworkLoadBalancer.getListeners({
    networkLoadBalancerId: testNetworkLoadBalancer.id,
});
Copy
import pulumi
import pulumi_oci as oci

test_listeners = oci.NetworkLoadBalancer.get_listeners(network_load_balancer_id=test_network_load_balancer["id"])
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/networkloadbalancer"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := networkloadbalancer.GetListeners(ctx, &networkloadbalancer.GetListenersArgs{
			NetworkLoadBalancerId: testNetworkLoadBalancer.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testListeners = Oci.NetworkLoadBalancer.GetListeners.Invoke(new()
    {
        NetworkLoadBalancerId = testNetworkLoadBalancer.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.NetworkLoadBalancer.NetworkLoadBalancerFunctions;
import com.pulumi.oci.NetworkLoadBalancer.inputs.GetListenersArgs;
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) {
        final var testListeners = NetworkLoadBalancerFunctions.getListeners(GetListenersArgs.builder()
            .networkLoadBalancerId(testNetworkLoadBalancer.id())
            .build());

    }
}
Copy
variables:
  testListeners:
    fn::invoke:
      function: oci:NetworkLoadBalancer:getListeners
      arguments:
        networkLoadBalancerId: ${testNetworkLoadBalancer.id}
Copy

Using getListeners

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getListeners(args: GetListenersArgs, opts?: InvokeOptions): Promise<GetListenersResult>
function getListenersOutput(args: GetListenersOutputArgs, opts?: InvokeOptions): Output<GetListenersResult>
Copy
def get_listeners(filters: Optional[Sequence[_networkloadbalancer.GetListenersFilter]] = None,
                  network_load_balancer_id: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetListenersResult
def get_listeners_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[_networkloadbalancer.GetListenersFilterArgs]]]] = None,
                  network_load_balancer_id: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetListenersResult]
Copy
func GetListeners(ctx *Context, args *GetListenersArgs, opts ...InvokeOption) (*GetListenersResult, error)
func GetListenersOutput(ctx *Context, args *GetListenersOutputArgs, opts ...InvokeOption) GetListenersResultOutput
Copy

> Note: This function is named GetListeners in the Go SDK.

public static class GetListeners 
{
    public static Task<GetListenersResult> InvokeAsync(GetListenersArgs args, InvokeOptions? opts = null)
    public static Output<GetListenersResult> Invoke(GetListenersInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetListenersResult> getListeners(GetListenersArgs args, InvokeOptions options)
public static Output<GetListenersResult> getListeners(GetListenersArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:NetworkLoadBalancer/getListeners:getListeners
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

NetworkLoadBalancerId This property is required. string
The OCID of the network load balancer to update.
Filters Changes to this property will trigger replacement. List<GetListenersFilter>
NetworkLoadBalancerId This property is required. string
The OCID of the network load balancer to update.
Filters Changes to this property will trigger replacement. []GetListenersFilter
networkLoadBalancerId This property is required. String
The OCID of the network load balancer to update.
filters Changes to this property will trigger replacement. List<GetListenersFilter>
networkLoadBalancerId This property is required. string
The OCID of the network load balancer to update.
filters Changes to this property will trigger replacement. GetListenersFilter[]
network_load_balancer_id This property is required. str
The OCID of the network load balancer to update.
filters Changes to this property will trigger replacement. Sequence[networkloadbalancer.GetListenersFilter]
networkLoadBalancerId This property is required. String
The OCID of the network load balancer to update.
filters Changes to this property will trigger replacement. List<Property Map>

getListeners Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
ListenerCollections List<GetListenersListenerCollection>
The list of listener_collection.
NetworkLoadBalancerId string
Filters List<GetListenersFilter>
Id string
The provider-assigned unique ID for this managed resource.
ListenerCollections []GetListenersListenerCollection
The list of listener_collection.
NetworkLoadBalancerId string
Filters []GetListenersFilter
id String
The provider-assigned unique ID for this managed resource.
listenerCollections List<GetListenersListenerCollection>
The list of listener_collection.
networkLoadBalancerId String
filters List<GetListenersFilter>
id string
The provider-assigned unique ID for this managed resource.
listenerCollections GetListenersListenerCollection[]
The list of listener_collection.
networkLoadBalancerId string
filters GetListenersFilter[]
id String
The provider-assigned unique ID for this managed resource.
listenerCollections List<Property Map>
The list of listener_collection.
networkLoadBalancerId String
filters List<Property Map>

Supporting Types

GetListenersFilter

Name This property is required. string
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
Values This property is required. List<string>
Regex bool
Name This property is required. string
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
Values This property is required. []string
Regex bool
name This property is required. String
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
values This property is required. List<String>
regex Boolean
name This property is required. string
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
values This property is required. string[]
regex boolean
name This property is required. str
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
values This property is required. Sequence[str]
regex bool
name This property is required. String
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
values This property is required. List<String>
regex Boolean

GetListenersListenerCollection

Items This property is required. []GetListenersListenerCollectionItem
items This property is required. GetListenersListenerCollectionItem[]
items This property is required. List<Property Map>

GetListenersListenerCollectionItem

DefaultBackendSetName This property is required. string
The name of the associated backend set. Example: example_backend_set
Id This property is required. string
IpVersion This property is required. string
IP version associated with the listener.
IsPpv2enabled This property is required. bool
Property to enable/disable PPv2 feature for this listener.
L3ipIdleTimeout This property is required. int
The duration for L3IP idle timeout in seconds. Example: 200
Name This property is required. string
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
NetworkLoadBalancerId This property is required. string
The OCID of the network load balancer to update.
Port This property is required. int
The communication port for the listener. Example: 80
Protocol This property is required. string
The protocol on which the listener accepts connection requests. For public network load balancers, ANY protocol refers to TCP/UDP with the wildcard port. For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). "ListNetworkLoadBalancersProtocols" API is deprecated and it will not return the updated values. Use the allowed values for the protocol instead. Example: TCP
TcpIdleTimeout This property is required. int
The duration for TCP idle timeout in seconds. Example: 300
UdpIdleTimeout This property is required. int
The duration for UDP idle timeout in seconds. Example: 120
DefaultBackendSetName This property is required. string
The name of the associated backend set. Example: example_backend_set
Id This property is required. string
IpVersion This property is required. string
IP version associated with the listener.
IsPpv2enabled This property is required. bool
Property to enable/disable PPv2 feature for this listener.
L3ipIdleTimeout This property is required. int
The duration for L3IP idle timeout in seconds. Example: 200
Name This property is required. string
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
NetworkLoadBalancerId This property is required. string
The OCID of the network load balancer to update.
Port This property is required. int
The communication port for the listener. Example: 80
Protocol This property is required. string
The protocol on which the listener accepts connection requests. For public network load balancers, ANY protocol refers to TCP/UDP with the wildcard port. For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). "ListNetworkLoadBalancersProtocols" API is deprecated and it will not return the updated values. Use the allowed values for the protocol instead. Example: TCP
TcpIdleTimeout This property is required. int
The duration for TCP idle timeout in seconds. Example: 300
UdpIdleTimeout This property is required. int
The duration for UDP idle timeout in seconds. Example: 120
defaultBackendSetName This property is required. String
The name of the associated backend set. Example: example_backend_set
id This property is required. String
ipVersion This property is required. String
IP version associated with the listener.
isPpv2enabled This property is required. Boolean
Property to enable/disable PPv2 feature for this listener.
l3ipIdleTimeout This property is required. Integer
The duration for L3IP idle timeout in seconds. Example: 200
name This property is required. String
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
networkLoadBalancerId This property is required. String
The OCID of the network load balancer to update.
port This property is required. Integer
The communication port for the listener. Example: 80
protocol This property is required. String
The protocol on which the listener accepts connection requests. For public network load balancers, ANY protocol refers to TCP/UDP with the wildcard port. For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). "ListNetworkLoadBalancersProtocols" API is deprecated and it will not return the updated values. Use the allowed values for the protocol instead. Example: TCP
tcpIdleTimeout This property is required. Integer
The duration for TCP idle timeout in seconds. Example: 300
udpIdleTimeout This property is required. Integer
The duration for UDP idle timeout in seconds. Example: 120
defaultBackendSetName This property is required. string
The name of the associated backend set. Example: example_backend_set
id This property is required. string
ipVersion This property is required. string
IP version associated with the listener.
isPpv2enabled This property is required. boolean
Property to enable/disable PPv2 feature for this listener.
l3ipIdleTimeout This property is required. number
The duration for L3IP idle timeout in seconds. Example: 200
name This property is required. string
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
networkLoadBalancerId This property is required. string
The OCID of the network load balancer to update.
port This property is required. number
The communication port for the listener. Example: 80
protocol This property is required. string
The protocol on which the listener accepts connection requests. For public network load balancers, ANY protocol refers to TCP/UDP with the wildcard port. For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). "ListNetworkLoadBalancersProtocols" API is deprecated and it will not return the updated values. Use the allowed values for the protocol instead. Example: TCP
tcpIdleTimeout This property is required. number
The duration for TCP idle timeout in seconds. Example: 300
udpIdleTimeout This property is required. number
The duration for UDP idle timeout in seconds. Example: 120
default_backend_set_name This property is required. str
The name of the associated backend set. Example: example_backend_set
id This property is required. str
ip_version This property is required. str
IP version associated with the listener.
is_ppv2enabled This property is required. bool
Property to enable/disable PPv2 feature for this listener.
l3ip_idle_timeout This property is required. int
The duration for L3IP idle timeout in seconds. Example: 200
name This property is required. str
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
network_load_balancer_id This property is required. str
The OCID of the network load balancer to update.
port This property is required. int
The communication port for the listener. Example: 80
protocol This property is required. str
The protocol on which the listener accepts connection requests. For public network load balancers, ANY protocol refers to TCP/UDP with the wildcard port. For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). "ListNetworkLoadBalancersProtocols" API is deprecated and it will not return the updated values. Use the allowed values for the protocol instead. Example: TCP
tcp_idle_timeout This property is required. int
The duration for TCP idle timeout in seconds. Example: 300
udp_idle_timeout This property is required. int
The duration for UDP idle timeout in seconds. Example: 120
defaultBackendSetName This property is required. String
The name of the associated backend set. Example: example_backend_set
id This property is required. String
ipVersion This property is required. String
IP version associated with the listener.
isPpv2enabled This property is required. Boolean
Property to enable/disable PPv2 feature for this listener.
l3ipIdleTimeout This property is required. Number
The duration for L3IP idle timeout in seconds. Example: 200
name This property is required. String
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
networkLoadBalancerId This property is required. String
The OCID of the network load balancer to update.
port This property is required. Number
The communication port for the listener. Example: 80
protocol This property is required. String
The protocol on which the listener accepts connection requests. For public network load balancers, ANY protocol refers to TCP/UDP with the wildcard port. For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). "ListNetworkLoadBalancersProtocols" API is deprecated and it will not return the updated values. Use the allowed values for the protocol instead. Example: TCP
tcpIdleTimeout This property is required. Number
The duration for TCP idle timeout in seconds. Example: 300
udpIdleTimeout This property is required. Number
The duration for UDP idle timeout in seconds. Example: 120

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi