1. Packages
  2. Standard Library
  3. API Docs
  4. keys
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

    Returns a lexically sorted list of the map keys.

    Using keys

    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 keys(args: KeysArgs, opts?: InvokeOptions): Promise<KeysResult>
    function keysOutput(args: KeysOutputArgs, opts?: InvokeOptions): Output<KeysResult>
    def keys(input: Optional[Mapping[str, Any]] = None,
             opts: Optional[InvokeOptions] = None) -> KeysResult
    def keys_output(input: Optional[pulumi.Input[Mapping[str, Any]]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[KeysResult]
    func Keys(ctx *Context, args *KeysArgs, opts ...InvokeOption) (*KeysResult, error)
    func KeysOutput(ctx *Context, args *KeysOutputArgs, opts ...InvokeOption) KeysResultOutput

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

    public static class Keys 
    {
        public static Task<KeysResult> InvokeAsync(KeysArgs args, InvokeOptions? opts = null)
        public static Output<KeysResult> Invoke(KeysInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<KeysResult> keys(KeysArgs args, InvokeOptions options)
    public static Output<KeysResult> keys(KeysArgs args, InvokeOptions options)
    
    fn::invoke:
      function: std:keys
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Input Dictionary<string, object>
    Input map[string]interface{}
    input Map<String,Object>
    input {[key: string]: any}
    input Mapping[str, Any]
    input Map<Any>

    keys Result

    The following output properties are available:

    Result List<string>
    Result []string
    result List<String>
    result string[]
    result Sequence[str]
    result List<String>

    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