-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS ElasticSearch service #280
Comments
+1. For whatever silly reason Amazon rolled out their ES service without supporting most of their IAM authentication mechanisms. Authorizing servers by public IP is silly, and the only real option is to sign requests to the ElasticSearch endpoint. I think ideally elasticsearch-py should provide some way to augment requests with additional headers so that the AWS request signing authentication can be tacked on without making it a part of this project directly. |
Yep I think IAM signing is the way to go. We're in VPC so IP auth is not an option. |
Thank you for this, I will mention it in the documentation with other environment considerations. |
Is there a canonnical example I can use for the documentation I could use? |
Here's more or less what I got working: Step 1: Install requests-aws4auth from @mathom's fix branch (https://github.com/mathom/requests-aws4auth/tree/es_fix) at least until tedder/requests-aws4auth#2 is merged. Step 2: Initialize your connection to AWS ES like so:
|
Thanks! I will have to wait for the patch to be merged then before referring to it, I will leave this ticket here open as a reminder for both me and anyone looking for a solution. |
Just a heads up, the required changes have been merged and released to pypi in aws4auth 0.7 |
Has anyone else had any issues with Amazon's ES service? It seems like when Amazon changes the underlying IP for the hostname, my connections stop working. I'm connecting with the hostname (not IP), and every once in a while the connections stop returning any results until I restart the webserver. However, if I connect from the same box, via a python shell (with the same settings), the connection returns results. My hunch is that somewhere the IP is getting cached so when Amazon moves the ES cluster by pointing the DNS to a new IP, we're still using the old connection. Any thoughts on how best to fix this? |
@streeter we restart our web workers after so many requests (gunicorn option, I believe) so we haven't encountered this. |
@mathom Thanks. Was just investigating that option for us. |
Fixed via a7a56b1 Thank you! |
With the new AWS ElasticSearch service they have the HTTP requests authenticated via IAM. With a couple tweaks I got a requests sigv4 plugin to work for this: tedder/requests-aws4auth#2
The resulting code is pretty succinct (see the PR for how I'm connecting to ES) so maybe this would be a good addition to the documentation? Is anyone working on anything related to this?
The text was updated successfully, but these errors were encountered: