If you are using AWS Glue, you must choose between VPN or AWS Direct Connect, but you must configure the subnet and security group. If you have a firewall, you must configure it to allow the connection as well. Don't forget the rules related to the instance itself.
Check the logs of AWS Glue for more details !