Terraform does not support dynamic references to arbitrary blocks.
That means you can’t write something like
To make this work, you’d have to restructure the multiple data blocks this is suggesting, to onedata block with a for_each. Then, you can write something like: