try this another way, this object attribute only exists if associate_public_ip_address was set