{"id":997,"date":"2015-10-04T17:00:12","date_gmt":"2015-10-04T17:00:12","guid":{"rendered":"https:\/\/gosqeng.test\/?p=997"},"modified":"2019-11-28T11:43:35","modified_gmt":"2019-11-28T11:43:35","slug":"elasticsearch-js-connector-for-amazon-es","status":"publish","type":"post","link":"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es","title":{"rendered":"elasticsearch-js connector for Amazon ES"},"content":{"rendered":"<p><a href=\"https:\/\/github.com\/TheDeveloper\/http-aws-es\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"http:\/\/static.gosquared.com.s3.amazonaws.com\/images\/engineering\/15_10_04_http_aws_es.png\" \/><\/a><\/p>\n<p>We were thrilled to see AWS launch Amazon Elasticsearch this week, a hosted Elasticsearch service built right into AWS. We&#8217;re running a large ES cluster on EC2 already, so we&#8217;re keen to see how Amazon ES could save us time and effort managing Elasticsearch.<\/p>\n<p>We use the <a href=\"https:\/\/github.com\/elastic\/elasticsearch-js\" target=\"_blank\" rel=\"noopener noreferrer\">elasticsearch-js<\/a> module to communicate with the ES API from our Node.js services. Naturally I wanted to use the same module with Amazon ES, but it doesn&#8217;t quite work out of the box.<\/p>\n<p>HTTP requests to AWS APIs need to be signed using an access key and secret key and this too applies to the Elasticsearch endpoint provided when you create a cluster with Amazon ES. So if you want to use elasticsearch-js with Amazon ES, you need to use a connector to handle authentication.<\/p>\n<p>I couldn&#8217;t find any connectors, so I created one: http-aws-es on <a href=\"https:\/\/www.npmjs.com\/package\/http-aws-es\" target=\"_blank\" rel=\"noopener noreferrer\">NPM<\/a> and <a href=\"https:\/\/github.com\/TheDeveloper\/http-aws-es\" target=\"_blank\" rel=\"noopener noreferrer\">Github<\/a>.<\/p>\n<p>Hope you find it useful!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We were thrilled to see AWS launch Amazon Elasticsearch this week, a hosted Elasticsearch service built right into AWS. We&#8217;re&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1452],"tags":[93],"class_list":["post-997","post","type-post","status-publish","format-standard","hentry","category-engineering","tag-amazon"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v18.6 (Yoast SEO v19.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>elasticsearch-js connector for Amazon ES - GoSquared Blog<\/title>\n<meta name=\"description\" content=\"Use elasticsearch-js with Amazon ES\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"elasticsearch-js connector for Amazon ES\" \/>\n<meta property=\"og:description\" content=\"Use elasticsearch-js with Amazon ES\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es\" \/>\n<meta property=\"og:site_name\" content=\"GoSquared Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GoSquared\" \/>\n<meta property=\"article:published_time\" content=\"2015-10-04T17:00:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-11-28T11:43:35+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/static.gosquared.com.s3.amazonaws.com\/images\/engineering\/15_10_04_http_aws_es.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@TheDeveloper\" \/>\n<meta name=\"twitter:site\" content=\"@GoSquared\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Geoff Wagstaff\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/#organization\",\"name\":\"GoSquared\",\"url\":\"https:\/\/www.gosquared.com\/blog\/\",\"sameAs\":[\"https:\/\/instagram.com\/gosquaredteam\",\"https:\/\/www.linkedin.com\/company\/go-squared-ltd.\",\"https:\/\/www.facebook.com\/GoSquared\",\"https:\/\/twitter.com\/GoSquared\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.gosquared.com\/blog\/wp-content\/uploads\/2015\/07\/gosquared.png\",\"contentUrl\":\"https:\/\/www.gosquared.com\/blog\/wp-content\/uploads\/2015\/07\/gosquared.png\",\"width\":1270,\"height\":250,\"caption\":\"GoSquared\"},\"image\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/#website\",\"url\":\"https:\/\/www.gosquared.com\/blog\/\",\"name\":\"GoSquared Blog\",\"description\":\"Turn visitors into customers.\",\"publisher\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.gosquared.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#primaryimage\",\"url\":\"http:\/\/static.gosquared.com.s3.amazonaws.com\/images\/engineering\/15_10_04_http_aws_es.png\",\"contentUrl\":\"http:\/\/static.gosquared.com.s3.amazonaws.com\/images\/engineering\/15_10_04_http_aws_es.png\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#webpage\",\"url\":\"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es\",\"name\":\"elasticsearch-js connector for Amazon ES - GoSquared Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#primaryimage\"},\"datePublished\":\"2015-10-04T17:00:12+00:00\",\"dateModified\":\"2019-11-28T11:43:35+00:00\",\"description\":\"Use elasticsearch-js with Amazon ES\",\"breadcrumb\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.gosquared.com\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"elasticsearch-js connector for Amazon ES\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#webpage\"},\"author\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/56a3341790c8a0603f96066fb8d42448\"},\"headline\":\"elasticsearch-js connector for Amazon ES\",\"datePublished\":\"2015-10-04T17:00:12+00:00\",\"dateModified\":\"2019-11-28T11:43:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#webpage\"},\"wordCount\":156,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#primaryimage\"},\"thumbnailUrl\":\"http:\/\/static.gosquared.com.s3.amazonaws.com\/images\/engineering\/15_10_04_http_aws_es.png\",\"keywords\":[\"Amazon\"],\"articleSection\":[\"Engineering\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/56a3341790c8a0603f96066fb8d42448\",\"name\":\"Geoff Wagstaff\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/66792d2e4d04406697b9a5f322664691590a386bc15b7146d143bbca07aa8889?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/66792d2e4d04406697b9a5f322664691590a386bc15b7146d143bbca07aa8889?s=96&d=mm&r=g\",\"caption\":\"Geoff Wagstaff\"},\"sameAs\":[\"https:\/\/twitter.com\/TheDeveloper\"],\"url\":\"https:\/\/www.gosquared.com\/blog\/author\/echo\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"elasticsearch-js connector for Amazon ES - GoSquared Blog","description":"Use elasticsearch-js with Amazon ES","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es","og_locale":"en_US","og_type":"article","og_title":"elasticsearch-js connector for Amazon ES","og_description":"Use elasticsearch-js with Amazon ES","og_url":"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es","og_site_name":"GoSquared Blog","article_publisher":"https:\/\/www.facebook.com\/GoSquared","article_published_time":"2015-10-04T17:00:12+00:00","article_modified_time":"2019-11-28T11:43:35+00:00","og_image":[{"url":"http:\/\/static.gosquared.com.s3.amazonaws.com\/images\/engineering\/15_10_04_http_aws_es.png"}],"twitter_card":"summary_large_image","twitter_creator":"@TheDeveloper","twitter_site":"@GoSquared","twitter_misc":{"Written by":"Geoff Wagstaff","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/www.gosquared.com\/blog\/#organization","name":"GoSquared","url":"https:\/\/www.gosquared.com\/blog\/","sameAs":["https:\/\/instagram.com\/gosquaredteam","https:\/\/www.linkedin.com\/company\/go-squared-ltd.","https:\/\/www.facebook.com\/GoSquared","https:\/\/twitter.com\/GoSquared"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gosquared.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.gosquared.com\/blog\/wp-content\/uploads\/2015\/07\/gosquared.png","contentUrl":"https:\/\/www.gosquared.com\/blog\/wp-content\/uploads\/2015\/07\/gosquared.png","width":1270,"height":250,"caption":"GoSquared"},"image":{"@id":"https:\/\/www.gosquared.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"WebSite","@id":"https:\/\/www.gosquared.com\/blog\/#website","url":"https:\/\/www.gosquared.com\/blog\/","name":"GoSquared Blog","description":"Turn visitors into customers.","publisher":{"@id":"https:\/\/www.gosquared.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.gosquared.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#primaryimage","url":"http:\/\/static.gosquared.com.s3.amazonaws.com\/images\/engineering\/15_10_04_http_aws_es.png","contentUrl":"http:\/\/static.gosquared.com.s3.amazonaws.com\/images\/engineering\/15_10_04_http_aws_es.png"},{"@type":"WebPage","@id":"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#webpage","url":"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es","name":"elasticsearch-js connector for Amazon ES - GoSquared Blog","isPartOf":{"@id":"https:\/\/www.gosquared.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#primaryimage"},"datePublished":"2015-10-04T17:00:12+00:00","dateModified":"2019-11-28T11:43:35+00:00","description":"Use elasticsearch-js with Amazon ES","breadcrumb":{"@id":"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.gosquared.com\/blog"},{"@type":"ListItem","position":2,"name":"elasticsearch-js connector for Amazon ES"}]},{"@type":"Article","@id":"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#article","isPartOf":{"@id":"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#webpage"},"author":{"@id":"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/56a3341790c8a0603f96066fb8d42448"},"headline":"elasticsearch-js connector for Amazon ES","datePublished":"2015-10-04T17:00:12+00:00","dateModified":"2019-11-28T11:43:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#webpage"},"wordCount":156,"commentCount":4,"publisher":{"@id":"https:\/\/www.gosquared.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#primaryimage"},"thumbnailUrl":"http:\/\/static.gosquared.com.s3.amazonaws.com\/images\/engineering\/15_10_04_http_aws_es.png","keywords":["Amazon"],"articleSection":["Engineering"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.gosquared.com\/blog\/elasticsearch-js-connector-for-amazon-es#respond"]}]},{"@type":"Person","@id":"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/56a3341790c8a0603f96066fb8d42448","name":"Geoff Wagstaff","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/66792d2e4d04406697b9a5f322664691590a386bc15b7146d143bbca07aa8889?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/66792d2e4d04406697b9a5f322664691590a386bc15b7146d143bbca07aa8889?s=96&d=mm&r=g","caption":"Geoff Wagstaff"},"sameAs":["https:\/\/twitter.com\/TheDeveloper"],"url":"https:\/\/www.gosquared.com\/blog\/author\/echo"}]}},"wps_subtitle":"Use elasticsearch-js with Amazon ES","_links":{"self":[{"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/posts\/997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/comments?post=997"}],"version-history":[{"count":0,"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/posts\/997\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/media?parent=997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/categories?post=997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/tags?post=997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}