ConfigurationError: Missing node(s)

I am using the JS client to connect to AWS Elasticsearch Service. With the setup:

import { Client, ClientOptions } from "@elastic/elasticsearch"

const {
  ES_AWS_ENDPOINT,
  ES_AWS_USER,
  ES_AWS_PASSWORD,
} = process.env

const options: ClientOptions = {
  node: ES_AWS_ENDPOINT,
  auth: {
    username: ES_AWS_USER,
    password: ES_AWS_PASSWORD,
  },
}

const client = new Client(options)

export default client

Which successfully connects from my local machine in development. When I run a build of the application with the same configuration, all requests from the application get the config error, saying I have no nodes declared. Is this method of connecting to Elasticsearch Service even supported? Why would it work locally and not from a build on an EC2 instance?

We don't support this service here so it might be hard to get information on that.

BTW did you look at Cloud by Elastic, also available if needed from AWS Marketplace ?

Cloud by elastic is one way to have access to all features, all managed by us. Think about what is there yet like Security, Monitoring, Reporting, SQL, Canvas, Maps UI, Alerting and built-in solutions named Observability, Security, Enterprise Search and what is coming next :slight_smile: ...