Last active
July 18, 2024 14:35
-
-
Save cktricky/127be4e431563a986f0f 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