This is a curated list of troubleshooting tips in AWS Cloud Environment. AWS Networking can become complex as a given infrastructure grows.
Dealing with networking issues almost always comes down to understanding the building blocks and basics.
curl ifconfig.me
curl https://checkip.amazonaws.com
If this returns a public IP, then your traffic to the SFTP server’s public endpoint, the public server or public facing resource is leaving the VPC through a NAT Gateway/Internet Gateway and re-entering AWS. The SFTP server, public ec2 instance or resource sees that public IP, not the EC2’s private IP. Adjust the security group accordingly