Solved, I was missing route to NAT gateway in private subnet.
Created Pythonshell with simple script, like just requests.get(<elasticsearch_endpoint>). Elasticsearch cluster is in VPC.
I tried using self-referencing groups, endpoints but nothing worked. Also custom connection with JDBC fails Could not find S3 endpoint or NAT gateway for subnetId (but it exists).
I see that for Spark jobs ESConnector is available but can not find any working way to make it with Pythonshell jobs. Is there any way to allow such connection?
AWS Glue pythonshell job - how to connect to elasticsearch in VPC?