Terraform: Convert list of object to list of single element from object

Viewed 11199

I have a list of objects from a variable in terraform

variable "persons" {
  type = list(object({
    name = string,
    phonenumber = string,
    tshirtSize = string
  }))
    description = "List of person"
}

Now I want a list of the person's names so I can use it to define an AWS Resource

How can I convert this object list to a list of names ["bob", "amy", "jane"]

I'm on terraform 0.12.24, though can upgrade if needed

1 Answers
Related