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?