Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi
alicloud.vpc.getPrefixLists
Explore with Pulumi AI
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();
        ctx.export("vpcPrefixListId1", ids.applyValue(getPrefixListsResult -> getPrefixListsResult.lists()[0].id()));
        final var nameRegex = VpcFunctions.getPrefixLists(GetPrefixListsArgs.builder()
            .nameRegex("^my-PrefixList")
            .build());
        ctx.export("vpcPrefixListId2", nameRegex.applyValue(getPrefixListsResult -> getPrefixListsResult.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:
- EnableDetails bool
- Default to true. Set it tofalsecan hide theentrysto output.
- Ids List<string>
- A list of Prefix List IDs.
- NameRegex string
- A regex string to filter results by Prefix List name.
- OutputFile string
- File name where to save data source results (after running pulumi preview).
- PrefixList stringName 
- The name of the prefix list.
- EnableDetails bool
- Default to true. Set it tofalsecan hide theentrysto output.
- Ids []string
- A list of Prefix List IDs.
- NameRegex string
- A regex string to filter results by Prefix List name.
- OutputFile string
- File name where to save data source results (after running pulumi preview).
- PrefixList stringName 
- The name of the prefix list.
- enableDetails Boolean
- Default to true. Set it tofalsecan hide theentrysto output.
- ids List<String>
- A list of Prefix List IDs.
- nameRegex String
- A regex string to filter results by Prefix List name.
- outputFile String
- File name where to save data source results (after running pulumi preview).
- prefixList StringName 
- The name of the prefix list.
- enableDetails boolean
- Default to true. Set it tofalsecan hide theentrysto output.
- ids string[]
- A list of Prefix List IDs.
- nameRegex string
- A regex string to filter results by Prefix List name.
- outputFile string
- File name where to save data source results (after running pulumi preview).
- prefixList 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.
- enableDetails Boolean
- Default to true. Set it tofalsecan hide theentrysto output.
- ids List<String>
- A list of Prefix List IDs.
- nameRegex String
- A regex string to filter results by Prefix List name.
- outputFile String
- File name where to save data source results (after running pulumi preview).
- prefixList 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.
- EnableDetails bool
- NameRegex string
- OutputFile string
- PrefixList stringName 
- The name of the prefix list.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Lists
[]GetPrefix Lists List 
- A list of Vpc Prefix Lists. Each element contains the following attributes:
- Names []string
- A list of Prefix List names.
- EnableDetails bool
- NameRegex string
- OutputFile string
- PrefixList stringName 
- The name of the prefix list.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- lists
List<GetPrefix Lists List> 
- A list of Vpc Prefix Lists. Each element contains the following attributes:
- names List<String>
- A list of Prefix List names.
- enableDetails Boolean
- nameRegex String
- outputFile String
- prefixList StringName 
- The name of the prefix list.
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- lists
GetPrefix Lists List[] 
- A list of Vpc Prefix Lists. Each element contains the following attributes:
- names string[]
- A list of Prefix List names.
- enableDetails boolean
- nameRegex string
- outputFile string
- prefixList stringName 
- The name of the prefix list.
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- lists
Sequence[GetPrefix 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.
- enableDetails Boolean
- nameRegex String
- outputFile String
- prefixList StringName 
- The name of the prefix list.
Supporting Types
GetPrefixListsList   
- CreateTime 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.
- IpVersion string
- The IP version of the prefix list.
- MaxEntries int
- The maximum number of entries for CIDR address blocks in the prefix list.
- PrefixList stringDescription 
- The description of the prefix list.
- PrefixList stringId 
- The ID of the query Prefix List.
- PrefixList stringName 
- The name of the prefix list.
- string
- The share type of the prefix list.
- CreateTime string
- The time when the prefix list was created.
- Entrys
[]GetPrefix Lists List Entry 
- The CIDR address block list of the prefix list.
- Id string
- The ID of the Prefix List.
- IpVersion string
- The IP version of the prefix list.
- MaxEntries int
- The maximum number of entries for CIDR address blocks in the prefix list.
- PrefixList stringDescription 
- The description of the prefix list.
- PrefixList stringId 
- The ID of the query Prefix List.
- PrefixList stringName 
- The name of the prefix list.
- string
- The share type of the prefix list.
- createTime String
- The time when the prefix list was created.
- entrys
List<GetPrefix Lists List Entry> 
- The CIDR address block list of the prefix list.
- id String
- The ID of the Prefix List.
- ipVersion String
- The IP version of the prefix list.
- maxEntries Integer
- The maximum number of entries for CIDR address blocks in the prefix list.
- prefixList StringDescription 
- The description of the prefix list.
- prefixList StringId 
- The ID of the query Prefix List.
- prefixList StringName 
- The name of the prefix list.
- String
- The share type of the prefix list.
- createTime string
- The time when the prefix list was created.
- entrys
GetPrefix Lists List Entry[] 
- The CIDR address block list of the prefix list.
- id string
- The ID of the Prefix List.
- ipVersion string
- The IP version of the prefix list.
- maxEntries number
- The maximum number of entries for CIDR address blocks in the prefix list.
- prefixList stringDescription 
- The description of the prefix list.
- prefixList stringId 
- The ID of the query Prefix List.
- prefixList 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[GetPrefix 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.
- createTime 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.
- ipVersion String
- The IP version of the prefix list.
- maxEntries Number
- The maximum number of entries for CIDR address blocks in the prefix list.
- prefixList StringDescription 
- The description of the prefix list.
- prefixList StringId 
- The ID of the query Prefix List.
- prefixList 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.