This issue can be addressed by creating a Glue connection to a private subnet behind a Private NAT Gateway within a VPC. This solution involves interconnecting the Glue VPC with a database VPC using a Transit Gateway and configuring appropriate routing tables.
For implementation details, please refer to the AWS Glue blog post below. It includes a CloudFormation template that you can launch in your environment for a quick testing. Be sure to review the template for the resources it will create and the associated costs when running these services in your setup.