ambitious-father-68746
06/20/2022, 2:47 PM.apply()
, but Pulumi complains since it can't be used against a list.wide-cat-87818
06/21/2022, 2:07 PMsorted_network_interfaces = ec2.get_network_interfaces_output().apply(
lambda network_interfaces: sorted(network_interfaces.ids)
)
If you have for instance multiple Outputs, you can use pulumi.Output.all():
sorted_network_interfaces1 = ec2.get_network_interfaces_output().apply(
lambda network_interfaces: sorted(network_interfaces.ids),
)
sorted_network_interfaces2 = ec2.get_network_interfaces_output().apply(
lambda network_interfaces: network_interfaces.ids,
)
sorted_network_interfaces = pulumi.Output.all(sorted_network_interfaces1, sorted_network_interfaces2).apply(
lambda args: sorted((*args[0], *args[1])),
)
This example will sort the same network interfaces in one list, so if you need unique items, you need to put it into a set and then sort.ambitious-father-68746
06/21/2022, 2:10 PM_output()
variant. That gives me an Output that is a list, so apply()
can run. It doesn't seem to be possible to do this on a list of Outputs. Thanks!wide-cat-87818
06/21/2022, 2:13 PMsorted_network_interfaces = sorted(ec2.get_network_interfaces().ids)
ambitious-father-68746
06/21/2022, 2:14 PMwide-cat-87818
06/21/2022, 2:15 PM