-
-
Save failshell/09e492492e65f440d5837ff9fcdf1104 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'aws-sdk-core' | |
require 'uri' | |
uri = URI('https://rds.amazonaws.com/v13/downloadCompleteLogFile/some_server/general/mysql-general.log.0') | |
credentials = Aws::Credentials.new('secret', 'secret') | |
signer = Aws::Signers::V4.new(credentials, 'rds', 'us-east-1') | |
req = Seahorse::Client::Http::Request.new(endpoint: uri) | |
signed_req = signer.sign(req) | |
authorization = signed_req.headers['authorization'] | |
x_amz_date = signed_req.headers['x-amz-date'] | |
puts `curl -v -H 'Authorization: #{authorization}' -H 'X-Amz-Date: #{x_amz_date}' https://rds.amazonaws.com/v13/downloadCompleteLogFile/some_server/general/mysql-general.log.0` |
Author
failshell
commented
Apr 11, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment