get Listeners
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);
Content copied to clipboard
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)
Content copied to clipboard
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),
};
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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.listeners()[0].id());
}
}
Content copied to clipboard
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}
Content copied to clipboard
Return
A collection of values returned by getListeners.
Parameters
argument
A collection of arguments for invoking getListeners.
suspend fun getListeners(acceleratorId: String, ids: List<String>? = null, nameRegex: String? = null, outputFile: String? = null, status: String? = null): GetListenersResult
Return
A collection of values returned by getListeners.
Parameters
accelerator Id
The accelerator id.
ids
A list of Listener IDs.
name Regex
A regex string to filter results by Listener name.
output File
File name where to save data source results (after running pulumi preview
).
status
The status of the listener. Valid values: active
, configuring
, creating
.
See also
suspend fun getListeners(argument: suspend GetListenersPlainArgsBuilder.() -> Unit): GetListenersResult
Return
A collection of values returned by getListeners.
Parameters
argument
Builder for com.pulumi.alicloud.ga.kotlin.inputs.GetListenersPlainArgs.