1. Packages
  2. Standard Library
  3. API Docs
  4. index
StandardLibrary v2.3.2 published on Tuesday, Feb 10, 2026 by Pulumi
std logo
StandardLibrary v2.3.2 published on Tuesday, Feb 10, 2026 by Pulumi

    Finds the index of a given element in a list.

    Using index

    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 index(args: IndexArgs, opts?: InvokeOptions): Promise<IndexResult>
    function indexOutput(args: IndexOutputArgs, opts?: InvokeOptions): Output<IndexResult>
    def index(element: Optional[Any] = None,
              input: Optional[Sequence[Any]] = None,
              opts: Optional[InvokeOptions] = None) -> IndexResult
    def index_output(element: Optional[Any] = None,
              input: Optional[pulumi.Input[Sequence[Any]]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[IndexResult]
    func Index(ctx *Context, args *IndexArgs, opts ...InvokeOption) (*IndexResult, error)
    func IndexOutput(ctx *Context, args *IndexOutputArgs, opts ...InvokeOption) IndexResultOutput

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

    public static class Index 
    {
        public static Task<IndexResult> InvokeAsync(IndexArgs args, InvokeOptions? opts = null)
        public static Output<IndexResult> Invoke(IndexInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<IndexResult> index(IndexArgs args, InvokeOptions options)
    public static Output<IndexResult> index(IndexArgs args, InvokeOptions options)
    
    fn::invoke:
      function: std:index
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Element object
    Input List<object>
    Element interface{}
    Input []interface{}
    element Object
    input List<Object>
    element any
    input any[]
    element Any
    input Sequence[Any]
    element Any
    input List<Any>

    index Result

    The following output properties are available:

    Result int
    Result int
    result Integer
    result number
    result int
    result Number

    Package Details

    Repository
    std pulumi/pulumi-std
    License
    std logo
    StandardLibrary v2.3.2 published on Tuesday, Feb 10, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate