Can I specify multiple connecton hosts in the same resource?

Can I specify multiple connection hosts similar to below?

  count = var.agent_node_count
  connection {
     host = var.agent_ips[count.index] , var.apiserver_ip

I can do as follows but someting like the above is clearer.

  count = var.standalone_api_server ? local.total_nodes : local.total_nodes
  connection {
     host = local.all_nodes[count.index]