All 1000 scanned ports on 172.31.47.81 are filtered
As, indeed they should be.
There are several ranges of IPv4 addresses that are reserved for use on private networks.
10.*.*.* 172.16.*.* through 172.31.*.* 192.168.*.*
Any address in these ranges can't be directly accessed across the Internet.
http://tools.ietf.org/html/rfc1918
https://www.arin.net/knowledge/address_filters.html
EC2 instances always have a private IP address associated with them, and sometimes an externally-accessible public IP. These external addresses are either dynamically allocated at instance launch from a pool (and deallocated when the instance is stopped or terminated, at which point the address goes back to the pool), or can be continually reserved by the customer and associated/disassociated with instances and retained for the customer's subsequent reuse (in which case, they're called "Elastic IP Addresses.")
Internally to one customer's EC2 deployment in a given region (and across VPN tunnels into VPC) the instances can address each other by their private IP (and should, because it's free of data transport charges)... but across the Internet, instances can only be accessed by their public (a.k.a. "external") IP address, which is visible in the console... even though, from the instance's perspective (i.e. ifconfig
, etc.) the only known address is the private one.
The EC2 infrastructure transparently does the network address translation (NAT) between the external public and the internal private address.
If you're accessing the instance by ssh from outside, the IP address you're using to establish the ssh connection will be the one you'll need to use to access other services, as well.