1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. NetworkLoadBalancer
  5. getListener
Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

oci.NetworkLoadBalancer.getListener

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

This data source provides details about a specific Listener resource in Oracle Cloud Infrastructure Network Load Balancer service.

Retrieves listener properties associated with a given network load balancer and listener name.

Example Usage

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

const testListener = oci.NetworkLoadBalancer.getListener({
    listenerName: testListenerOciNetworkLoadBalancerListener.name,
    networkLoadBalancerId: testNetworkLoadBalancer.id,
});
Copy
import pulumi
import pulumi_oci as oci

test_listener = oci.NetworkLoadBalancer.get_listener(listener_name=test_listener_oci_network_load_balancer_listener["name"],
    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.GetListener(ctx, &networkloadbalancer.GetListenerArgs{
			ListenerName:          testListenerOciNetworkLoadBalancerListener.Name,
			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 testListener = Oci.NetworkLoadBalancer.GetListener.Invoke(new()
    {
        ListenerName = testListenerOciNetworkLoadBalancerListener.Name,
        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.GetListenerArgs;
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 testListener = NetworkLoadBalancerFunctions.getListener(GetListenerArgs.builder()
            .listenerName(testListenerOciNetworkLoadBalancerListener.name())
            .networkLoadBalancerId(testNetworkLoadBalancer.id())
            .build());

    }
}
Copy
variables:
  testListener:
    fn::invoke:
      function: oci:NetworkLoadBalancer:getListener
      arguments:
        listenerName: ${testListenerOciNetworkLoadBalancerListener.name}
        networkLoadBalancerId: ${testNetworkLoadBalancer.id}
Copy

Using getListener

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 getListener(args: GetListenerArgs, opts?: InvokeOptions): Promise<GetListenerResult>
function getListenerOutput(args: GetListenerOutputArgs, opts?: InvokeOptions): Output<GetListenerResult>
Copy
def get_listener(listener_name: Optional[str] = None,
                 network_load_balancer_id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetListenerResult
def get_listener_output(listener_name: Optional[pulumi.Input[str]] = None,
                 network_load_balancer_id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetListenerResult]
Copy
func GetListener(ctx *Context, args *GetListenerArgs, opts ...InvokeOption) (*GetListenerResult, error)
func GetListenerOutput(ctx *Context, args *GetListenerOutputArgs, opts ...InvokeOption) GetListenerResultOutput
Copy

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

public static class GetListener 
{
    public static Task<GetListenerResult> InvokeAsync(GetListenerArgs args, InvokeOptions? opts = null)
    public static Output<GetListenerResult> Invoke(GetListenerInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetListenerResult> getListener(GetListenerArgs args, InvokeOptions options)
public static Output<GetListenerResult> getListener(GetListenerArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:NetworkLoadBalancer/getListener:getListener
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ListenerName This property is required. string
The name of the listener to get. Example: example_listener
NetworkLoadBalancerId This property is required. string
The OCID of the network load balancer to update.
ListenerName This property is required. string
The name of the listener to get. Example: example_listener
NetworkLoadBalancerId This property is required. string
The OCID of the network load balancer to update.
listenerName This property is required. String
The name of the listener to get. Example: example_listener
networkLoadBalancerId This property is required. String
The OCID of the network load balancer to update.
listenerName This property is required. string
The name of the listener to get. Example: example_listener
networkLoadBalancerId This property is required. string
The OCID of the network load balancer to update.
listener_name This property is required. str
The name of the listener to get. Example: example_listener
network_load_balancer_id This property is required. str
The OCID of the network load balancer to update.
listenerName This property is required. String
The name of the listener to get. Example: example_listener
networkLoadBalancerId This property is required. String
The OCID of the network load balancer to update.

getListener Result

The following output properties are available:

DefaultBackendSetName string
The name of the associated backend set. Example: example_backend_set
Id string
IpVersion string
IP version associated with the listener.
IsPpv2enabled bool
Property to enable/disable PPv2 feature for this listener.
L3ipIdleTimeout int
The duration for L3IP idle timeout in seconds. Example: 200
ListenerName string
Name string
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
NetworkLoadBalancerId string
Port int
The communication port for the listener. Example: 80
Protocol 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 int
The duration for TCP idle timeout in seconds. Example: 300
UdpIdleTimeout int
The duration for UDP idle timeout in seconds. Example: 120
DefaultBackendSetName string
The name of the associated backend set. Example: example_backend_set
Id string
IpVersion string
IP version associated with the listener.
IsPpv2enabled bool
Property to enable/disable PPv2 feature for this listener.
L3ipIdleTimeout int
The duration for L3IP idle timeout in seconds. Example: 200
ListenerName string
Name string
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
NetworkLoadBalancerId string
Port int
The communication port for the listener. Example: 80
Protocol 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 int
The duration for TCP idle timeout in seconds. Example: 300
UdpIdleTimeout int
The duration for UDP idle timeout in seconds. Example: 120
defaultBackendSetName String
The name of the associated backend set. Example: example_backend_set
id String
ipVersion String
IP version associated with the listener.
isPpv2enabled Boolean
Property to enable/disable PPv2 feature for this listener.
l3ipIdleTimeout Integer
The duration for L3IP idle timeout in seconds. Example: 200
listenerName String
name String
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
networkLoadBalancerId String
port Integer
The communication port for the listener. Example: 80
protocol 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 Integer
The duration for TCP idle timeout in seconds. Example: 300
udpIdleTimeout Integer
The duration for UDP idle timeout in seconds. Example: 120
defaultBackendSetName string
The name of the associated backend set. Example: example_backend_set
id string
ipVersion string
IP version associated with the listener.
isPpv2enabled boolean
Property to enable/disable PPv2 feature for this listener.
l3ipIdleTimeout number
The duration for L3IP idle timeout in seconds. Example: 200
listenerName string
name string
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
networkLoadBalancerId string
port number
The communication port for the listener. Example: 80
protocol 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 number
The duration for TCP idle timeout in seconds. Example: 300
udpIdleTimeout number
The duration for UDP idle timeout in seconds. Example: 120
default_backend_set_name str
The name of the associated backend set. Example: example_backend_set
id str
ip_version str
IP version associated with the listener.
is_ppv2enabled bool
Property to enable/disable PPv2 feature for this listener.
l3ip_idle_timeout int
The duration for L3IP idle timeout in seconds. Example: 200
listener_name str
name str
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
network_load_balancer_id str
port int
The communication port for the listener. Example: 80
protocol 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 int
The duration for TCP idle timeout in seconds. Example: 300
udp_idle_timeout int
The duration for UDP idle timeout in seconds. Example: 120
defaultBackendSetName String
The name of the associated backend set. Example: example_backend_set
id String
ipVersion String
IP version associated with the listener.
isPpv2enabled Boolean
Property to enable/disable PPv2 feature for this listener.
l3ipIdleTimeout Number
The duration for L3IP idle timeout in seconds. Example: 200
listenerName String
name String
A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
networkLoadBalancerId String
port Number
The communication port for the listener. Example: 80
protocol 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 Number
The duration for TCP idle timeout in seconds. Example: 300
udpIdleTimeout 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.29.0 published on Wednesday, Apr 9, 2025 by Pulumi