Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Sign requests to get access to a role-controlled AWS elasticsearch
require 'aws-sdk'
require 'faraday_middleware'
require 'faraday_middleware/aws_signers_v4'
require 'pp'
conn = 'http://ENDPOINT') do |faraday|
faraday.request :aws_signers_v4,
service_name: 'es',
region: 'REGION'
faraday.response :json, :content_type => /\bjson\b/
faraday.response :raise_error
faraday.adapter Faraday.default_adapter
res = conn.get '/'
pp res.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.