Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 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 dictionary
The following arguments are supported:
- Enable
Details bool - Default to
true
. Set it tofalse
can hide theentrys
to output. - Ids
Changes to this property will trigger replacement.
- A list of Prefix List IDs.
- Name
Regex Changes to this property will trigger replacement.
- 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 Name Changes to this property will trigger replacement.
- The name of the prefix list.
- Enable
Details bool - Default to
true
. Set it tofalse
can hide theentrys
to output. - Ids
Changes to this property will trigger replacement.
- A list of Prefix List IDs.
- Name
Regex Changes to this property will trigger replacement.
- 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 Name Changes to this property will trigger replacement.
- The name of the prefix list.
- enable
Details Boolean - Default to
true
. Set it tofalse
can hide theentrys
to output. - ids
Changes to this property will trigger replacement.
- A list of Prefix List IDs.
- name
Regex Changes to this property will trigger replacement.
- 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 Name Changes to this property will trigger replacement.
- The name of the prefix list.
- enable
Details boolean - Default to
true
. Set it tofalse
can hide theentrys
to output. - ids
Changes to this property will trigger replacement.
- A list of Prefix List IDs.
- name
Regex Changes to this property will trigger replacement.
- 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 Name Changes to this property will trigger replacement.
- The name of the prefix list.
- enable_
details bool - Default to
true
. Set it tofalse
can hide theentrys
to output. - ids
Changes to this property will trigger replacement.
- A list of Prefix List IDs.
- name_
regex Changes to this property will trigger replacement.
- 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 Changes to this property will trigger replacement.
- The name of the prefix list.
- enable
Details Boolean - Default to
true
. Set it tofalse
can hide theentrys
to output. - ids
Changes to this property will trigger replacement.
- A list of Prefix List IDs.
- name
Regex Changes to this property will trigger replacement.
- 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 Name Changes to this property will trigger replacement.
- 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 This property is required. string - The time when the prefix list was created.
- Entrys
This property is required. List<Pulumi.Ali Cloud. Vpc. Inputs. Get Prefix Lists List Entry> - The CIDR address block list of the prefix list.
- Id
This property is required. string - The ID of the Prefix List.
- Ip
Version This property is required. string - The IP version of the prefix list.
- Max
Entries This property is required. int - The maximum number of entries for CIDR address blocks in the prefix list.
- Prefix
List Description This property is required. string - The description of the prefix list.
- Prefix
List Id This property is required. string - The ID of the query Prefix List.
- Prefix
List Name This property is required. string - The name of the prefix list.
This property is required. string- The share type of the prefix list.
- Create
Time This property is required. string - The time when the prefix list was created.
- Entrys
This property is required. []GetPrefix Lists List Entry - The CIDR address block list of the prefix list.
- Id
This property is required. string - The ID of the Prefix List.
- Ip
Version This property is required. string - The IP version of the prefix list.
- Max
Entries This property is required. int - The maximum number of entries for CIDR address blocks in the prefix list.
- Prefix
List Description This property is required. string - The description of the prefix list.
- Prefix
List Id This property is required. string - The ID of the query Prefix List.
- Prefix
List Name This property is required. string - The name of the prefix list.
This property is required. string- The share type of the prefix list.
- create
Time This property is required. String - The time when the prefix list was created.
- entrys
This property is required. List<GetPrefix Lists List Entry> - The CIDR address block list of the prefix list.
- id
This property is required. String - The ID of the Prefix List.
- ip
Version This property is required. String - The IP version of the prefix list.
- max
Entries This property is required. Integer - The maximum number of entries for CIDR address blocks in the prefix list.
- prefix
List Description This property is required. String - The description of the prefix list.
- prefix
List Id This property is required. String - The ID of the query Prefix List.
- prefix
List Name This property is required. String - The name of the prefix list.
This property is required. String- The share type of the prefix list.
- create
Time This property is required. string - The time when the prefix list was created.
- entrys
This property is required. GetPrefix Lists List Entry[] - The CIDR address block list of the prefix list.
- id
This property is required. string - The ID of the Prefix List.
- ip
Version This property is required. string - The IP version of the prefix list.
- max
Entries This property is required. number - The maximum number of entries for CIDR address blocks in the prefix list.
- prefix
List Description This property is required. string - The description of the prefix list.
- prefix
List Id This property is required. string - The ID of the query Prefix List.
- prefix
List Name This property is required. string - The name of the prefix list.
This property is required. string- The share type of the prefix list.
- create_
time This property is required. str - The time when the prefix list was created.
- entrys
This property is required. Sequence[GetPrefix Lists List Entry] - The CIDR address block list of the prefix list.
- id
This property is required. str - The ID of the Prefix List.
- ip_
version This property is required. str - The IP version of the prefix list.
- max_
entries This property is required. int - The maximum number of entries for CIDR address blocks in the prefix list.
- prefix_
list_ description This property is required. str - The description of the prefix list.
- prefix_
list_ id This property is required. str - The ID of the query Prefix List.
- prefix_
list_ name This property is required. str - The name of the prefix list.
This property is required. str- The share type of the prefix list.
- create
Time This property is required. String - The time when the prefix list was created.
- entrys
This property is required. List<Property Map> - The CIDR address block list of the prefix list.
- id
This property is required. String - The ID of the Prefix List.
- ip
Version This property is required. String - The IP version of the prefix list.
- max
Entries This property is required. Number - The maximum number of entries for CIDR address blocks in the prefix list.
- prefix
List Description This property is required. String - The description of the prefix list.
- prefix
List Id This property is required. String - The ID of the query Prefix List.
- prefix
List Name This property is required. String - The name of the prefix list.
This property is required. String- The share type of the prefix list.
GetPrefixListsListEntry
- Cidr
This property is required. string - The CIDR address block of the prefix list.
- Description
This property is required. string - The description of the cidr entry.
- Cidr
This property is required. string - The CIDR address block of the prefix list.
- Description
This property is required. string - The description of the cidr entry.
- cidr
This property is required. String - The CIDR address block of the prefix list.
- description
This property is required. String - The description of the cidr entry.
- cidr
This property is required. string - The CIDR address block of the prefix list.
- description
This property is required. string - The description of the cidr entry.
- cidr
This property is required. str - The CIDR address block of the prefix list.
- description
This property is required. str - The description of the cidr entry.
- cidr
This property is required. String - The CIDR address block of the prefix list.
- description
This property is required. 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.