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

    Converts its argument to a boolean value. Only boolean values, null, and the exact strings “true” and “false” can be converted to boolean. All other values will result in an error.

    Using tobool

    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 tobool(args: ToboolArgs, opts?: InvokeOptions): Promise<ToboolResult>
    function toboolOutput(args: ToboolOutputArgs, opts?: InvokeOptions): Output<ToboolResult>
    def tobool(input: Optional[Any] = None,
               opts: Optional[InvokeOptions] = None) -> ToboolResult
    def tobool_output(input: Optional[Any] = None,
               opts: Optional[InvokeOptions] = None) -> Output[ToboolResult]
    func Tobool(ctx *Context, args *ToboolArgs, opts ...InvokeOption) (*ToboolResult, error)
    func ToboolOutput(ctx *Context, args *ToboolOutputArgs, opts ...InvokeOption) ToboolResultOutput

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

    public static class Tobool 
    {
        public static Task<ToboolResult> InvokeAsync(ToboolArgs args, InvokeOptions? opts = null)
        public static Output<ToboolResult> Invoke(ToboolInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<ToboolResult> tobool(ToboolArgs args, InvokeOptions options)
    public static Output<ToboolResult> tobool(ToboolArgs args, InvokeOptions options)
    
    fn::invoke:
      function: std:tobool
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Input object
    Input interface{}
    input Object
    input any
    input Any
    input Any

    tobool Result

    The following output properties are available:

    Result bool
    Result bool
    result Boolean
    result boolean
    result bool
    result Boolean

    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