1. Packages
  2. Gcorelabs Provider
  3. API Docs
  4. Lblistener
gcorelabs 0.3.63 published on Monday, Apr 14, 2025 by g-core

gcorelabs.Lblistener

Explore with Pulumi AI

gcorelabs logo
gcorelabs 0.3.63 published on Monday, Apr 14, 2025 by g-core

    Represent load balancer listener. Can not be created without load balancer. A listener is a process that checks for connection requests, using the protocol and port that you configure

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const lb = new gcore.index.Gcore_loadbalancerv2("lb", {
        projectId: 1,
        regionId: 1,
        name: "test",
        flavor: "lb1-1-2",
    });
    const listener = new gcore.index.Gcore_lblistener("listener", {
        projectId: 1,
        regionId: 1,
        name: "test",
        protocol: "TCP",
        protocolPort: 36621,
        loadbalancerId: lb.id,
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    lb = gcore.index.Gcore_loadbalancerv2("lb",
        project_id=1,
        region_id=1,
        name=test,
        flavor=lb1-1-2)
    listener = gcore.index.Gcore_lblistener("listener",
        project_id=1,
        region_id=1,
        name=test,
        protocol=TCP,
        protocol_port=36621,
        loadbalancer_id=lb.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcore/sdk/go/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		lb, err := gcore.NewGcore_loadbalancerv2(ctx, "lb", &gcore.Gcore_loadbalancerv2Args{
    			ProjectId: 1,
    			RegionId:  1,
    			Name:      "test",
    			Flavor:    "lb1-1-2",
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gcore.NewGcore_lblistener(ctx, "listener", &gcore.Gcore_lblistenerArgs{
    			ProjectId:      1,
    			RegionId:       1,
    			Name:           "test",
    			Protocol:       "TCP",
    			ProtocolPort:   36621,
    			LoadbalancerId: lb.Id,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var lb = new Gcore.Index.Gcore_loadbalancerv2("lb", new()
        {
            ProjectId = 1,
            RegionId = 1,
            Name = "test",
            Flavor = "lb1-1-2",
        });
    
        var listener = new Gcore.Index.Gcore_lblistener("listener", new()
        {
            ProjectId = 1,
            RegionId = 1,
            Name = "test",
            Protocol = "TCP",
            ProtocolPort = 36621,
            LoadbalancerId = lb.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.gcore_loadbalancerv2;
    import com.pulumi.gcore.Gcore_loadbalancerv2Args;
    import com.pulumi.gcore.gcore_lblistener;
    import com.pulumi.gcore.Gcore_lblistenerArgs;
    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 lb = new Gcore_loadbalancerv2("lb", Gcore_loadbalancerv2Args.builder()
                .projectId(1)
                .regionId(1)
                .name("test")
                .flavor("lb1-1-2")
                .build());
    
            var listener = new Gcore_lblistener("listener", Gcore_lblistenerArgs.builder()
                .projectId(1)
                .regionId(1)
                .name("test")
                .protocol("TCP")
                .protocolPort(36621)
                .loadbalancerId(lb.id())
                .build());
    
        }
    }
    
    resources:
      lb:
        type: gcore:gcore_loadbalancerv2
        properties:
          projectId: 1
          regionId: 1
          name: test
          flavor: lb1-1-2
      listener:
        type: gcore:gcore_lblistener
        properties:
          projectId: 1
          regionId: 1
          name: test
          protocol: TCP
          protocolPort: 36621
          loadbalancerId: ${lb.id}
    

    Create Lblistener Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Lblistener(name: string, args: LblistenerArgs, opts?: CustomResourceOptions);
    @overload
    def Lblistener(resource_name: str,
                   args: LblistenerArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def Lblistener(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   loadbalancer_id: Optional[str] = None,
                   protocol_port: Optional[float] = None,
                   protocol: Optional[str] = None,
                   project_name: Optional[str] = None,
                   name: Optional[str] = None,
                   project_id: Optional[float] = None,
                   insert_x_forwarded: Optional[bool] = None,
                   lblistener_id: Optional[str] = None,
                   last_updated: Optional[str] = None,
                   region_id: Optional[float] = None,
                   region_name: Optional[str] = None,
                   secret_id: Optional[str] = None,
                   sni_secret_ids: Optional[Sequence[str]] = None,
                   timeouts: Optional[LblistenerTimeoutsArgs] = None)
    func NewLblistener(ctx *Context, name string, args LblistenerArgs, opts ...ResourceOption) (*Lblistener, error)
    public Lblistener(string name, LblistenerArgs args, CustomResourceOptions? opts = null)
    public Lblistener(String name, LblistenerArgs args)
    public Lblistener(String name, LblistenerArgs args, CustomResourceOptions options)
    
    type: gcorelabs:Lblistener
    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 LblistenerArgs
    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 LblistenerArgs
    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 LblistenerArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LblistenerArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LblistenerArgs
    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 lblistenerResource = new Gcorelabs.Lblistener("lblistenerResource", new()
    {
        LoadbalancerId = "string",
        ProtocolPort = 0,
        Protocol = "string",
        ProjectName = "string",
        Name = "string",
        ProjectId = 0,
        InsertXForwarded = false,
        LblistenerId = "string",
        LastUpdated = "string",
        RegionId = 0,
        RegionName = "string",
        SecretId = "string",
        SniSecretIds = new[]
        {
            "string",
        },
        Timeouts = new Gcorelabs.Inputs.LblistenerTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
        },
    });
    
    example, err := gcorelabs.NewLblistener(ctx, "lblistenerResource", &gcorelabs.LblistenerArgs{
    	LoadbalancerId:   pulumi.String("string"),
    	ProtocolPort:     pulumi.Float64(0),
    	Protocol:         pulumi.String("string"),
    	ProjectName:      pulumi.String("string"),
    	Name:             pulumi.String("string"),
    	ProjectId:        pulumi.Float64(0),
    	InsertXForwarded: pulumi.Bool(false),
    	LblistenerId:     pulumi.String("string"),
    	LastUpdated:      pulumi.String("string"),
    	RegionId:         pulumi.Float64(0),
    	RegionName:       pulumi.String("string"),
    	SecretId:         pulumi.String("string"),
    	SniSecretIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Timeouts: &gcorelabs.LblistenerTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    	},
    })
    
    var lblistenerResource = new Lblistener("lblistenerResource", LblistenerArgs.builder()
        .loadbalancerId("string")
        .protocolPort(0)
        .protocol("string")
        .projectName("string")
        .name("string")
        .projectId(0)
        .insertXForwarded(false)
        .lblistenerId("string")
        .lastUpdated("string")
        .regionId(0)
        .regionName("string")
        .secretId("string")
        .sniSecretIds("string")
        .timeouts(LblistenerTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .build())
        .build());
    
    lblistener_resource = gcorelabs.Lblistener("lblistenerResource",
        loadbalancer_id="string",
        protocol_port=0,
        protocol="string",
        project_name="string",
        name="string",
        project_id=0,
        insert_x_forwarded=False,
        lblistener_id="string",
        last_updated="string",
        region_id=0,
        region_name="string",
        secret_id="string",
        sni_secret_ids=["string"],
        timeouts={
            "create": "string",
            "delete": "string",
        })
    
    const lblistenerResource = new gcorelabs.Lblistener("lblistenerResource", {
        loadbalancerId: "string",
        protocolPort: 0,
        protocol: "string",
        projectName: "string",
        name: "string",
        projectId: 0,
        insertXForwarded: false,
        lblistenerId: "string",
        lastUpdated: "string",
        regionId: 0,
        regionName: "string",
        secretId: "string",
        sniSecretIds: ["string"],
        timeouts: {
            create: "string",
            "delete": "string",
        },
    });
    
    type: gcorelabs:Lblistener
    properties:
        insertXForwarded: false
        lastUpdated: string
        lblistenerId: string
        loadbalancerId: string
        name: string
        projectId: 0
        projectName: string
        protocol: string
        protocolPort: 0
        regionId: 0
        regionName: string
        secretId: string
        sniSecretIds:
            - string
        timeouts:
            create: string
            delete: string
    

    Lblistener 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 Lblistener resource accepts the following input properties:

    LoadbalancerId string
    Protocol string
    Available values is 'HTTP', 'HTTPS', 'TCP', 'UDP', 'TERMINATED_HTTPS'
    ProtocolPort double
    InsertXForwarded bool
    Insert *-forwarded headers
    LastUpdated string
    LblistenerId string
    The ID of this resource.
    Name string
    ProjectId double
    ProjectName string
    RegionId double
    RegionName string
    SecretId string
    SniSecretIds List<string>
    Timeouts LblistenerTimeouts
    LoadbalancerId string
    Protocol string
    Available values is 'HTTP', 'HTTPS', 'TCP', 'UDP', 'TERMINATED_HTTPS'
    ProtocolPort float64
    InsertXForwarded bool
    Insert *-forwarded headers
    LastUpdated string
    LblistenerId string
    The ID of this resource.
    Name string
    ProjectId float64
    ProjectName string
    RegionId float64
    RegionName string
    SecretId string
    SniSecretIds []string
    Timeouts LblistenerTimeoutsArgs
    loadbalancerId String
    protocol String
    Available values is 'HTTP', 'HTTPS', 'TCP', 'UDP', 'TERMINATED_HTTPS'
    protocolPort Double
    insertXForwarded Boolean
    Insert *-forwarded headers
    lastUpdated String
    lblistenerId String
    The ID of this resource.
    name String
    projectId Double
    projectName String
    regionId Double
    regionName String
    secretId String
    sniSecretIds List<String>
    timeouts LblistenerTimeouts
    loadbalancerId string
    protocol string
    Available values is 'HTTP', 'HTTPS', 'TCP', 'UDP', 'TERMINATED_HTTPS'
    protocolPort number
    insertXForwarded boolean
    Insert *-forwarded headers
    lastUpdated string
    lblistenerId string
    The ID of this resource.
    name string
    projectId number
    projectName string
    regionId number
    regionName string
    secretId string
    sniSecretIds string[]
    timeouts LblistenerTimeouts
    loadbalancer_id str
    protocol str
    Available values is 'HTTP', 'HTTPS', 'TCP', 'UDP', 'TERMINATED_HTTPS'
    protocol_port float
    insert_x_forwarded bool
    Insert *-forwarded headers
    last_updated str
    lblistener_id str
    The ID of this resource.
    name str
    project_id float
    project_name str
    region_id float
    region_name str
    secret_id str
    sni_secret_ids Sequence[str]
    timeouts LblistenerTimeoutsArgs
    loadbalancerId String
    protocol String
    Available values is 'HTTP', 'HTTPS', 'TCP', 'UDP', 'TERMINATED_HTTPS'
    protocolPort Number
    insertXForwarded Boolean
    Insert *-forwarded headers
    lastUpdated String
    lblistenerId String
    The ID of this resource.
    name String
    projectId Number
    projectName String
    regionId Number
    regionName String
    secretId String
    sniSecretIds List<String>
    timeouts Property Map

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    OperatingStatus string
    PoolCount double
    ProvisioningStatus string
    Id string
    The provider-assigned unique ID for this managed resource.
    OperatingStatus string
    PoolCount float64
    ProvisioningStatus string
    id String
    The provider-assigned unique ID for this managed resource.
    operatingStatus String
    poolCount Double
    provisioningStatus String
    id string
    The provider-assigned unique ID for this managed resource.
    operatingStatus string
    poolCount number
    provisioningStatus string
    id str
    The provider-assigned unique ID for this managed resource.
    operating_status str
    pool_count float
    provisioning_status str
    id String
    The provider-assigned unique ID for this managed resource.
    operatingStatus String
    poolCount Number
    provisioningStatus String

    Look up Existing Lblistener Resource

    Get an existing Lblistener 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?: LblistenerState, opts?: CustomResourceOptions): Lblistener
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            insert_x_forwarded: Optional[bool] = None,
            last_updated: Optional[str] = None,
            lblistener_id: Optional[str] = None,
            loadbalancer_id: Optional[str] = None,
            name: Optional[str] = None,
            operating_status: Optional[str] = None,
            pool_count: Optional[float] = None,
            project_id: Optional[float] = None,
            project_name: Optional[str] = None,
            protocol: Optional[str] = None,
            protocol_port: Optional[float] = None,
            provisioning_status: Optional[str] = None,
            region_id: Optional[float] = None,
            region_name: Optional[str] = None,
            secret_id: Optional[str] = None,
            sni_secret_ids: Optional[Sequence[str]] = None,
            timeouts: Optional[LblistenerTimeoutsArgs] = None) -> Lblistener
    func GetLblistener(ctx *Context, name string, id IDInput, state *LblistenerState, opts ...ResourceOption) (*Lblistener, error)
    public static Lblistener Get(string name, Input<string> id, LblistenerState? state, CustomResourceOptions? opts = null)
    public static Lblistener get(String name, Output<String> id, LblistenerState state, CustomResourceOptions options)
    resources:  _:    type: gcorelabs:Lblistener    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.
    The following state arguments are supported:
    InsertXForwarded bool
    Insert *-forwarded headers
    LastUpdated string
    LblistenerId string
    The ID of this resource.
    LoadbalancerId string
    Name string
    OperatingStatus string
    PoolCount double
    ProjectId double
    ProjectName string
    Protocol string
    Available values is 'HTTP', 'HTTPS', 'TCP', 'UDP', 'TERMINATED_HTTPS'
    ProtocolPort double
    ProvisioningStatus string
    RegionId double
    RegionName string
    SecretId string
    SniSecretIds List<string>
    Timeouts LblistenerTimeouts
    InsertXForwarded bool
    Insert *-forwarded headers
    LastUpdated string
    LblistenerId string
    The ID of this resource.
    LoadbalancerId string
    Name string
    OperatingStatus string
    PoolCount float64
    ProjectId float64
    ProjectName string
    Protocol string
    Available values is 'HTTP', 'HTTPS', 'TCP', 'UDP', 'TERMINATED_HTTPS'
    ProtocolPort float64
    ProvisioningStatus string
    RegionId float64
    RegionName string
    SecretId string
    SniSecretIds []string
    Timeouts LblistenerTimeoutsArgs
    insertXForwarded Boolean
    Insert *-forwarded headers
    lastUpdated String
    lblistenerId String
    The ID of this resource.
    loadbalancerId String
    name String
    operatingStatus String
    poolCount Double
    projectId Double
    projectName String
    protocol String
    Available values is 'HTTP', 'HTTPS', 'TCP', 'UDP', 'TERMINATED_HTTPS'
    protocolPort Double
    provisioningStatus String
    regionId Double
    regionName String
    secretId String
    sniSecretIds List<String>
    timeouts LblistenerTimeouts
    insertXForwarded boolean
    Insert *-forwarded headers
    lastUpdated string
    lblistenerId string
    The ID of this resource.
    loadbalancerId string
    name string
    operatingStatus string
    poolCount number
    projectId number
    projectName string
    protocol string
    Available values is 'HTTP', 'HTTPS', 'TCP', 'UDP', 'TERMINATED_HTTPS'
    protocolPort number
    provisioningStatus string
    regionId number
    regionName string
    secretId string
    sniSecretIds string[]
    timeouts LblistenerTimeouts
    insert_x_forwarded bool
    Insert *-forwarded headers
    last_updated str
    lblistener_id str
    The ID of this resource.
    loadbalancer_id str
    name str
    operating_status str
    pool_count float
    project_id float
    project_name str
    protocol str
    Available values is 'HTTP', 'HTTPS', 'TCP', 'UDP', 'TERMINATED_HTTPS'
    protocol_port float
    provisioning_status str
    region_id float
    region_name str
    secret_id str
    sni_secret_ids Sequence[str]
    timeouts LblistenerTimeoutsArgs
    insertXForwarded Boolean
    Insert *-forwarded headers
    lastUpdated String
    lblistenerId String
    The ID of this resource.
    loadbalancerId String
    name String
    operatingStatus String
    poolCount Number
    projectId Number
    projectName String
    protocol String
    Available values is 'HTTP', 'HTTPS', 'TCP', 'UDP', 'TERMINATED_HTTPS'
    protocolPort Number
    provisioningStatus String
    regionId Number
    regionName String
    secretId String
    sniSecretIds List<String>
    timeouts Property Map

    Supporting Types

    LblistenerTimeouts, LblistenerTimeoutsArgs

    Create string
    Delete string
    Create string
    Delete string
    create String
    delete String
    create string
    delete string
    create str
    delete str
    create String
    delete String

    Import

    import using <project_id>:<region_id>:<lblistener_id>:<loadbalancer_id> format

    $ pulumi import gcorelabs:index/lblistener:Lblistener lblistener1 1:6:a775dd94-4e9c-4da7-9f0e-ffc9ae34446b:447d2959-8ae0-4ca0-8d47-9f050a3637d7
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    gcorelabs g-core/terraform-provider-gcorelabs
    License
    Notes
    This Pulumi package is based on the gcorelabs Terraform Provider.
    gcorelabs logo
    gcorelabs 0.3.63 published on Monday, Apr 14, 2025 by g-core