1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ga
  5. getListeners
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.ga.getListeners

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

This data source provides the Global Accelerator (GA) Listeners of the current Alibaba Cloud user.

NOTE: Available since v1.111.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = alicloud.ga.getListeners({
    acceleratorId: "example_value",
    ids: ["example_value"],
    nameRegex: "the_resource_name",
});
export const firstGaListenerId = example.then(example => example.listeners?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.ga.get_listeners(accelerator_id="example_value",
    ids=["example_value"],
    name_regex="the_resource_name")
pulumi.export("firstGaListenerId", example.listeners[0].id)
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ga"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := ga.GetListeners(ctx, &ga.GetListenersArgs{
			AcceleratorId: "example_value",
			Ids: []string{
				"example_value",
			},
			NameRegex: pulumi.StringRef("the_resource_name"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstGaListenerId", example.Listeners[0].Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var example = AliCloud.Ga.GetListeners.Invoke(new()
    {
        AcceleratorId = "example_value",
        Ids = new[]
        {
            "example_value",
        },
        NameRegex = "the_resource_name",
    });

    return new Dictionary<string, object?>
    {
        ["firstGaListenerId"] = example.Apply(getListenersResult => getListenersResult.Listeners[0]?.Id),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ga.GaFunctions;
import com.pulumi.alicloud.ga.inputs.GetListenersArgs;
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 example = GaFunctions.getListeners(GetListenersArgs.builder()
            .acceleratorId("example_value")
            .ids("example_value")
            .nameRegex("the_resource_name")
            .build());

        ctx.export("firstGaListenerId", example.applyValue(getListenersResult -> getListenersResult.listeners()[0].id()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: alicloud:ga:getListeners
      arguments:
        acceleratorId: example_value
        ids:
          - example_value
        nameRegex: the_resource_name
outputs:
  firstGaListenerId: ${example.listeners[0].id}
Copy

Using getListeners

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 getListeners(args: GetListenersArgs, opts?: InvokeOptions): Promise<GetListenersResult>
function getListenersOutput(args: GetListenersOutputArgs, opts?: InvokeOptions): Output<GetListenersResult>
Copy
def get_listeners(accelerator_id: Optional[str] = None,
                  ids: Optional[Sequence[str]] = None,
                  name_regex: Optional[str] = None,
                  output_file: Optional[str] = None,
                  status: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetListenersResult
def get_listeners_output(accelerator_id: Optional[pulumi.Input[str]] = None,
                  ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                  name_regex: Optional[pulumi.Input[str]] = None,
                  output_file: Optional[pulumi.Input[str]] = None,
                  status: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetListenersResult]
Copy
func GetListeners(ctx *Context, args *GetListenersArgs, opts ...InvokeOption) (*GetListenersResult, error)
func GetListenersOutput(ctx *Context, args *GetListenersOutputArgs, opts ...InvokeOption) GetListenersResultOutput
Copy

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

public static class GetListeners 
{
    public static Task<GetListenersResult> InvokeAsync(GetListenersArgs args, InvokeOptions? opts = null)
    public static Output<GetListenersResult> Invoke(GetListenersInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetListenersResult> getListeners(GetListenersArgs args, InvokeOptions options)
public static Output<GetListenersResult> getListeners(GetListenersArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:ga/getListeners:getListeners
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AcceleratorId
This property is required.
Changes to this property will trigger replacement.
string
The accelerator id.
Ids Changes to this property will trigger replacement. List<string>
A list of Listener IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Listener name.
OutputFile string
File name where to save data source results (after running pulumi preview).
Status Changes to this property will trigger replacement. string
The status of the listener. Valid values: active, configuring, creating.
AcceleratorId
This property is required.
Changes to this property will trigger replacement.
string
The accelerator id.
Ids Changes to this property will trigger replacement. []string
A list of Listener IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Listener name.
OutputFile string
File name where to save data source results (after running pulumi preview).
Status Changes to this property will trigger replacement. string
The status of the listener. Valid values: active, configuring, creating.
acceleratorId
This property is required.
Changes to this property will trigger replacement.
String
The accelerator id.
ids Changes to this property will trigger replacement. List<String>
A list of Listener IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Listener name.
outputFile String
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. String
The status of the listener. Valid values: active, configuring, creating.
acceleratorId
This property is required.
Changes to this property will trigger replacement.
string
The accelerator id.
ids Changes to this property will trigger replacement. string[]
A list of Listener IDs.
nameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Listener name.
outputFile string
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. string
The status of the listener. Valid values: active, configuring, creating.
accelerator_id
This property is required.
Changes to this property will trigger replacement.
str
The accelerator id.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Listener IDs.
name_regex Changes to this property will trigger replacement. str
A regex string to filter results by Listener name.
output_file str
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. str
The status of the listener. Valid values: active, configuring, creating.
acceleratorId
This property is required.
Changes to this property will trigger replacement.
String
The accelerator id.
ids Changes to this property will trigger replacement. List<String>
A list of Listener IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Listener name.
outputFile String
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. String
The status of the listener. Valid values: active, configuring, creating.

getListeners Result

The following output properties are available:

AcceleratorId string
Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
Listeners List<Pulumi.AliCloud.Ga.Outputs.GetListenersListener>
A list of Ga Listeners. Each element contains the following attributes:
Names List<string>
A list of Listener names.
NameRegex string
OutputFile string
Status string
The status of the listener.
AcceleratorId string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Listeners []GetListenersListener
A list of Ga Listeners. Each element contains the following attributes:
Names []string
A list of Listener names.
NameRegex string
OutputFile string
Status string
The status of the listener.
acceleratorId String
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
listeners List<GetListenersListener>
A list of Ga Listeners. Each element contains the following attributes:
names List<String>
A list of Listener names.
nameRegex String
outputFile String
status String
The status of the listener.
acceleratorId string
id string
The provider-assigned unique ID for this managed resource.
ids string[]
listeners GetListenersListener[]
A list of Ga Listeners. Each element contains the following attributes:
names string[]
A list of Listener names.
nameRegex string
outputFile string
status string
The status of the listener.
accelerator_id str
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
listeners Sequence[GetListenersListener]
A list of Ga Listeners. Each element contains the following attributes:
names Sequence[str]
A list of Listener names.
name_regex str
output_file str
status str
The status of the listener.
acceleratorId String
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
listeners List<Property Map>
A list of Ga Listeners. Each element contains the following attributes:
names List<String>
A list of Listener names.
nameRegex String
outputFile String
status String
The status of the listener.

Supporting Types

GetListenersListener

Certificates This property is required. List<Pulumi.AliCloud.Ga.Inputs.GetListenersListenerCertificate>
The certificates of the listener.
ClientAffinity This property is required. string
The clientAffinity of the listener.
Description This property is required. string
The description of the listener.
Id This property is required. string
The ID of the Listener.
ListenerId This property is required. string
The listenerId of the listener.
Name This property is required. string
The name of the listener. The length of the name is 2-128 characters. It starts with uppercase and lowercase letters or Chinese characters. It can contain numbers and underscores and dashes.
PortRanges This property is required. List<Pulumi.AliCloud.Ga.Inputs.GetListenersListenerPortRange>
The portRanges of the listener.
Protocol This property is required. string
Type of network transport protocol monitored.
Status This property is required. string
The status of the listener. Valid values: active, configuring, creating.
Certificates This property is required. []GetListenersListenerCertificate
The certificates of the listener.
ClientAffinity This property is required. string
The clientAffinity of the listener.
Description This property is required. string
The description of the listener.
Id This property is required. string
The ID of the Listener.
ListenerId This property is required. string
The listenerId of the listener.
Name This property is required. string
The name of the listener. The length of the name is 2-128 characters. It starts with uppercase and lowercase letters or Chinese characters. It can contain numbers and underscores and dashes.
PortRanges This property is required. []GetListenersListenerPortRange
The portRanges of the listener.
Protocol This property is required. string
Type of network transport protocol monitored.
Status This property is required. string
The status of the listener. Valid values: active, configuring, creating.
certificates This property is required. List<GetListenersListenerCertificate>
The certificates of the listener.
clientAffinity This property is required. String
The clientAffinity of the listener.
description This property is required. String
The description of the listener.
id This property is required. String
The ID of the Listener.
listenerId This property is required. String
The listenerId of the listener.
name This property is required. String
The name of the listener. The length of the name is 2-128 characters. It starts with uppercase and lowercase letters or Chinese characters. It can contain numbers and underscores and dashes.
portRanges This property is required. List<GetListenersListenerPortRange>
The portRanges of the listener.
protocol This property is required. String
Type of network transport protocol monitored.
status This property is required. String
The status of the listener. Valid values: active, configuring, creating.
certificates This property is required. GetListenersListenerCertificate[]
The certificates of the listener.
clientAffinity This property is required. string
The clientAffinity of the listener.
description This property is required. string
The description of the listener.
id This property is required. string
The ID of the Listener.
listenerId This property is required. string
The listenerId of the listener.
name This property is required. string
The name of the listener. The length of the name is 2-128 characters. It starts with uppercase and lowercase letters or Chinese characters. It can contain numbers and underscores and dashes.
portRanges This property is required. GetListenersListenerPortRange[]
The portRanges of the listener.
protocol This property is required. string
Type of network transport protocol monitored.
status This property is required. string
The status of the listener. Valid values: active, configuring, creating.
certificates This property is required. Sequence[GetListenersListenerCertificate]
The certificates of the listener.
client_affinity This property is required. str
The clientAffinity of the listener.
description This property is required. str
The description of the listener.
id This property is required. str
The ID of the Listener.
listener_id This property is required. str
The listenerId of the listener.
name This property is required. str
The name of the listener. The length of the name is 2-128 characters. It starts with uppercase and lowercase letters or Chinese characters. It can contain numbers and underscores and dashes.
port_ranges This property is required. Sequence[GetListenersListenerPortRange]
The portRanges of the listener.
protocol This property is required. str
Type of network transport protocol monitored.
status This property is required. str
The status of the listener. Valid values: active, configuring, creating.
certificates This property is required. List<Property Map>
The certificates of the listener.
clientAffinity This property is required. String
The clientAffinity of the listener.
description This property is required. String
The description of the listener.
id This property is required. String
The ID of the Listener.
listenerId This property is required. String
The listenerId of the listener.
name This property is required. String
The name of the listener. The length of the name is 2-128 characters. It starts with uppercase and lowercase letters or Chinese characters. It can contain numbers and underscores and dashes.
portRanges This property is required. List<Property Map>
The portRanges of the listener.
protocol This property is required. String
Type of network transport protocol monitored.
status This property is required. String
The status of the listener. Valid values: active, configuring, creating.

GetListenersListenerCertificate

Id This property is required. string
The ID of the Listener.
Type This property is required. string
The type of the certificate.
Id This property is required. string
The ID of the Listener.
Type This property is required. string
The type of the certificate.
id This property is required. String
The ID of the Listener.
type This property is required. String
The type of the certificate.
id This property is required. string
The ID of the Listener.
type This property is required. string
The type of the certificate.
id This property is required. str
The ID of the Listener.
type This property is required. str
The type of the certificate.
id This property is required. String
The ID of the Listener.
type This property is required. String
The type of the certificate.

GetListenersListenerPortRange

FromPort This property is required. int
The initial listening port used to receive requests and forward them to terminal nodes.
ToPort This property is required. int
The end listening port used to receive requests and forward them to terminal nodes.
FromPort This property is required. int
The initial listening port used to receive requests and forward them to terminal nodes.
ToPort This property is required. int
The end listening port used to receive requests and forward them to terminal nodes.
fromPort This property is required. Integer
The initial listening port used to receive requests and forward them to terminal nodes.
toPort This property is required. Integer
The end listening port used to receive requests and forward them to terminal nodes.
fromPort This property is required. number
The initial listening port used to receive requests and forward them to terminal nodes.
toPort This property is required. number
The end listening port used to receive requests and forward them to terminal nodes.
from_port This property is required. int
The initial listening port used to receive requests and forward them to terminal nodes.
to_port This property is required. int
The end listening port used to receive requests and forward them to terminal nodes.
fromPort This property is required. Number
The initial listening port used to receive requests and forward them to terminal nodes.
toPort This property is required. Number
The end listening port used to receive requests and forward them to terminal nodes.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi