get Ecs Prefix Lists
This data source provides the Ecs Prefix Lists of the current Alibaba Cloud user.
NOTE: Available in v1.152.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = alicloud.ecs.getEcsPrefixLists({
ids: ["E2RY53-xxxx"],
nameRegex: "tf-testAcc",
});
export const outputId = example.then(example => example.lists?.[0]?.id);
Content copied to clipboard
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.ecs.get_ecs_prefix_lists(ids=["E2RY53-xxxx"],
name_regex="tf-testAcc")
pulumi.export("outputId", example.lists[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.Ecs.GetEcsPrefixLists.Invoke(new()
{
Ids = new[]
{
"E2RY53-xxxx",
},
NameRegex = "tf-testAcc",
});
return new Dictionary<string, object?>
{
["outputId"] = example.Apply(getEcsPrefixListsResult => getEcsPrefixListsResult.Lists[0]?.Id),
};
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := ecs.GetEcsPrefixLists(ctx, &ecs.GetEcsPrefixListsArgs{
Ids: []string{
"E2RY53-xxxx",
},
NameRegex: pulumi.StringRef("tf-testAcc"),
}, nil)
if err != nil {
return err
}
ctx.Export("outputId", example.Lists[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.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetEcsPrefixListsArgs;
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 = EcsFunctions.getEcsPrefixLists(GetEcsPrefixListsArgs.builder()
.ids("E2RY53-xxxx")
.nameRegex("tf-testAcc")
.build());
ctx.export("outputId", example.lists()[0].id());
}
}
Content copied to clipboard
variables:
example:
fn::invoke:
function: alicloud:ecs:getEcsPrefixLists
arguments:
ids:
- E2RY53-xxxx
nameRegex: tf-testAcc
outputs:
outputId: ${example.lists[0].id}
Content copied to clipboard
Return
A collection of values returned by getEcsPrefixLists.
Parameters
argument
A collection of arguments for invoking getEcsPrefixLists.
suspend fun getEcsPrefixLists(addressFamily: String? = null, enableDetails: Boolean? = null, ids: List<String>? = null, nameRegex: String? = null, outputFile: String? = null): GetEcsPrefixListsResult
Return
A collection of values returned by getEcsPrefixLists.
Parameters
address Family
The address family of the prefix list. Valid values: IPv4
,IPv6
. This parameter is empty by default, which indicates that all prefix lists are to be queried.
enable Details
ids
A list of Prefix List IDs.
name Regex
A regex string to filter results by prefix_list_name
.
output File
File name where to save data source results (after running pulumi preview
).
See also
suspend fun getEcsPrefixLists(argument: suspend GetEcsPrefixListsPlainArgsBuilder.() -> Unit): GetEcsPrefixListsResult
Return
A collection of values returned by getEcsPrefixLists.
Parameters
argument
Builder for com.pulumi.alicloud.ecs.kotlin.inputs.GetEcsPrefixListsPlainArgs.