How to call list of string variable in data source with filters

data “aws_ebs_volume” “volume” {
count = “${length(var.device_names)}”

filter {
name = “tag:name”
values = “${element(var.device_names, count.index)}”
}
}

output “ebs_volume_ids” {
value = [“${data.aws_ebs_volume.volume.*.id}”]
}

variable “device_names” {
type = list(string)
default = [
“datadg01”,
“datadg02”,
]
}