delightful-queen-14969
09/05/2025, 7:42 AMSequence[Output[str]]
but also Output[Sequence[str]]
for example. As a follow on, when I want to somehow boil both of these down to some common structure, like doing something like:
somevalue: Sequence[Output[str]] | Output[Sequence[str]] = ...
args.something = pulumi.Output.from_input(somevalue).apply(lambda xyx: ....)
Does this end up being an Output[Sequence[Output[str]]]
or something? Does it just nest forever? Feels like I'm either approaching the typing of my fields wrong or missing some other feature herebillions-engineer-7692
09/05/2025, 4:40 PMOutput[Sequence[str]]
but don't hold me to that. I'll find someone who can definitively say.delightful-queen-14969
09/05/2025, 10:44 PMdelightful-queen-14969
09/05/2025, 10:46 PMsalmon-gold-74709
09/07/2025, 5:16 PMI think the runtime flattens it all toI think this is right. Here's a test program to illustrate:but don't hold me to that. I'll find someone who can definitively say.Output[Sequence[str]]
# Case 1: a Python list whose elements are Outputs (Sequence[Output[str]])
list_of_outputs: typing.Sequence[pulumi.Output[str]] = [
pulumi.Output.secret("alpha"),
pulumi.Output.from_input("beta"),
pulumi.Output.from_input("gamma"),
]
# Case 2: a single Output that resolves to a Python list (Output[Sequence[str]])
output_of_list: pulumi.Output[typing.Sequence[str]] = pulumi.Output.from_input(
["delta", "epsilon", "zeta"]
)
# Normalize both to Output[Sequence[str]]
norm_a: pulumi.Output[typing.Sequence[str]] = pulumi.Output.from_input(list_of_outputs)
norm_b: pulumi.Output[typing.Sequence[str]] = pulumi.Output.from_input(output_of_list)
pulumi.export("norm_a_is_list_of_str", norm_a)
pulumi.export("norm_b_is_list_of_str", norm_b)
Outputs are normalised as expected:
"plain,wrapped,foo"
norm_a_is_list_of_str: [
[0]: "alpha"
[1]: "beta"
[2]: "gamma"
]
norm_b_is_list_of_str: [
[0]: "delta"
[1]: "epsilon"
[2]: "zeta"
]
delightful-queen-14969
09/07/2025, 9:47 PM$ pulumi preview
Enter your passphrase to unlock config/secrets
(set PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE to remember):
Enter your passphrase to unlock config/secrets
Previewing update (dev):
Type Name Plan Info
pulumi:pulumi:Stack test-stack 1 error; 2 messages
Diagnostics:
pulumi:pulumi:Stack (test-stack):
error: mypy failed: exit status 1
__main__.py:19: error: Argument 1 to "from_input" of "Output" has incompatible type "Sequence[Output[str]]"; expected "Sequence[str] | Awaitable[Sequence[str]] | Output[Sequence[str]]" [arg-type]
Found 1 error in 1 file (checked 1 source file)
Resources:
salmon-gold-74709
09/09/2025, 7:35 AM