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

tencentcloud.getGaapLayer4Listeners

Explore with Pulumi AI

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,
});
Copy
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)
Copy
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
	})
}
Copy
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,
    });

});
Copy
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());

    }
}
Copy
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}
Copy

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>
Copy
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]
Copy
func GetGaapLayer4Listeners(ctx *Context, args *GetGaapLayer4ListenersArgs, opts ...InvokeOption) (*GetGaapLayer4ListenersResult, error)
func GetGaapLayer4ListenersOutput(ctx *Context, args *GetGaapLayer4ListenersOutputArgs, opts ...InvokeOption) GetGaapLayer4ListenersResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetGaapLayer4ListenersResult> getGaapLayer4Listeners(GetGaapLayer4ListenersArgs args, InvokeOptions options)
public static Output<GetGaapLayer4ListenersResult> getGaapLayer4Listeners(GetGaapLayer4ListenersArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: tencentcloud:index/getGaapLayer4Listeners:getGaapLayer4Listeners
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

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