1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. vpc
  5. getPrefixLists
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.vpc.getPrefixLists

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the Vpc Prefix Lists of the current Alibaba Cloud user.

    NOTE: Available in 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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:vpc/getPrefixLists:getPrefixLists
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EnableDetails bool
    Default to true. Set it to false can hide the entrys to 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).
    PrefixListName string
    The name of the prefix list.
    EnableDetails bool
    Default to true. Set it to false can hide the entrys to 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).
    PrefixListName string
    The name of the prefix list.
    enableDetails Boolean
    Default to true. Set it to false can hide the entrys to 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).
    prefixListName String
    The name of the prefix list.
    enableDetails boolean
    Default to true. Set it to false can hide the entrys to 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).
    prefixListName string
    The name of the prefix list.
    enable_details bool
    Default to true. Set it to false can hide the entrys to 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_name str
    The name of the prefix list.
    enableDetails Boolean
    Default to true. Set it to false can hide the entrys to 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).
    prefixListName String
    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.AliCloud.Vpc.Outputs.GetPrefixListsList>
    Names List<string>
    EnableDetails bool
    NameRegex string
    OutputFile string
    PrefixListName string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Lists []GetPrefixListsList
    Names []string
    EnableDetails bool
    NameRegex string
    OutputFile string
    PrefixListName string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    lists List<GetPrefixListsList>
    names List<String>
    enableDetails Boolean
    nameRegex String
    outputFile String
    prefixListName String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    lists GetPrefixListsList[]
    names string[]
    enableDetails boolean
    nameRegex string
    outputFile string
    prefixListName string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    lists Sequence[GetPrefixListsList]
    names Sequence[str]
    enable_details bool
    name_regex str
    output_file str
    prefix_list_name str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    lists List<Property Map>
    names List<String>
    enableDetails Boolean
    nameRegex String
    outputFile String
    prefixListName String

    Supporting Types

    GetPrefixListsList

    CreateTime string
    The time when the prefix list was created.
    Entrys List<Pulumi.AliCloud.Vpc.Inputs.GetPrefixListsListEntry>
    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.
    PrefixListDescription string
    The description of the prefix list.
    PrefixListId string
    The ID of the query Prefix List.
    PrefixListName string
    The name of the prefix list.
    ShareType string
    The share type of the prefix list.
    CreateTime string
    The time when the prefix list was created.
    Entrys []GetPrefixListsListEntry
    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.
    PrefixListDescription string
    The description of the prefix list.
    PrefixListId string
    The ID of the query Prefix List.
    PrefixListName string
    The name of the prefix list.
    ShareType string
    The share type of the prefix list.
    createTime String
    The time when the prefix list was created.
    entrys List<GetPrefixListsListEntry>
    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.
    prefixListDescription String
    The description of the prefix list.
    prefixListId String
    The ID of the query Prefix List.
    prefixListName String
    The name of the prefix list.
    shareType String
    The share type of the prefix list.
    createTime string
    The time when the prefix list was created.
    entrys GetPrefixListsListEntry[]
    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.
    prefixListDescription string
    The description of the prefix list.
    prefixListId string
    The ID of the query Prefix List.
    prefixListName string
    The name of the prefix list.
    shareType string
    The share type of the prefix list.
    create_time str
    The time when the prefix list was created.
    entrys Sequence[GetPrefixListsListEntry]
    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_description str
    The description of the prefix list.
    prefix_list_id str
    The ID of the query Prefix List.
    prefix_list_name str
    The name of the prefix list.
    share_type 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.
    prefixListDescription String
    The description of the prefix list.
    prefixListId String
    The ID of the query Prefix List.
    prefixListName String
    The name of the prefix list.
    shareType 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 alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi