https://pulumi.com logo
#getting-started
Title
# getting-started
i

important-sugar-9877

09/06/2022, 5:22 PM
Hi, im trying to run a command.local.run() with an Output type parameter like this:
Copy code
instances[0].instance_data['Sys-sync']['instance_ip'].apply(
    lambda instance_ip: command.local.run(
        command=f"echo {instance_ip} > out.txt"
    )
)
the type is Output, so Output.apply should work?
Copy code
print(type(instances[0].instance_data['BFM-snow-sync']['instance_ip']))
<class 'pulumi.output.Output'>'
But im getting this error instead. Can anyone give me a hint on that?
Copy code
Diagnostics:
  pulumi:pulumi:Stack (BFM-snow-sync-dev):
    error: Program failed with an unhandled exception:
    error: Traceback (most recent call last):
      File "/usr/local/bin/pulumi-language-python-exec", line 107, in <module>
        loop.run_until_complete(coro)
      File "/Users/username/.pyenv/versions/3.10.4/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
        return future.result()
      File "/Users/username/cse-dev/git/BFM-snow-sync/.direnv/python-3.10.4/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 126, in run_in_stack
        await run_pulumi_func(lambda: Stack(func))
      File "/Users/username/cse-dev/git/BFM-snow-sync/.direnv/python-3.10.4/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 51, in run_pulumi_func
        await wait_for_rpcs()
      File "/Users/username/cse-dev/git/BFM-snow-sync/.direnv/python-3.10.4/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 110, in wait_for_rpcs
        raise exception
      File "/Users/username/cse-dev/git/BFM-snow-sync/.direnv/python-3.10.4/lib/python3.10/site-packages/pulumi/output.py", line 194, in run
        transformed: Input[U] = func(value)
      File "/Users/username/cse-dev/git/BFM-snow-sync/./__main__.py", line 65, in <lambda>
        lambda instance_ip: command.local.run(
      File "/Users/username/cse-dev/git/BFM-snow-sync/.direnv/python-3.10.4/lib/python3.10/site-packages/pulumi_command/local/run.py", line 246, in run
        opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    AttributeError: type object 'InvokeOptions' has no attribute 'merge'
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
8 Views