Skip to content
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 signed requests #66

Closed
marcelolebre opened this issue Feb 25, 2019 · 7 comments
Closed

AWS Elasticsearch Service signed requests #66

marcelolebre opened this issue Feb 25, 2019 · 7 comments

Comments

@marcelolebre
Copy link
Contributor

marcelolebre commented Feb 25, 2019

I’m currently using elasticsearch-elixir and I extended Elasticsearch.API to use AWS Elasticsearch Service with signed requests. I wonder if this is a feature you’d like to include in this project, I could make a PR if interested. What do you think?

@danielberkompas
Copy link
Owner

Sure, I'd love to see a PR for this.

@danielberkompas
Copy link
Owner

Closed with #67.

@ksherman
Copy link

ksherman commented Apr 5, 2019

Hey ya! Having a potential issue with this, but I'm also not a seasoned Elixir guy and this is the first time I've touched ES :P

So I have this in my config.exs:

# AWS Elasticsearch Config
config :ef_api, EfAPI.ElasticsearchCluster,
  json_library: Jason,
  api: Elasticsearch.API.AWS,
  url:
    "CENSORED_BECAUSE_MAYBE_SENSITIVE?",
  default_options: [
    aws: [
      region: "us-west-1",
      service: "es",
      access_key_id: System.get_env("AWS_ACCESS_KEY_ID"),
      secret_access_key: System.get_env("AWS_SECRET_ACCESS_KEY")
    ]
  ],
  indexes: %{
    food_items: %{
      settings: "priv/elasticsearch/food_items.json",
      store: EfAPI.ElasticsearchStore,
      sources: [EfAPI.Data.FoodItem],
      bulk_page_size: 5000,
      bulk_wait_interval: 0
    }
  }

and I just get

** (Mix) Could not start application ef_api: EfAPI.Application.start(:normal, []) returned an error: shutdown: failed to start child: EfAPI.ElasticsearchCluster
    ** (EXIT) %{api: [{"must be valid", [validation: :by]}]}

I've tried taking out the url, removing the default_options without much luck. Any help is appreciated! (I'm not using a local ES instance yet, just one on AWS)

@marcelolebre
Copy link
Contributor Author

@ksherman did you update with the last version?

@marcelolebre
Copy link
Contributor Author

Also, your vars are incorrect:

access_key_id -> access_key
secret_access_key -> secret

@ksherman
Copy link

ksherman commented Apr 6, 2019

Ha, silly me, fixed that. I copied that block from ex_aws :P

I think I have the latest, I just added it to the project yesterday. Looking through the files in deps, the changelog.md doesn't match what's in the repo, so I guess I'm not totally sure its the most current version?

@ksherman
Copy link

ksherman commented Apr 6, 2019

I think I have it,

d0348e4#diff-6023be6004fce4718dad3dafb576d258R64

sigaws is optional in the dependencies but d0348e4#diff-19703e7a50e851dc833748d4764eb07bR1 wrapped it in a conditional expecting that dependency?

adding sigaws seems to have got it working!

danielberkompas added a commit that referenced this issue Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants