1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getGaapLayer4Listeners
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.getGaapLayer4Listeners

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Use this data source to query gaap layer4 listeners.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const fooGaapProxy = new tencentcloud.GaapProxy("fooGaapProxy", {
        bandwidth: 10,
        concurrent: 2,
        accessRegion: "SouthChina",
        realserverRegion: "NorthChina",
    });
    const fooGaapRealserver = new tencentcloud.GaapRealserver("fooGaapRealserver", {ip: "1.1.1.1"});
    const fooGaapLayer4Listener = new tencentcloud.GaapLayer4Listener("fooGaapLayer4Listener", {
        protocol: "TCP",
        port: 80,
        realserverType: "IP",
        proxyId: fooGaapProxy.gaapProxyId,
        healthCheck: true,
        interval: 5,
        connectTimeout: 2,
        realserverBindSets: [{
            id: fooGaapRealserver.gaapRealserverId,
            ip: fooGaapRealserver.ip,
            port: 80,
        }],
    });
    const fooGaapLayer4Listeners = tencentcloud.getGaapLayer4ListenersOutput({
        protocol: "TCP",
        proxyId: fooGaapProxy.gaapProxyId,
        listenerId: fooGaapLayer4Listener.gaapLayer4ListenerId,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    foo_gaap_proxy = tencentcloud.GaapProxy("fooGaapProxy",
        bandwidth=10,
        concurrent=2,
        access_region="SouthChina",
        realserver_region="NorthChina")
    foo_gaap_realserver = tencentcloud.GaapRealserver("fooGaapRealserver", ip="1.1.1.1")
    foo_gaap_layer4_listener = tencentcloud.GaapLayer4Listener("fooGaapLayer4Listener",
        protocol="TCP",
        port=80,
        realserver_type="IP",
        proxy_id=foo_gaap_proxy.gaap_proxy_id,
        health_check=True,
        interval=5,
        connect_timeout=2,
        realserver_bind_sets=[{
            "id": foo_gaap_realserver.gaap_realserver_id,
            "ip": foo_gaap_realserver.ip,
            "port": 80,
        }])
    foo_gaap_layer4_listeners = tencentcloud.get_gaap_layer4_listeners_output(protocol="TCP",
        proxy_id=foo_gaap_proxy.gaap_proxy_id,
        listener_id=foo_gaap_layer4_listener.gaap_layer4_listener_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fooGaapProxy, err := tencentcloud.NewGaapProxy(ctx, "fooGaapProxy", &tencentcloud.GaapProxyArgs{
    			Bandwidth:        pulumi.Float64(10),
    			Concurrent:       pulumi.Float64(2),
    			AccessRegion:     pulumi.String("SouthChina"),
    			RealserverRegion: pulumi.String("NorthChina"),
    		})
    		if err != nil {
    			return err
    		}
    		fooGaapRealserver, err := tencentcloud.NewGaapRealserver(ctx, "fooGaapRealserver", &tencentcloud.GaapRealserverArgs{
    			Ip: pulumi.String("1.1.1.1"),
    		})
    		if err != nil {
    			return err
    		}
    		fooGaapLayer4Listener, err := tencentcloud.NewGaapLayer4Listener(ctx, "fooGaapLayer4Listener", &tencentcloud.GaapLayer4ListenerArgs{
    			Protocol:       pulumi.String("TCP"),
    			Port:           pulumi.Float64(80),
    			RealserverType: pulumi.String("IP"),
    			ProxyId:        fooGaapProxy.GaapProxyId,
    			HealthCheck:    pulumi.Bool(true),
    			Interval:       pulumi.Float64(5),
    			ConnectTimeout: pulumi.Float64(2),
    			RealserverBindSets: tencentcloud.GaapLayer4ListenerRealserverBindSetArray{
    				&tencentcloud.GaapLayer4ListenerRealserverBindSetArgs{
    					Id:   fooGaapRealserver.GaapRealserverId,
    					Ip:   fooGaapRealserver.Ip,
    					Port: pulumi.Float64(80),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_ = tencentcloud.GetGaapLayer4ListenersOutput(ctx, tencentcloud.GetGaapLayer4ListenersOutputArgs{
    			Protocol:   pulumi.String("TCP"),
    			ProxyId:    fooGaapProxy.GaapProxyId,
    			ListenerId: fooGaapLayer4Listener.GaapLayer4ListenerId,
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var fooGaapProxy = new Tencentcloud.GaapProxy("fooGaapProxy", new()
        {
            Bandwidth = 10,
            Concurrent = 2,
            AccessRegion = "SouthChina",
            RealserverRegion = "NorthChina",
        });
    
        var fooGaapRealserver = new Tencentcloud.GaapRealserver("fooGaapRealserver", new()
        {
            Ip = "1.1.1.1",
        });
    
        var fooGaapLayer4Listener = new Tencentcloud.GaapLayer4Listener("fooGaapLayer4Listener", new()
        {
            Protocol = "TCP",
            Port = 80,
            RealserverType = "IP",
            ProxyId = fooGaapProxy.GaapProxyId,
            HealthCheck = true,
            Interval = 5,
            ConnectTimeout = 2,
            RealserverBindSets = new[]
            {
                new Tencentcloud.Inputs.GaapLayer4ListenerRealserverBindSetArgs
                {
                    Id = fooGaapRealserver.GaapRealserverId,
                    Ip = fooGaapRealserver.Ip,
                    Port = 80,
                },
            },
        });
    
        var fooGaapLayer4Listeners = Tencentcloud.GetGaapLayer4Listeners.Invoke(new()
        {
            Protocol = "TCP",
            ProxyId = fooGaapProxy.GaapProxyId,
            ListenerId = fooGaapLayer4Listener.GaapLayer4ListenerId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.GaapProxy;
    import com.pulumi.tencentcloud.GaapProxyArgs;
    import com.pulumi.tencentcloud.GaapRealserver;
    import com.pulumi.tencentcloud.GaapRealserverArgs;
    import com.pulumi.tencentcloud.GaapLayer4Listener;
    import com.pulumi.tencentcloud.GaapLayer4ListenerArgs;
    import com.pulumi.tencentcloud.inputs.GaapLayer4ListenerRealserverBindSetArgs;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetGaapLayer4ListenersArgs;
    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 fooGaapProxy = new GaapProxy("fooGaapProxy", GaapProxyArgs.builder()
                .bandwidth(10)
                .concurrent(2)
                .accessRegion("SouthChina")
                .realserverRegion("NorthChina")
                .build());
    
            var fooGaapRealserver = new GaapRealserver("fooGaapRealserver", GaapRealserverArgs.builder()
                .ip("1.1.1.1")
                .build());
    
            var fooGaapLayer4Listener = new GaapLayer4Listener("fooGaapLayer4Listener", GaapLayer4ListenerArgs.builder()
                .protocol("TCP")
                .port(80)
                .realserverType("IP")
                .proxyId(fooGaapProxy.gaapProxyId())
                .healthCheck(true)
                .interval(5)
                .connectTimeout(2)
                .realserverBindSets(GaapLayer4ListenerRealserverBindSetArgs.builder()
                    .id(fooGaapRealserver.gaapRealserverId())
                    .ip(fooGaapRealserver.ip())
                    .port(80)
                    .build())
                .build());
    
            final var fooGaapLayer4Listeners = TencentcloudFunctions.getGaapLayer4Listeners(GetGaapLayer4ListenersArgs.builder()
                .protocol("TCP")
                .proxyId(fooGaapProxy.gaapProxyId())
                .listenerId(fooGaapLayer4Listener.gaapLayer4ListenerId())
                .build());
    
        }
    }
    
    resources:
      fooGaapProxy:
        type: tencentcloud:GaapProxy
        properties:
          bandwidth: 10
          concurrent: 2
          accessRegion: SouthChina
          realserverRegion: NorthChina
      fooGaapRealserver:
        type: tencentcloud:GaapRealserver
        properties:
          ip: 1.1.1.1
      fooGaapLayer4Listener:
        type: tencentcloud:GaapLayer4Listener
        properties:
          protocol: TCP
          port: 80
          realserverType: IP
          proxyId: ${fooGaapProxy.gaapProxyId}
          healthCheck: true
          interval: 5
          connectTimeout: 2
          realserverBindSets:
            - id: ${fooGaapRealserver.gaapRealserverId}
              ip: ${fooGaapRealserver.ip}
              port: 80
    variables:
      fooGaapLayer4Listeners:
        fn::invoke:
          function: tencentcloud:getGaapLayer4Listeners
          arguments:
            protocol: TCP
            proxyId: ${fooGaapProxy.gaapProxyId}
            listenerId: ${fooGaapLayer4Listener.gaapLayer4ListenerId}
    

    Using getGaapLayer4Listeners

    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 getGaapLayer4Listeners(args: GetGaapLayer4ListenersArgs, opts?: InvokeOptions): Promise<GetGaapLayer4ListenersResult>
    function getGaapLayer4ListenersOutput(args: GetGaapLayer4ListenersOutputArgs, opts?: InvokeOptions): Output<GetGaapLayer4ListenersResult>
    def get_gaap_layer4_listeners(id: Optional[str] = None,
                                  listener_id: Optional[str] = None,
                                  listener_name: Optional[str] = None,
                                  port: Optional[float] = None,
                                  protocol: Optional[str] = None,
                                  proxy_id: Optional[str] = None,
                                  result_output_file: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetGaapLayer4ListenersResult
    def get_gaap_layer4_listeners_output(id: Optional[pulumi.Input[str]] = None,
                                  listener_id: Optional[pulumi.Input[str]] = None,
                                  listener_name: Optional[pulumi.Input[str]] = None,
                                  port: Optional[pulumi.Input[float]] = None,
                                  protocol: Optional[pulumi.Input[str]] = None,
                                  proxy_id: Optional[pulumi.Input[str]] = None,
                                  result_output_file: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetGaapLayer4ListenersResult]
    func GetGaapLayer4Listeners(ctx *Context, args *GetGaapLayer4ListenersArgs, opts ...InvokeOption) (*GetGaapLayer4ListenersResult, error)
    func GetGaapLayer4ListenersOutput(ctx *Context, args *GetGaapLayer4ListenersOutputArgs, opts ...InvokeOption) GetGaapLayer4ListenersResultOutput

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

    public static class GetGaapLayer4Listeners 
    {
        public static Task<GetGaapLayer4ListenersResult> InvokeAsync(GetGaapLayer4ListenersArgs args, InvokeOptions? opts = null)
        public static Output<GetGaapLayer4ListenersResult> Invoke(GetGaapLayer4ListenersInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetGaapLayer4ListenersResult> getGaapLayer4Listeners(GetGaapLayer4ListenersArgs args, InvokeOptions options)
    public static Output<GetGaapLayer4ListenersResult> getGaapLayer4Listeners(GetGaapLayer4ListenersArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getGaapLayer4Listeners:getGaapLayer4Listeners
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Protocol string
    Protocol of the layer4 listener to be queried. Valid values: TCP and UDP.
    Id string
    ID of the layer4 listener.
    ListenerId string
    ID of the layer4 listener to be queried.
    ListenerName string
    Name of the layer4 listener to be queried.
    Port double
    Port of the layer4 listener to be queried.
    ProxyId string
    ID of the GAAP proxy to be queried.
    ResultOutputFile string
    Used to save results.
    Protocol string
    Protocol of the layer4 listener to be queried. Valid values: TCP and UDP.
    Id string
    ID of the layer4 listener.
    ListenerId string
    ID of the layer4 listener to be queried.
    ListenerName string
    Name of the layer4 listener to be queried.
    Port float64
    Port of the layer4 listener to be queried.
    ProxyId string
    ID of the GAAP proxy to be queried.
    ResultOutputFile string
    Used to save results.
    protocol String
    Protocol of the layer4 listener to be queried. Valid values: TCP and UDP.
    id String
    ID of the layer4 listener.
    listenerId String
    ID of the layer4 listener to be queried.
    listenerName String
    Name of the layer4 listener to be queried.
    port Double
    Port of the layer4 listener to be queried.
    proxyId String
    ID of the GAAP proxy to be queried.
    resultOutputFile String
    Used to save results.
    protocol string
    Protocol of the layer4 listener to be queried. Valid values: TCP and UDP.
    id string
    ID of the layer4 listener.
    listenerId string
    ID of the layer4 listener to be queried.
    listenerName string
    Name of the layer4 listener to be queried.
    port number
    Port of the layer4 listener to be queried.
    proxyId string
    ID of the GAAP proxy to be queried.
    resultOutputFile string
    Used to save results.
    protocol str
    Protocol of the layer4 listener to be queried. Valid values: TCP and UDP.
    id str
    ID of the layer4 listener.
    listener_id str
    ID of the layer4 listener to be queried.
    listener_name str
    Name of the layer4 listener to be queried.
    port float
    Port of the layer4 listener to be queried.
    proxy_id str
    ID of the GAAP proxy to be queried.
    result_output_file str
    Used to save results.
    protocol String
    Protocol of the layer4 listener to be queried. Valid values: TCP and UDP.
    id String
    ID of the layer4 listener.
    listenerId String
    ID of the layer4 listener to be queried.
    listenerName String
    Name of the layer4 listener to be queried.
    port Number
    Port of the layer4 listener to be queried.
    proxyId String
    ID of the GAAP proxy to be queried.
    resultOutputFile String
    Used to save results.

    getGaapLayer4Listeners Result

    The following output properties are available:

    Id string
    ID of the layer4 listener.
    Listeners List<GetGaapLayer4ListenersListener>
    An information list of layer4 listeners. Each element contains the following attributes:
    Protocol string
    Protocol of the layer4 listener.
    ListenerId string
    ListenerName string
    Port double
    Port of the layer4 listener.
    ProxyId string
    ID of the GAAP proxy.
    ResultOutputFile string
    Id string
    ID of the layer4 listener.
    Listeners []GetGaapLayer4ListenersListener
    An information list of layer4 listeners. Each element contains the following attributes:
    Protocol string
    Protocol of the layer4 listener.
    ListenerId string
    ListenerName string
    Port float64
    Port of the layer4 listener.
    ProxyId string
    ID of the GAAP proxy.
    ResultOutputFile string
    id String
    ID of the layer4 listener.
    listeners List<GetGaapLayer4ListenersListener>
    An information list of layer4 listeners. Each element contains the following attributes:
    protocol String
    Protocol of the layer4 listener.
    listenerId String
    listenerName String
    port Double
    Port of the layer4 listener.
    proxyId String
    ID of the GAAP proxy.
    resultOutputFile String
    id string
    ID of the layer4 listener.
    listeners GetGaapLayer4ListenersListener[]
    An information list of layer4 listeners. Each element contains the following attributes:
    protocol string
    Protocol of the layer4 listener.
    listenerId string
    listenerName string
    port number
    Port of the layer4 listener.
    proxyId string
    ID of the GAAP proxy.
    resultOutputFile string
    id str
    ID of the layer4 listener.
    listeners Sequence[GetGaapLayer4ListenersListener]
    An information list of layer4 listeners. Each element contains the following attributes:
    protocol str
    Protocol of the layer4 listener.
    listener_id str
    listener_name str
    port float
    Port of the layer4 listener.
    proxy_id str
    ID of the GAAP proxy.
    result_output_file str
    id String
    ID of the layer4 listener.
    listeners List<Property Map>
    An information list of layer4 listeners. Each element contains the following attributes:
    protocol String
    Protocol of the layer4 listener.
    listenerId String
    listenerName String
    port Number
    Port of the layer4 listener.
    proxyId String
    ID of the GAAP proxy.
    resultOutputFile String

    Supporting Types

    GetGaapLayer4ListenersListener

    ConnectTimeout double
    Timeout of the health check response.
    CreateTime string
    Creation time of the layer4 listener.
    HealthCheck bool
    Indicates whether health check is enable.
    Id string
    ID of the layer4 listener.
    Interval double
    Interval of the health check.
    Name string
    Name of the layer4 listener.
    Port double
    Port of the layer4 listener to be queried.
    Protocol string
    Protocol of the layer4 listener to be queried. Valid values: TCP and UDP.
    ProxyId string
    ID of the GAAP proxy to be queried.
    RealserverType string
    Type of the realserver.
    Scheduler string
    Scheduling policy of the layer4 listener.
    Status double
    Status of the layer4 listener.
    ConnectTimeout float64
    Timeout of the health check response.
    CreateTime string
    Creation time of the layer4 listener.
    HealthCheck bool
    Indicates whether health check is enable.
    Id string
    ID of the layer4 listener.
    Interval float64
    Interval of the health check.
    Name string
    Name of the layer4 listener.
    Port float64
    Port of the layer4 listener to be queried.
    Protocol string
    Protocol of the layer4 listener to be queried. Valid values: TCP and UDP.
    ProxyId string
    ID of the GAAP proxy to be queried.
    RealserverType string
    Type of the realserver.
    Scheduler string
    Scheduling policy of the layer4 listener.
    Status float64
    Status of the layer4 listener.
    connectTimeout Double
    Timeout of the health check response.
    createTime String
    Creation time of the layer4 listener.
    healthCheck Boolean
    Indicates whether health check is enable.
    id String
    ID of the layer4 listener.
    interval Double
    Interval of the health check.
    name String
    Name of the layer4 listener.
    port Double
    Port of the layer4 listener to be queried.
    protocol String
    Protocol of the layer4 listener to be queried. Valid values: TCP and UDP.
    proxyId String
    ID of the GAAP proxy to be queried.
    realserverType String
    Type of the realserver.
    scheduler String
    Scheduling policy of the layer4 listener.
    status Double
    Status of the layer4 listener.
    connectTimeout number
    Timeout of the health check response.
    createTime string
    Creation time of the layer4 listener.
    healthCheck boolean
    Indicates whether health check is enable.
    id string
    ID of the layer4 listener.
    interval number
    Interval of the health check.
    name string
    Name of the layer4 listener.
    port number
    Port of the layer4 listener to be queried.
    protocol string
    Protocol of the layer4 listener to be queried. Valid values: TCP and UDP.
    proxyId string
    ID of the GAAP proxy to be queried.
    realserverType string
    Type of the realserver.
    scheduler string
    Scheduling policy of the layer4 listener.
    status number
    Status of the layer4 listener.
    connect_timeout float
    Timeout of the health check response.
    create_time str
    Creation time of the layer4 listener.
    health_check bool
    Indicates whether health check is enable.
    id str
    ID of the layer4 listener.
    interval float
    Interval of the health check.
    name str
    Name of the layer4 listener.
    port float
    Port of the layer4 listener to be queried.
    protocol str
    Protocol of the layer4 listener to be queried. Valid values: TCP and UDP.
    proxy_id str
    ID of the GAAP proxy to be queried.
    realserver_type str
    Type of the realserver.
    scheduler str
    Scheduling policy of the layer4 listener.
    status float
    Status of the layer4 listener.
    connectTimeout Number
    Timeout of the health check response.
    createTime String
    Creation time of the layer4 listener.
    healthCheck Boolean
    Indicates whether health check is enable.
    id String
    ID of the layer4 listener.
    interval Number
    Interval of the health check.
    name String
    Name of the layer4 listener.
    port Number
    Port of the layer4 listener to be queried.
    protocol String
    Protocol of the layer4 listener to be queried. Valid values: TCP and UDP.
    proxyId String
    ID of the GAAP proxy to be queried.
    realserverType String
    Type of the realserver.
    scheduler String
    Scheduling policy of the layer4 listener.
    status Number
    Status of the layer4 listener.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack