Code Monkey home page Code Monkey logo

aws-es-curl's Introduction

aws-es-curl

Simple curl-like utility with V4 request signing support for AWS Elasticsearch Service.

Install

npm install aws-es-curl -g

Prequisities

  • Make sure your Elasticsearch domain is configured with access policy template "Allow or deny access to one or more AWS accounts or IAM users".
  • Make sure your IAM credentials are discoverable:
    • via environment variables AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
    • via aws-cli authentication profile (defaults to profile default)
    • via instance profile on EC2 instance (with IAM role granting access to ES domain)

Usage

aws-es-curl tries to figure out right set of credentials to use automatically. If credentials are not set through env variables, nor authentication profile is specified, it tries to fetch credentials from EC2 metadata service. This causes unneeded delay on development environment when default settings are used, because metadata call will fail after couple of attempts. If this is a problem, just specify profile or credentials via environment and the call will be skipped.

Simple search from AWS Elasticsearch domain.

$ aws-es-curl -X GET http://domain-search-jkewre3423432kfdsax.eu-west-1.es.amazonaws.com/_search

Specify local AWS CLI profile via AWS_PROFILE environment variable or using --profile <profile_name> option.

$ aws-es-curl --profile another-local-aws-profile http://domain-search-jkewre3423432kfdsax.eu-west-1.es.amazonaws.com/_search
$ AWS_PROFILE=another-local-aws-profile aws-es-curl http://domain-search-jkewre3423432kfdsax.eu-west-1.es.amazonaws.com/_search

Pipe queries to ElasticSearch.

$ echo '{ "size": 0, "aggs": { "types": { "term": { "field": "_type" } } } }' | aws-es-curl -X POST http://domain-search-jkewre3423432kfdsax.eu-west-1.es.amazonaws.com/_search

Related

aws-es-curl's People

Contributors

jenseng avatar joona avatar kaibadash avatar seansith avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.