Alibaba Cloud v3.88.0 published on Saturday, Nov 1, 2025 by Pulumi
alicloud.vpc.getPrefixLists
This data source provides the Vpc Prefix Lists of the current Alibaba Cloud user.
NOTE: Available since v1.182.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.vpc.getPrefixLists({});
export const vpcPrefixListId1 = ids.then(ids => ids.lists?.[0]?.id);
const nameRegex = alicloud.vpc.getPrefixLists({
nameRegex: "^my-PrefixList",
});
export const vpcPrefixListId2 = nameRegex.then(nameRegex => nameRegex.lists?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.vpc.get_prefix_lists()
pulumi.export("vpcPrefixListId1", ids.lists[0].id)
name_regex = alicloud.vpc.get_prefix_lists(name_regex="^my-PrefixList")
pulumi.export("vpcPrefixListId2", name_regex.lists[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := vpc.GetPrefixLists(ctx, &vpc.GetPrefixListsArgs{}, nil)
if err != nil {
return err
}
ctx.Export("vpcPrefixListId1", ids.Lists[0].Id)
nameRegex, err := vpc.GetPrefixLists(ctx, &vpc.GetPrefixListsArgs{
NameRegex: pulumi.StringRef("^my-PrefixList"),
}, nil)
if err != nil {
return err
}
ctx.Export("vpcPrefixListId2", nameRegex.Lists[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.Vpc.GetPrefixLists.Invoke();
var nameRegex = AliCloud.Vpc.GetPrefixLists.Invoke(new()
{
NameRegex = "^my-PrefixList",
});
return new Dictionary<string, object?>
{
["vpcPrefixListId1"] = ids.Apply(getPrefixListsResult => getPrefixListsResult.Lists[0]?.Id),
["vpcPrefixListId2"] = nameRegex.Apply(getPrefixListsResult => getPrefixListsResult.Lists[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetPrefixListsArgs;
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 ids = VpcFunctions.getPrefixLists(GetPrefixListsArgs.builder()
.build());
ctx.export("vpcPrefixListId1", ids.lists()[0].id());
final var nameRegex = VpcFunctions.getPrefixLists(GetPrefixListsArgs.builder()
.nameRegex("^my-PrefixList")
.build());
ctx.export("vpcPrefixListId2", nameRegex.lists()[0].id());
}
}
variables:
ids:
fn::invoke:
function: alicloud:vpc:getPrefixLists
arguments: {}
nameRegex:
fn::invoke:
function: alicloud:vpc:getPrefixLists
arguments:
nameRegex: ^my-PrefixList
outputs:
vpcPrefixListId1: ${ids.lists[0].id}
vpcPrefixListId2: ${nameRegex.lists[0].id}
Using getPrefixLists
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 getPrefixLists(args: GetPrefixListsArgs, opts?: InvokeOptions): Promise<GetPrefixListsResult>
function getPrefixListsOutput(args: GetPrefixListsOutputArgs, opts?: InvokeOptions): Output<GetPrefixListsResult>def get_prefix_lists(enable_details: Optional[bool] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
prefix_list_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetPrefixListsResult
def get_prefix_lists_output(enable_details: Optional[pulumi.Input[bool]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
prefix_list_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetPrefixListsResult]func GetPrefixLists(ctx *Context, args *GetPrefixListsArgs, opts ...InvokeOption) (*GetPrefixListsResult, error)
func GetPrefixListsOutput(ctx *Context, args *GetPrefixListsOutputArgs, opts ...InvokeOption) GetPrefixListsResultOutput> Note: This function is named GetPrefixLists in the Go SDK.
public static class GetPrefixLists
{
public static Task<GetPrefixListsResult> InvokeAsync(GetPrefixListsArgs args, InvokeOptions? opts = null)
public static Output<GetPrefixListsResult> Invoke(GetPrefixListsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetPrefixListsResult> getPrefixLists(GetPrefixListsArgs args, InvokeOptions options)
public static Output<GetPrefixListsResult> getPrefixLists(GetPrefixListsArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:vpc/getPrefixLists:getPrefixLists
arguments:
# arguments dictionaryThe following arguments are supported:
- Enable
Details bool - Default to
true. Set it tofalsecan hide theentrysto output. - Ids List<string>
- A list of Prefix List IDs.
- Name
Regex string - A regex string to filter results by Prefix List name.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Prefix
List stringName - The name of the prefix list.
- Enable
Details bool - Default to
true. Set it tofalsecan hide theentrysto output. - Ids []string
- A list of Prefix List IDs.
- Name
Regex string - A regex string to filter results by Prefix List name.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Prefix
List stringName - The name of the prefix list.
- enable
Details Boolean - Default to
true. Set it tofalsecan hide theentrysto output. - ids List<String>
- A list of Prefix List IDs.
- name
Regex String - A regex string to filter results by Prefix List name.
- output
File String - File name where to save data source results (after running
pulumi preview). - prefix
List StringName - The name of the prefix list.
- enable
Details boolean - Default to
true. Set it tofalsecan hide theentrysto output. - ids string[]
- A list of Prefix List IDs.
- name
Regex string - A regex string to filter results by Prefix List name.
- output
File string - File name where to save data source results (after running
pulumi preview). - prefix
List stringName - The name of the prefix list.
- enable_
details bool - Default to
true. Set it tofalsecan hide theentrysto output. - ids Sequence[str]
- A list of Prefix List IDs.
- name_
regex str - A regex string to filter results by Prefix List name.
- output_
file str - File name where to save data source results (after running
pulumi preview). - prefix_
list_ strname - The name of the prefix list.
- enable
Details Boolean - Default to
true. Set it tofalsecan hide theentrysto output. - ids List<String>
- A list of Prefix List IDs.
- name
Regex String - A regex string to filter results by Prefix List name.
- output
File String - File name where to save data source results (after running
pulumi preview). - prefix
List StringName - The name of the prefix list.
getPrefixLists Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Lists
List<Pulumi.
Ali Cloud. Vpc. Outputs. Get Prefix Lists List> - A list of Vpc Prefix Lists. Each element contains the following attributes:
- Names List<string>
- A list of Prefix List names.
- Enable
Details bool - Name
Regex string - Output
File string - Prefix
List stringName - The name of the prefix list.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Lists
[]Get
Prefix Lists List - A list of Vpc Prefix Lists. Each element contains the following attributes:
- Names []string
- A list of Prefix List names.
- Enable
Details bool - Name
Regex string - Output
File string - Prefix
List stringName - The name of the prefix list.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- lists
List<Get
Prefix Lists List> - A list of Vpc Prefix Lists. Each element contains the following attributes:
- names List<String>
- A list of Prefix List names.
- enable
Details Boolean - name
Regex String - output
File String - prefix
List StringName - The name of the prefix list.
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- lists
Get
Prefix Lists List[] - A list of Vpc Prefix Lists. Each element contains the following attributes:
- names string[]
- A list of Prefix List names.
- enable
Details boolean - name
Regex string - output
File string - prefix
List stringName - The name of the prefix list.
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- lists
Sequence[Get
Prefix Lists List] - A list of Vpc Prefix Lists. Each element contains the following attributes:
- names Sequence[str]
- A list of Prefix List names.
- enable_
details bool - name_
regex str - output_
file str - prefix_
list_ strname - The name of the prefix list.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- lists List<Property Map>
- A list of Vpc Prefix Lists. Each element contains the following attributes:
- names List<String>
- A list of Prefix List names.
- enable
Details Boolean - name
Regex String - output
File String - prefix
List StringName - The name of the prefix list.
Supporting Types
GetPrefixListsList
- Create
Time string - The time when the prefix list was created.
- Entrys
List<Pulumi.
Ali Cloud. Vpc. Inputs. Get Prefix Lists List Entry> - The CIDR address block list of the prefix list.
- Id string
- The ID of the Prefix List.
- Ip
Version string - The IP version of the prefix list.
- Max
Entries int - The maximum number of entries for CIDR address blocks in the prefix list.
- Prefix
List stringDescription - The description of the prefix list.
- Prefix
List stringId - The ID of the query Prefix List.
- Prefix
List stringName - The name of the prefix list.
- string
- The share type of the prefix list.
- Create
Time string - The time when the prefix list was created.
- Entrys
[]Get
Prefix Lists List Entry - The CIDR address block list of the prefix list.
- Id string
- The ID of the Prefix List.
- Ip
Version string - The IP version of the prefix list.
- Max
Entries int - The maximum number of entries for CIDR address blocks in the prefix list.
- Prefix
List stringDescription - The description of the prefix list.
- Prefix
List stringId - The ID of the query Prefix List.
- Prefix
List stringName - The name of the prefix list.
- string
- The share type of the prefix list.
- create
Time String - The time when the prefix list was created.
- entrys
List<Get
Prefix Lists List Entry> - The CIDR address block list of the prefix list.
- id String
- The ID of the Prefix List.
- ip
Version String - The IP version of the prefix list.
- max
Entries Integer - The maximum number of entries for CIDR address blocks in the prefix list.
- prefix
List StringDescription - The description of the prefix list.
- prefix
List StringId - The ID of the query Prefix List.
- prefix
List StringName - The name of the prefix list.
- String
- The share type of the prefix list.
- create
Time string - The time when the prefix list was created.
- entrys
Get
Prefix Lists List Entry[] - The CIDR address block list of the prefix list.
- id string
- The ID of the Prefix List.
- ip
Version string - The IP version of the prefix list.
- max
Entries number - The maximum number of entries for CIDR address blocks in the prefix list.
- prefix
List stringDescription - The description of the prefix list.
- prefix
List stringId - The ID of the query Prefix List.
- prefix
List stringName - The name of the prefix list.
- string
- The share type of the prefix list.
- create_
time str - The time when the prefix list was created.
- entrys
Sequence[Get
Prefix Lists List Entry] - The CIDR address block list of the prefix list.
- id str
- The ID of the Prefix List.
- ip_
version str - The IP version of the prefix list.
- max_
entries int - The maximum number of entries for CIDR address blocks in the prefix list.
- prefix_
list_ strdescription - The description of the prefix list.
- prefix_
list_ strid - The ID of the query Prefix List.
- prefix_
list_ strname - The name of the prefix list.
- str
- The share type of the prefix list.
- create
Time String - The time when the prefix list was created.
- entrys List<Property Map>
- The CIDR address block list of the prefix list.
- id String
- The ID of the Prefix List.
- ip
Version String - The IP version of the prefix list.
- max
Entries Number - The maximum number of entries for CIDR address blocks in the prefix list.
- prefix
List StringDescription - The description of the prefix list.
- prefix
List StringId - The ID of the query Prefix List.
- prefix
List StringName - The name of the prefix list.
- String
- The share type of the prefix list.
GetPrefixListsListEntry
- Cidr string
- The CIDR address block of the prefix list.
- Description string
- The description of the cidr entry.
- Cidr string
- The CIDR address block of the prefix list.
- Description string
- The description of the cidr entry.
- cidr String
- The CIDR address block of the prefix list.
- description String
- The description of the cidr entry.
- cidr string
- The CIDR address block of the prefix list.
- description string
- The description of the cidr entry.
- cidr str
- The CIDR address block of the prefix list.
- description str
- The description of the cidr entry.
- cidr String
- The CIDR address block of the prefix list.
- description String
- The description of the cidr entry.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
