When launching new instance in AWS, the public IP address and DNS name is not returned as part of the response.
The machine created has public IP and DNS name assigned, as I can see in the web console, but the response to the SDK method call does not have the IP and DNS field values assigned.
I'm using following code:
output, err := ec2session.RunInstances(input)
...
if output.Instances[0].PublicIpAddress == nil {
//... that is the case
}
I believe the assignment of the public ip address is somehow delayed, even if I can't notice that using the web console.
How do I obtain the public IP address and DNS name after creating the instance? Is polling DescribeInstances the right method to do it?