Thanks @Marcin and @ErvinSzilagyi
Turns out that I needed to have the relevant inbound rules in my SG
- Based on the Interface Endpoint being used and the port, the security group attached to the VPC endpoint must allow incoming connections on the relevant port from private subnet of the VPC
After I enabled inbound rules on port 443 (https), I could do these tests to confirm connectivity happens only via Interface Endpoint.
Note: I am showing examples below for awsbatch
- the same can be done for any Interface Endpoint (if trying a different endpoint like say smtp endpoint, make sure you change the appropriate port number in the command
)
- sudo traceroute -n -T -p 443 batch.< region >.amazonaws.com
- sudo telnet batch.< region >.amazonaws.com 443
- sudo nslookup < DNS Name of Batch Interface Endpoint >
sudo traceroute -n -T -p 443 batch.< region >.amazonaws.com
1 * * *
2 * * *
3 * * *
4 < IP Address > 1.313 ms 1.587 ms 1.463 ms
sudo telnet batch.< region >.amazonaws.com 443
Trying IP Address ...
Connected to batch.< region > .amazonaws.com.
Escape character is '^]'.
^]
telnet> quit
Connection closed.
Useful link for closing Telnet connections - I had trouble getting the escape characters correct : https://www.redhat.com/sysadmin/telnet-netcat-troubleshooting
Now, if I did sudo nslookup < DNS Name of Batch Interface Endpoint > , it would give me the IP address reflected by the above 2 commands and other useful info.
Other useful links:
Hope this will help all.