I am trying to translate <https://github.com/pulum...
# python
b
I am trying to translate https://github.com/pulumi/templates/blob/master/azure-typescript/index.ts#L18-L20 to python:
Copy code
st_keys = pulumi.Output.all([rg.resource_group_name, st.name]).apply(
    lambda rg_name, st_name: storage.list_storage_account_keys(
        resource_group_name=rg_name,
        account_name=st_name
    )
)
which fails with
Copy code
File "/Users/xxx/development/xxx-pulumi-azure/venv/lib/python3.9/site-packages/pulumi/output.py", line 181, in run
        transformed: Input[U] = func(value)
    TypeError: <lambda>() missing 1 required positional argument: 'st_name'
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
What am I doing wrong?
w
Copy code
st_keys = pulumi.Output.all(rg.resource_group_name, st.name).apply(
    lambda args: storage.list_storage_account_keys(
        resource_group_name=args[0],
        account_name=args[1]
    )
)
or
Copy code
st_keys = pulumi.Output.all(rg_name=rg.resource_group_name, st_name=st.name).apply(
    lambda args: storage.list_storage_account_keys(
        resource_group_name=args['rg_name'],
        account_name=args['st_name']
    )
)
b
ok I see
thx 🙂
c
thx @witty-candle-66007 I ended up using
arg[0]...
for some IAM policies and it doesn't read well Using the dictionary makes it so much easier to read and understand
👍 1