title: How to talk to aws elasticsearch service using elastic java client?
body: <p>I have set up a elasticsearch server using <a href="https://aws.amazon.com/elasticsearch-service/">AWS elasticsearch service</a> (Not EC2). It gave me an endpoint <a href="https://xxx-xxxxxxxx.us-west-2.es.amazonaws.com/">https://xxx-xxxxxxxx.us-west-2.es.amazonaws.com/</a> and if I click this endpoint(Note that there is no port specified) I can get the expected</p>
  
  <pre><code>{
    status: 200,
    name: "Mastermind",
    cluster_name: "xxxx",
    version: {
      number: "1.5.2",
      build_hash: "yyyyyy",
      build_timestamp: "2015-04-27T09:21:06Z",
      build_snapshot: false,
      lucene_version: "4.10.4"
    },
    tagline: "You Know, for Search"
  }
  </code></pre>
  
  <p>The question is how do I get this through the elasticsearch java client without a port number? The sample code I get is</p>
  
  <pre><code>Client client = TransportClient.builder().build()
      .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("host1"), 9300));
  </code></pre>
  
  <p>If I use this code and just replace "host1" with my endpoint, I'll get "NoNodeAvailableException"</p>
  
  <p>ps:
  The java client version I'm using is 2.0.0.</p>
  
  <p><strong>Edit</strong>
  I finally decided to go with <a href="https://github.com/searchbox-io/Jest">Jest</a>, a 3rd party REST client. But what Brooks answered below is also very helpful - AWS do use port 80 for http and 443 for https. The blocker for me was the firewall I guess.</p>
  
  <p><strong>Edit2</strong>
  The AWS ES service documentation explicitly says:<br>
  <strong><em>The service supports HTTP on port 80, but does not support TCP transport.</em></strong></p>