Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Commit

Permalink
fix http/https can't be recognized issue when connect to AWS Elastics…
Browse files Browse the repository at this point in the history
…earch(#26)

* fix http/https can't be recognized issue when connect to AWS Elasticsearch

* update readme and usage gif
  • Loading branch information
zhongnansu authored Mar 27, 2020
1 parent 62937ff commit 0c45c89
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Check out [clirc](./odfesql_cli/conf/clirc) for details of all available configu
- *-u/-w:* username and password. User needs to provide credentials when connecting to:
- Elasticsearch with X-pack security enabled
- Elasticsearch OSS with [Open distro Security Plugin](https://opendistro.github.io/for-elasticsearch-docs/docs/install/plugins/) installed
- IP-based AWS Elasticsearch domain with [Fine Grained Access Control](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/fgac.html) enabled
- AWS Elasticsearch domain with [Fine Grained Access Control](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/fgac.html) enabled

- *--aws-auth:* turn on to use AWS sigV4 authentication. It can be configured by AWS CLI `aws configure` command. ODFE SQL
CLI will try to retrieve this config to connect.
Expand Down
2 changes: 1 addition & 1 deletion odfesql_cli/esconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def get_aes_client(self):
click.secho(message="Can not retrieve your AWS credentials, check your AWS config", fg="red")

aes_client = Elasticsearch(
hosts=[{"host": str(self.endpoint), "port": 443}],
hosts=[self.endpoint],
http_auth=self.aws_auth,
use_ssl=True,
verify_certs=True,
Expand Down
Binary file modified screenshots/usage.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/test_esconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def test_get_aes_client(self):
aes_test_executor.get_aes_client()

mock_es.assert_called_with(
hosts=[{"host": str(AES_ENDPOINT), "port": 443}],
hosts=[AES_ENDPOINT],
http_auth=aes_test_executor.aws_auth,
use_ssl=True,
verify_certs=True,
Expand Down

0 comments on commit 0c45c89

Please sign in to comment.