Simple curl-like utility with request signing support for AWS ElasticSearch Service
Simple curl
-like utility with V4 request signing support for AWS Elasticsearch Service.
npm install aws-es-curl -g
AWS_ACCESS_KEY_ID
, AWS_SECRET_ACCESS_KEY
aws-cli
authentication profile (defaults to profile default
)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