VCD - loop -Reference to undeclared resource

Hello, i am beginner with terraform, i declared the sizing policy (var:compute) in my variable file ( list of object), when i use the loop for each to use the right sizing policy it does not work
sizing_policy_id = data.vcd_vm_sizing_policy.[each.value.compute].id
i tried also to declare the variable like compute = “” and use it like sizing_policy_id = each.value.compute but also does not work.

Any suggestions are welcomed