oci.NetworkLoadBalancer.getListener
Explore with Pulumi AI
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
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 = oci_network_load_balancer_listener.Test_listener.Name,
NetworkLoadBalancerId = oci_network_load_balancer_network_load_balancer.Test_network_load_balancer.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-oci/sdk/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: oci_network_load_balancer_listener.Test_listener.Name,
NetworkLoadBalancerId: oci_network_load_balancer_network_load_balancer.Test_network_load_balancer.Id,
}, nil)
if err != nil {
return err
}
return nil
})
}
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(oci_network_load_balancer_listener.test_listener().name())
.networkLoadBalancerId(oci_network_load_balancer_network_load_balancer.test_network_load_balancer().id())
.build());
}
}
import pulumi
import pulumi_oci as oci
test_listener = oci.NetworkLoadBalancer.get_listener(listener_name=oci_network_load_balancer_listener["test_listener"]["name"],
network_load_balancer_id=oci_network_load_balancer_network_load_balancer["test_network_load_balancer"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testListener = oci.NetworkLoadBalancer.getListener({
listenerName: oci_network_load_balancer_listener.test_listener.name,
networkLoadBalancerId: oci_network_load_balancer_network_load_balancer.test_network_load_balancer.id,
});
variables:
testListener:
fn::invoke:
Function: oci:NetworkLoadBalancer:getListener
Arguments:
listenerName: ${oci_network_load_balancer_listener.test_listener.name}
networkLoadBalancerId: ${oci_network_load_balancer_network_load_balancer.test_network_load_balancer.id}
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>
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]
func GetListener(ctx *Context, args *GetListenerArgs, opts ...InvokeOption) (*GetListenerResult, error)
func GetListenerOutput(ctx *Context, args *GetListenerOutputArgs, opts ...InvokeOption) GetListenerResultOutput
> 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)
}
public static CompletableFuture<GetListenerResult> getListener(GetListenerArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: oci:NetworkLoadBalancer/getListener:getListener
arguments:
# arguments dictionary
The following arguments are supported:
- Listener
Name string The name of the listener to get. Example:
example_listener
- Network
Load stringBalancer Id The OCID of the network load balancer to update.
- Listener
Name string The name of the listener to get. Example:
example_listener
- Network
Load stringBalancer Id The OCID of the network load balancer to update.
- listener
Name String The name of the listener to get. Example:
example_listener
- network
Load StringBalancer Id The OCID of the network load balancer to update.
- listener
Name string The name of the listener to get. Example:
example_listener
- network
Load stringBalancer Id The OCID of the network load balancer to update.
- listener_
name str The name of the listener to get. Example:
example_listener
- network_
load_ strbalancer_ id The OCID of the network load balancer to update.
- listener
Name String The name of the listener to get. Example:
example_listener
- network
Load StringBalancer Id The OCID of the network load balancer to update.
getListener Result
The following output properties are available:
- Default
Backend stringSet Name The name of the associated backend set. Example:
example_backend_set
- Id string
- Ip
Version string IP version associated with the listener.
- Listener
Name string - Name string
A friendly name for the listener. It must be unique and it cannot be changed. Example:
example_listener
- Network
Load stringBalancer Id - 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. For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). To get a list of valid protocols, use the ListNetworkLoadBalancersProtocols operation. Example:
TCP
- Default
Backend stringSet Name The name of the associated backend set. Example:
example_backend_set
- Id string
- Ip
Version string IP version associated with the listener.
- Listener
Name string - Name string
A friendly name for the listener. It must be unique and it cannot be changed. Example:
example_listener
- Network
Load stringBalancer Id - 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. For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). To get a list of valid protocols, use the ListNetworkLoadBalancersProtocols operation. Example:
TCP
- default
Backend StringSet Name The name of the associated backend set. Example:
example_backend_set
- id String
- ip
Version String IP version associated with the listener.
- listener
Name String - name String
A friendly name for the listener. It must be unique and it cannot be changed. Example:
example_listener
- network
Load StringBalancer Id - 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. For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). To get a list of valid protocols, use the ListNetworkLoadBalancersProtocols operation. Example:
TCP
- default
Backend stringSet Name The name of the associated backend set. Example:
example_backend_set
- id string
- ip
Version string IP version associated with the listener.
- listener
Name string - name string
A friendly name for the listener. It must be unique and it cannot be changed. Example:
example_listener
- network
Load stringBalancer Id - 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. For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). To get a list of valid protocols, use the ListNetworkLoadBalancersProtocols operation. Example:
TCP
- default_
backend_ strset_ name The name of the associated backend set. Example:
example_backend_set
- id str
- ip_
version str IP version associated with the listener.
- 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_ strbalancer_ id - 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. For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). To get a list of valid protocols, use the ListNetworkLoadBalancersProtocols operation. Example:
TCP
- default
Backend StringSet Name The name of the associated backend set. Example:
example_backend_set
- id String
- ip
Version String IP version associated with the listener.
- listener
Name String - name String
A friendly name for the listener. It must be unique and it cannot be changed. Example:
example_listener
- network
Load StringBalancer Id - 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. For private network load balancers, ANY protocol refers to TCP/UDP/ICMP (note that ICMP requires isPreserveSourceDestination to be set to true). To get a list of valid protocols, use the ListNetworkLoadBalancersProtocols operation. Example:
TCP
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
oci
Terraform Provider.