DEV Community

Zaw Htut Win
Zaw Htut Win

Posted on

This Gem is on 🔥🔥 (for AWS signature v4)

If you follow the AWS documentation for signature v4 signing process, you know it requires you to going through alot of steps. 😨

Finally I found faraday_middleware-aws-sigv4 gem.

For me it's a live-saver. 💖

conn = API_BASE_URL) do |faraday|
    faraday.request :aws_signers_v4,
         credentials:["access_key_id"], response["secret_key"], response["session_token"]),
          service_name: 'execute-api',
          region: 'us-east-1'
  faraday.adapter Faraday.default_adapter
puts conn.headers
response ='/orders') do |req|
    req.headers['Content-Type'] = 'application/json'
puts response.body
Enter fullscreen mode Exit fullscreen mode

Top comments (0)