I would like to get combined list from sublists of an object list.

I have a list object like:

```
users: [
  {
    name: "a"
    cars: [
      "z1",
      "z2"
    ]
  },
  {
    name: "b"
    cars: [
      "x1",
      "x2"
    ]
  }
]

```

and result should be:

```
cars = ["z1", "z2", "x1", "x2"]

```

The main reason is that I need to execute resource on each element:

```
resource "some_resource" "some_resource_name" {
  for_each = var.cars
  car_name = each.value
}

```

If there is a way to do it directly in resource, perfect. Or if I need to pre-build the list in locals that also is not a problem.
How do I do that?