I’m a bit confused … the title of your post is:
Data source doesn’t refresh contents while planning
but then you describe it doing just that.
You quote this from the docs:
At least one of the given arguments is a managed resource attribute or other value that Terraform cannot predict until the apply step
and your example shows Terraform behaving in accordance with that.
However you are using Terraform 0.11 which is very old - so much had changed since then, including exactly how data resources work.
I would recommend upgrading with some urgency.
Upgrading does solve the issue. Thank you!