1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. NetworkLoadBalancer
  5. Listener
Oracle Cloud Infrastructure v1.27.0 published on Friday, Mar 15, 2024 by Pulumi

oci.NetworkLoadBalancer.Listener

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.27.0 published on Friday, Mar 15, 2024 by Pulumi

    This resource provides the Listener resource in Oracle Cloud Infrastructure Network Load Balancer service.

    Adds a listener to a network load balancer.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testListener = new oci.networkloadbalancer.Listener("testListener", {
        defaultBackendSetName: oci_network_load_balancer_backend_set.test_backend_set.name,
        networkLoadBalancerId: oci_network_load_balancer_network_load_balancer.test_network_load_balancer.id,
        port: _var.listener_port,
        protocol: _var.listener_protocol,
        ipVersion: _var.listener_ip_version,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_listener = oci.network_load_balancer.Listener("testListener",
        default_backend_set_name=oci_network_load_balancer_backend_set["test_backend_set"]["name"],
        network_load_balancer_id=oci_network_load_balancer_network_load_balancer["test_network_load_balancer"]["id"],
        port=var["listener_port"],
        protocol=var["listener_protocol"],
        ip_version=var["listener_ip_version"])
    
    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.NewListener(ctx, "testListener", &NetworkLoadBalancer.ListenerArgs{
    			DefaultBackendSetName: pulumi.Any(oci_network_load_balancer_backend_set.Test_backend_set.Name),
    			NetworkLoadBalancerId: pulumi.Any(oci_network_load_balancer_network_load_balancer.Test_network_load_balancer.Id),
    			Port:                  pulumi.Any(_var.Listener_port),
    			Protocol:              pulumi.Any(_var.Listener_protocol),
    			IpVersion:             pulumi.Any(_var.Listener_ip_version),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testListener = new Oci.NetworkLoadBalancer.Listener("testListener", new()
        {
            DefaultBackendSetName = oci_network_load_balancer_backend_set.Test_backend_set.Name,
            NetworkLoadBalancerId = oci_network_load_balancer_network_load_balancer.Test_network_load_balancer.Id,
            Port = @var.Listener_port,
            Protocol = @var.Listener_protocol,
            IpVersion = @var.Listener_ip_version,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.NetworkLoadBalancer.Listener;
    import com.pulumi.oci.NetworkLoadBalancer.ListenerArgs;
    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) {
            var testListener = new Listener("testListener", ListenerArgs.builder()        
                .defaultBackendSetName(oci_network_load_balancer_backend_set.test_backend_set().name())
                .networkLoadBalancerId(oci_network_load_balancer_network_load_balancer.test_network_load_balancer().id())
                .port(var_.listener_port())
                .protocol(var_.listener_protocol())
                .ipVersion(var_.listener_ip_version())
                .build());
    
        }
    }
    
    resources:
      testListener:
        type: oci:NetworkLoadBalancer:Listener
        properties:
          #Required
          defaultBackendSetName: ${oci_network_load_balancer_backend_set.test_backend_set.name}
          networkLoadBalancerId: ${oci_network_load_balancer_network_load_balancer.test_network_load_balancer.id}
          port: ${var.listener_port}
          protocol: ${var.listener_protocol}
          #Optional
          ipVersion: ${var.listener_ip_version}
    

    Create Listener Resource

    new Listener(name: string, args: ListenerArgs, opts?: CustomResourceOptions);
    @overload
    def Listener(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 default_backend_set_name: Optional[str] = None,
                 ip_version: Optional[str] = None,
                 name: Optional[str] = None,
                 network_load_balancer_id: Optional[str] = None,
                 port: Optional[int] = None,
                 protocol: Optional[str] = None)
    @overload
    def Listener(resource_name: str,
                 args: ListenerArgs,
                 opts: Optional[ResourceOptions] = 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: oci:NetworkLoadBalancer:Listener
    properties: # The arguments to resource properties.
    options: # 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.
    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.

    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

    The Listener resource accepts the following input properties:

    DefaultBackendSetName string
    (Updatable) The name of the associated backend set. Example: example_backend_set
    NetworkLoadBalancerId string
    The OCID of the network load balancer to update.
    Port int
    (Updatable) The communication port for the listener. Example: 80
    Protocol string

    (Updatable) 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

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    IpVersion string
    (Updatable) IP version associated with the listener.
    Name string
    A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
    DefaultBackendSetName string
    (Updatable) The name of the associated backend set. Example: example_backend_set
    NetworkLoadBalancerId string
    The OCID of the network load balancer to update.
    Port int
    (Updatable) The communication port for the listener. Example: 80
    Protocol string

    (Updatable) 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

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    IpVersion string
    (Updatable) IP version associated with the listener.
    Name string
    A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
    defaultBackendSetName String
    (Updatable) The name of the associated backend set. Example: example_backend_set
    networkLoadBalancerId String
    The OCID of the network load balancer to update.
    port Integer
    (Updatable) The communication port for the listener. Example: 80
    protocol String

    (Updatable) 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

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    ipVersion String
    (Updatable) IP version associated with the listener.
    name String
    A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
    defaultBackendSetName string
    (Updatable) The name of the associated backend set. Example: example_backend_set
    networkLoadBalancerId string
    The OCID of the network load balancer to update.
    port number
    (Updatable) The communication port for the listener. Example: 80
    protocol string

    (Updatable) 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

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    ipVersion string
    (Updatable) IP version associated with the listener.
    name string
    A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
    default_backend_set_name str
    (Updatable) The name of the associated backend set. Example: example_backend_set
    network_load_balancer_id str
    The OCID of the network load balancer to update.
    port int
    (Updatable) The communication port for the listener. Example: 80
    protocol str

    (Updatable) 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

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    ip_version str
    (Updatable) IP version associated with the listener.
    name str
    A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
    defaultBackendSetName String
    (Updatable) The name of the associated backend set. Example: example_backend_set
    networkLoadBalancerId String
    The OCID of the network load balancer to update.
    port Number
    (Updatable) The communication port for the listener. Example: 80
    protocol String

    (Updatable) 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

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    ipVersion String
    (Updatable) IP version associated with the listener.
    name String
    A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    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,
            default_backend_set_name: Optional[str] = None,
            ip_version: Optional[str] = None,
            name: Optional[str] = None,
            network_load_balancer_id: Optional[str] = None,
            port: Optional[int] = None,
            protocol: 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)
    Resource lookup is not supported in YAML
    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:
    DefaultBackendSetName string
    (Updatable) The name of the associated backend set. Example: example_backend_set
    IpVersion string
    (Updatable) IP version associated with the listener.
    Name string
    A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
    NetworkLoadBalancerId string
    The OCID of the network load balancer to update.
    Port int
    (Updatable) The communication port for the listener. Example: 80
    Protocol string

    (Updatable) 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

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    DefaultBackendSetName string
    (Updatable) The name of the associated backend set. Example: example_backend_set
    IpVersion string
    (Updatable) IP version associated with the listener.
    Name string
    A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
    NetworkLoadBalancerId string
    The OCID of the network load balancer to update.
    Port int
    (Updatable) The communication port for the listener. Example: 80
    Protocol string

    (Updatable) 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

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    defaultBackendSetName String
    (Updatable) The name of the associated backend set. Example: example_backend_set
    ipVersion String
    (Updatable) IP version associated with the listener.
    name String
    A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
    networkLoadBalancerId String
    The OCID of the network load balancer to update.
    port Integer
    (Updatable) The communication port for the listener. Example: 80
    protocol String

    (Updatable) 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

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    defaultBackendSetName string
    (Updatable) The name of the associated backend set. Example: example_backend_set
    ipVersion string
    (Updatable) IP version associated with the listener.
    name string
    A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
    networkLoadBalancerId string
    The OCID of the network load balancer to update.
    port number
    (Updatable) The communication port for the listener. Example: 80
    protocol string

    (Updatable) 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

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    default_backend_set_name str
    (Updatable) The name of the associated backend set. Example: example_backend_set
    ip_version str
    (Updatable) IP version associated with the listener.
    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
    The OCID of the network load balancer to update.
    port int
    (Updatable) The communication port for the listener. Example: 80
    protocol str

    (Updatable) 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

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    defaultBackendSetName String
    (Updatable) The name of the associated backend set. Example: example_backend_set
    ipVersion String
    (Updatable) IP version associated with the listener.
    name String
    A friendly name for the listener. It must be unique and it cannot be changed. Example: example_listener
    networkLoadBalancerId String
    The OCID of the network load balancer to update.
    port Number
    (Updatable) The communication port for the listener. Example: 80
    protocol String

    (Updatable) 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

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Import

    Listeners can be imported using the id, e.g.

    $ pulumi import oci:NetworkLoadBalancer/listener:Listener test_listener "networkLoadBalancers/{networkLoadBalancerId}/listeners/{listenerName}"
    

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.27.0 published on Friday, Mar 15, 2024 by Pulumi