-
-
Save rodolfobandeira/95a4900d3c022c33fccf36b518aa12bd 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' | |
sts = Aws::STS::Client.new( | |
region: 'us-east-1', | |
access_key_id: "<insert access key id>", | |
secret_access_key: "<secret>" | |
) | |
cred = sts.get_session_token({ | |
:serial_number=> "<Insert Serial Number of MFA Devise, ex: arn:aws:iam::1234567890:mfa/[email protected]>", | |
:token_code => "<insert mfa token>", | |
:duration_seconds=>3600 | |
}) | |
puts "Access Key ID: " + cred.credentials.access_key_id | |
puts "Secret Access Key: " + cred.credentials.secret_access_key | |
puts "Session Token: " + cred.credentials.session_token |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment