How to remotely connect to AWS Elasticsearch? - amazon-web-services

I have to connect AWS Elasticsearch with Alexa. According to a file, I have to put
client = new ElasticSearchClient("your.elastic.url", 9300, "your.cluster.name");
What is the elastic URL and 9300 for my AWS hosted ES Cluster?

As mentioned in the comment, AWS ES does not offer the possibility to connect via TCP.
TCP transport
The service supports HTTP on port 80, but does not support TCP
transport.
developerguide aes-supported-resources
But you can try this how-to-use-java-high-level-rest-client-with-spring-boot-to-talk-to-aws-elasticsearch.
Another thing, it totally depends upon the underlying library that is https://github.com/unterstein/elastic-alexa you can give it try with https with out port.
As per your question you can get AWS ES cluster details and endpoint here.
ES -> Dashboard -> select domain
in the Top, you see cluster name and below in endpoint.

Related

Expose websocket endpoint for RabitMQ from aws Broker

I have launched a RabbitMQ instance from AWS Broker service. I plan to be able to connect to this from my frontend application too and as such would want a websocket endpoint. I am wondering if AWS exposes a websoket endpoint natively? I came across some documentation which had images showing a wss endpoint under the connection details in the aws console. Please find the attached image for reference.
I don't see this option under the connection of my aws console. Image for reference
I could always launch a separate instance and have it work as a relay, but was just wondering if this is available from within AWS

Kubernetes with an UDP loadbalancer with sticky sessions based on IP

I'm trying to deploy an UDP-based application on kubernetes, but I'm having troubles finding a suitable cloud provider that has an UDP loadbalancer with IP-based sticky sessions.
I have tried using DigitalOcean Kubernetes Service (DOKS) but they don't support UDP loadbalancers.
EKS (AWS' kubernetes service) provides UDP support with NLB for example, but they don't seem to have sticky sessions on that type of loadbalancer, only on the classic LB.
Is there another cloud provider (I'm thinking of GCE or Azure) that provides my required functionalities out of the box?
I'm asking this here to know if anyone else has had the same problem and maybe has already tried various solutions, and has already found the perfect fit.
I know in Nginx Ingress Controller (which I know works with AWS and NLB with UDP support as you stated) can expose UDP services and supports sticky sessions. I have not done this in AWS or any other cloud provider, but I have with similar use cases on bare-metal.
As #jordanm posted, the answer was to apply the stickiness parameter through the ec2 console.

how to connect device to AWS greengrass

I am using MOKOSMART_mkgw1 to collect data and send it to AWS IoT Core.
for that, I need to set the following configurations,
endpoint (aws iot endpoint)
topic (any)
device certificate and private key
root ca.
I was able to connect and send data to aws iot core.
now I want to connect it to aws greengrass device instead of iot core directly.
i have greengrass running, on ip 192.196.1.12 on port 8883 (windows machine).
i download Group CA using basic discovery api. so i used this mqtt settings for device:
broker endpoint (192.168.1.12:8883)
topic (same as registered in subscription in aws iot GG)
device certificate and private key (the device is registered in aws iot GG)
Group CA (downloaded by basic discovery sample application)
but i am still not able to connect to aws gg?
my understanding is aws GG also has a MQTT broker. so by providing a proper authentication and topic, i should be able to connect to it, whether or not I have aws device SDKs or not. am i wrong? what does "basic discovery example" do extra to be able to connect to aws gg ??
I am so sorry for wasting your time if you brainstorm on this question.
the issue was, I was passing a random clientID in MQTT.
instead, I passed "Device Name" as the client ID and it worked.
keep this question here if someone else falls in the same hole.

How can I set up Web Sockets on AWS and log incoming messages to s3 (elastic beanstalk project) mysql db

I have an existing LAMP project on AWS (Elastic-beanstalk). I now what to set up web sockets on AWS too. According to AWS documentation, the way to do that is via AWS API Gateway. I don't know how this all works but there's documentation I found for setting up WebSockets.
Does the Gateway API connect to another service? If so, what service is this? What am I missing?
I mostly just want to make a Web Socket service to look incoming messages to the MySQL database on my Elastic-beanstalk project. I am totally confused about how to do this. Can anyone advise me about what steps I need to take?
Just because api gateway supports web sockets, doesn't mean you need to use it. ALBs do as well and are a more exact fit for elastic beanstalk.
Does an Application Load Balancer support WebSockets?
AWS doesn't support PHP (Ratchet) Web Sockets

elastic4s with Amazon Elasticsearch Service

I'm using elastic4s in my scala project to communicate with ElasticSearch. For development I started a local node and everything is working fine. For production, I would like to use Amazon Elasticsearch Service. I've configured that service and allowed access to it via the ip of my ec2 instance. I can verify that it works by ssh-ing into ec2 and doing:
curl search-blabla-blabla.us-east-1.es.amazonaws.com/_cluster/health
However, I am having trouble connecting elastic4s to that ES instance. I'm trying:
ElasticClient.remote("search-blabla-blabla.us-east-1.es.amazonaws.com", 9300)
which results in:
org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []
Reading the docs, it appears that elastic4s can only connect via TCP [1] and Amazon Elasticsearch Service does not support TCP[2]: The service supports HTTP on port 80, but does not support TCP transport.
Could someone confirm that elastic4s and Amazon ES really don't work together? Because that would mean I have to re-write all of my ES code.
Amazon's Elasticsearch service does not support TCP, just the HTTP protocol. Elastic4s uses TCP only, as does the Elasticsearch Java API (Elastic4s being a wrapper around the Java client).
If you want to use HTTP you'll need to write the queries by hand and use a regular HTTP client, or use an Elasticsearch client that supports the HTTP protocol.
Update:
As of version 5.2, elastic4s supports HTTP as well as TCP. This is currently experimental. https://github.com/sksamuel/elastic4s#quick-start