1. Registry
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. esa
  6. getLists
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
alicloud logo alicloud logo
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi

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

    NOTE: Available since v1.293.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform_example";
    const _default = new alicloud.esa.List("default", {
        kind: "ip",
        name: name,
        description: name,
        items: [
            "10.1.1.1",
            "10.1.1.2",
        ],
    });
    const ids = alicloud.esa.getListsOutput({
        ids: [_default.id],
    });
    export const esaListsId0 = ids.apply(ids => ids.lists?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform_example"
    default = alicloud.esa.List("default",
        kind="ip",
        name=name,
        description=name,
        items=[
            "10.1.1.1",
            "10.1.1.2",
        ])
    ids = alicloud.esa.get_lists_output(ids=[default.id])
    pulumi.export("esaListsId0", ids.lists[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/esa"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform_example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := esa.NewList(ctx, "default", &esa.ListArgs{
    			Kind:        pulumi.String("ip"),
    			Name:        pulumi.String(name),
    			Description: pulumi.String(name),
    			Items: pulumi.StringArray{
    				pulumi.String("10.1.1.1"),
    				pulumi.String("10.1.1.2"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		ids := esa.GetListsOutput(ctx, esa.GetListsOutputArgs{
    			Ids: pulumi.StringArray{
    				_default.ID().ToIDOutput().ToStringOutput(),
    			},
    		}, nil)
    		ctx.Export("esaListsId0", ids.ApplyT(func(ids esa.GetListsResult) (*string, error) {
    			return ids.Lists[0].Id, nil
    		}).(pulumi.StringPtrOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform_example";
        var @default = new AliCloud.Esa.List("default", new()
        {
            Kind = "ip",
            Name = name,
            Description = name,
            Items = new[]
            {
                "10.1.1.1",
                "10.1.1.2",
            },
        });
    
        var ids = AliCloud.Esa.GetLists.Invoke(new()
        {
            Ids = new[]
            {
                @default.Id,
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["esaListsId0"] = ids.Apply(getListsResult => getListsResult.Lists[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.esa.List;
    import com.pulumi.alicloud.esa.ListArgs;
    import com.pulumi.alicloud.esa.EsaFunctions;
    import com.pulumi.alicloud.esa.inputs.GetListsArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 config = ctx.config();
            final var name = config.get("name").orElse("terraform_example");
            var default_ = new List("default", ListArgs.builder()
                .kind("ip")
                .name(name)
                .description(name)
                .items(            
                    "10.1.1.1",
                    "10.1.1.2")
                .build());
    
            final var ids = EsaFunctions.getLists(GetListsArgs.builder()
                .ids(default_.id())
                .build());
    
            ctx.export("esaListsId0", ids.applyValue(_ids -> _ids.lists()[0].id()));
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform_example
    resources:
      default:
        type: alicloud:esa:List
        properties:
          kind: ip
          name: ${name}
          description: ${name}
          items:
            - 10.1.1.1
            - 10.1.1.2
    variables:
      ids:
        fn::invoke:
          function: alicloud:esa:getLists
          arguments:
            ids:
              - ${default.id}
    outputs:
      esaListsId0: ${ids.lists[0].id}
    
    pulumi {
      required_providers {
        alicloud = {
          source = "pulumi/alicloud"
        }
      }
    }
    
    data "alicloud_esa_getlists" "ids" {
      ids = [alicloud_esa_list.default.id]
    }
    
    resource "alicloud_esa_list" "default" {
      kind        = "ip"
      name        = var.name
      description = var.name
      items       = ["10.1.1.1", "10.1.1.2"]
    }
    variable "name" {
      type    = string
      default = "terraform_example"
    }
    output "esaListsId0" {
      value = data.alicloud_esa_getlists.ids.lists[0].id
    }
    

    Using getLists

    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 getLists(args: GetListsArgs, opts?: InvokeOptions): Promise<GetListsResult>
    function getListsOutput(args: GetListsOutputArgs, opts?: InvokeOutputOptions): Output<GetListsResult>
    def get_lists(ids: Optional[Sequence[str]] = None,
                  name_regex: Optional[str] = None,
                  output_file: Optional[str] = None,
                  query_args: Optional[GetListsQueryArgs] = None,
                  opts: Optional[InvokeOptions] = None) -> GetListsResult
    def get_lists_output(ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
                  name_regex: pulumi.Input[Optional[str]] = None,
                  output_file: pulumi.Input[Optional[str]] = None,
                  query_args: pulumi.Input[Optional[GetListsQueryArgsArgs]] = None,
                  opts: Optional[InvokeOutputOptions] = None) -> Output[GetListsResult]
    func GetLists(ctx *Context, args *GetListsArgs, opts ...InvokeOption) (*GetListsResult, error)
    func GetListsOutput(ctx *Context, args *GetListsOutputArgs, opts ...InvokeOption) GetListsResultOutput

    > Note: This function is named GetLists in the Go SDK.

    public static class GetLists 
    {
        public static Task<GetListsResult> InvokeAsync(GetListsArgs args, InvokeOptions? opts = null)
        public static Output<GetListsResult> Invoke(GetListsInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetListsResult> Invoke(GetListsInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetListsResult> getLists(GetListsArgs args, InvokeOptions options)
    public static Output<GetListsResult> getLists(GetListsArgs args, InvokeOptions options)
    public static Output<GetListsResult> getLists(GetListsArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: alicloud:esa/getLists:getLists
      arguments:
        # arguments dictionary
    data "alicloud_esa_get_lists" "name" {
        # arguments
    }

    The following arguments are supported:

    Ids List<string>
    A list of List IDs used to filter the returned results locally.
    NameRegex string
    A regex string used to filter the returned results locally by List name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    QueryArgs Pulumi.AliCloud.Esa.Inputs.GetListsQueryArgs
    The query parameters sent to the server. At most one block is supported. See queryArgs below.
    Ids []string
    A list of List IDs used to filter the returned results locally.
    NameRegex string
    A regex string used to filter the returned results locally by List name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    QueryArgs GetListsQueryArgs
    The query parameters sent to the server. At most one block is supported. See queryArgs below.
    ids list(string)
    A list of List IDs used to filter the returned results locally.
    name_regex string
    A regex string used to filter the returned results locally by List name.
    output_file string
    File name where to save data source results (after running pulumi preview).
    query_args object
    The query parameters sent to the server. At most one block is supported. See queryArgs below.
    ids List<String>
    A list of List IDs used to filter the returned results locally.
    nameRegex String
    A regex string used to filter the returned results locally by List name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    queryArgs GetListsQueryArgs
    The query parameters sent to the server. At most one block is supported. See queryArgs below.
    ids string[]
    A list of List IDs used to filter the returned results locally.
    nameRegex string
    A regex string used to filter the returned results locally by List name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    queryArgs GetListsQueryArgs
    The query parameters sent to the server. At most one block is supported. See queryArgs below.
    ids Sequence[str]
    A list of List IDs used to filter the returned results locally.
    name_regex str
    A regex string used to filter the returned results locally by List name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    query_args GetListsQueryArgs
    The query parameters sent to the server. At most one block is supported. See queryArgs below.
    ids List<String>
    A list of List IDs used to filter the returned results locally.
    nameRegex String
    A regex string used to filter the returned results locally by List name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    queryArgs Property Map
    The query parameters sent to the server. At most one block is supported. See queryArgs below.

    getLists 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.Esa.Outputs.GetListsList>
    A list of Lists. Each element contains the following attributes:
    Names List<string>
    A list of List names.
    NameRegex string
    OutputFile string
    QueryArgs Pulumi.AliCloud.Esa.Outputs.GetListsQueryArgs
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Lists []GetListsList
    A list of Lists. Each element contains the following attributes:
    Names []string
    A list of List names.
    NameRegex string
    OutputFile string
    QueryArgs GetListsQueryArgs
    id string
    The provider-assigned unique ID for this managed resource.
    ids list(string)
    lists list(object)
    A list of Lists. Each element contains the following attributes:
    names list(string)
    A list of List names.
    name_regex string
    output_file string
    query_args object
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    lists List<GetListsList>
    A list of Lists. Each element contains the following attributes:
    names List<String>
    A list of List names.
    nameRegex String
    outputFile String
    queryArgs GetListsQueryArgs
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    lists GetListsList[]
    A list of Lists. Each element contains the following attributes:
    names string[]
    A list of List names.
    nameRegex string
    outputFile string
    queryArgs GetListsQueryArgs
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    lists Sequence[GetListsList]
    A list of Lists. Each element contains the following attributes:
    names Sequence[str]
    A list of List names.
    name_regex str
    output_file str
    query_args GetListsQueryArgs
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    lists List<Property Map>
    A list of Lists. Each element contains the following attributes:
    names List<String>
    A list of List names.
    nameRegex String
    outputFile String
    queryArgs Property Map

    Supporting Types

    GetListsList

    Description string
    The description of the List.
    Id string
    The ID of the List.
    Kind string
    The type of the List.
    Length int
    The number of items contained in the List.
    ListId string
    The ID of the List.
    Name string
    The name of the List.
    UpdateTime string
    The last modification time of the List.
    Description string
    The description of the List.
    Id string
    The ID of the List.
    Kind string
    The type of the List.
    Length int
    The number of items contained in the List.
    ListId string
    The ID of the List.
    Name string
    The name of the List.
    UpdateTime string
    The last modification time of the List.
    description string
    The description of the List.
    id string
    The ID of the List.
    kind string
    The type of the List.
    length number
    The number of items contained in the List.
    list_id string
    The ID of the List.
    name string
    The name of the List.
    update_time string
    The last modification time of the List.
    description String
    The description of the List.
    id String
    The ID of the List.
    kind String
    The type of the List.
    length Integer
    The number of items contained in the List.
    listId String
    The ID of the List.
    name String
    The name of the List.
    updateTime String
    The last modification time of the List.
    description string
    The description of the List.
    id string
    The ID of the List.
    kind string
    The type of the List.
    length number
    The number of items contained in the List.
    listId string
    The ID of the List.
    name string
    The name of the List.
    updateTime string
    The last modification time of the List.
    description str
    The description of the List.
    id str
    The ID of the List.
    kind str
    The type of the List.
    length int
    The number of items contained in the List.
    list_id str
    The ID of the List.
    name str
    The name of the List.
    update_time str
    The last modification time of the List.
    description String
    The description of the List.
    id String
    The ID of the List.
    kind String
    The type of the List.
    length Number
    The number of items contained in the List.
    listId String
    The ID of the List.
    name String
    The name of the List.
    updateTime String
    The last modification time of the List.

    GetListsQueryArgs

    Desc bool

    Whether to sort in descending order. Valid values: true, false.

    QueryArgs values are passed unchanged for server-side interpretation; filtering behavior depends on the ESA API.

    DescriptionLike string
    The fuzzy search for list description.
    IdLike string
    The fuzzy search for list ID.
    ItemLike string
    The value passed to the ListLists API to filter list contents.
    Kind string
    The type of the custom list, e.g. ip.
    NameItemLike string
    The fuzzy search matching a list name or its items.
    NameLike string
    The fuzzy search for list name.
    OrderBy string
    Specify the column to sort by.
    Desc bool

    Whether to sort in descending order. Valid values: true, false.

    QueryArgs values are passed unchanged for server-side interpretation; filtering behavior depends on the ESA API.

    DescriptionLike string
    The fuzzy search for list description.
    IdLike string
    The fuzzy search for list ID.
    ItemLike string
    The value passed to the ListLists API to filter list contents.
    Kind string
    The type of the custom list, e.g. ip.
    NameItemLike string
    The fuzzy search matching a list name or its items.
    NameLike string
    The fuzzy search for list name.
    OrderBy string
    Specify the column to sort by.
    desc bool

    Whether to sort in descending order. Valid values: true, false.

    QueryArgs values are passed unchanged for server-side interpretation; filtering behavior depends on the ESA API.

    description_like string
    The fuzzy search for list description.
    id_like string
    The fuzzy search for list ID.
    item_like string
    The value passed to the ListLists API to filter list contents.
    kind string
    The type of the custom list, e.g. ip.
    name_item_like string
    The fuzzy search matching a list name or its items.
    name_like string
    The fuzzy search for list name.
    order_by string
    Specify the column to sort by.
    desc Boolean

    Whether to sort in descending order. Valid values: true, false.

    QueryArgs values are passed unchanged for server-side interpretation; filtering behavior depends on the ESA API.

    descriptionLike String
    The fuzzy search for list description.
    idLike String
    The fuzzy search for list ID.
    itemLike String
    The value passed to the ListLists API to filter list contents.
    kind String
    The type of the custom list, e.g. ip.
    nameItemLike String
    The fuzzy search matching a list name or its items.
    nameLike String
    The fuzzy search for list name.
    orderBy String
    Specify the column to sort by.
    desc boolean

    Whether to sort in descending order. Valid values: true, false.

    QueryArgs values are passed unchanged for server-side interpretation; filtering behavior depends on the ESA API.

    descriptionLike string
    The fuzzy search for list description.
    idLike string
    The fuzzy search for list ID.
    itemLike string
    The value passed to the ListLists API to filter list contents.
    kind string
    The type of the custom list, e.g. ip.
    nameItemLike string
    The fuzzy search matching a list name or its items.
    nameLike string
    The fuzzy search for list name.
    orderBy string
    Specify the column to sort by.
    desc bool

    Whether to sort in descending order. Valid values: true, false.

    QueryArgs values are passed unchanged for server-side interpretation; filtering behavior depends on the ESA API.

    description_like str
    The fuzzy search for list description.
    id_like str
    The fuzzy search for list ID.
    item_like str
    The value passed to the ListLists API to filter list contents.
    kind str
    The type of the custom list, e.g. ip.
    name_item_like str
    The fuzzy search matching a list name or its items.
    name_like str
    The fuzzy search for list name.
    order_by str
    Specify the column to sort by.
    desc Boolean

    Whether to sort in descending order. Valid values: true, false.

    QueryArgs values are passed unchanged for server-side interpretation; filtering behavior depends on the ESA API.

    descriptionLike String
    The fuzzy search for list description.
    idLike String
    The fuzzy search for list ID.
    itemLike String
    The value passed to the ListLists API to filter list contents.
    kind String
    The type of the custom list, e.g. ip.
    nameItemLike String
    The fuzzy search matching a list name or its items.
    nameLike String
    The fuzzy search for list name.
    orderBy String
    Specify the column to sort by.

    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 alicloud logo
    Viewing docs for Alibaba Cloud v3.108.0
    published on Thursday, Sep 17, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial