title: Spark with AWS Elastic Search integration - Getting - Cloud instance without the proper setting 'es.nodes.wan.only' error
body: <p>Create AWS Elastic search with public access and try to push dataframe into ES from my local , i am getting below exception</p>
  <pre><code>Exception in thread &quot;main&quot; org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: Cannot detect ES version - typically this happens if the network/Elasticsearch cluster is not accessible or when targeting a WAN/Cloud instance without the proper setting 'es.nodes.wan.only'
  </code></pre>
  <p>The same workflow i tried in EMR and getting the same exception. What would be reason is blocking ? any idea
  Note : Configured right ES instance jar in maven and below are my code for references</p>
  <pre><code>userDF.write.format(&quot;org.elasticsearch.spark.sql&quot;)
      .option(&quot;es.mapping.id&quot;, &quot;id&quot;)
      .option(&quot;spark.es.index.auto.create&quot;, &quot;true&quot;)
      .option(&quot;spark.es.nodes&quot;, &quot;https://emrtoser-searchdomain-7uertdoiicyf42hw3rtyhqc7y.us-east-1.es.amazonaws.com&quot;) 
      .option(&quot;spark.es.batch.size.entries&quot;, &quot;1000&quot;)  
      .option(&quot;spark.es.net.http.auth.user&quot;, &quot;xxxx&quot;)
     .option(&quot;spark.es.net.http.auth.pass&quot;, &quot;XXXxxx123#&quot;) 
      
      .mode(SaveMode.Overwrite)
      .save(&quot;user/data&quot;)
  </code></pre>