Вы были близки:
output "inventory" {
value = "${
join(
" ",
formatlist(
"%s,%s",
azurerm_public_ip.main.*.ip_address,
azurerm_network_interface.main.*.private_ip_address
)
)
}"
}
Пример:
output "inventory" {
value = "${
join(
" ",
formatlist(
"%s,%s",
list("1", "2", "3"),
list("a", "b", "c")
)
)
}"
}
> terraform apply
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Outputs:
inventory = 1,a 2,b 3,c