Maybe you are getting that error because there is no attribute called "primary_private_ip_address"
What I could image/suggest is, that you might want to change the first underscore to a point... "primary.private_ip_address"
I hope my answer is helpful to you,
If the reply was helpful, please upvote and/or accept it as an answer, as this helps others in the community with similar questions. Thanks!