Sha256: 23259f78c51d14e21597f2081d3a2d6198ded5324c8a0752df646da6e7632037
Contents?: true
Size: 690 Bytes
Versions: 12
Compression:
Stored size: 690 Bytes
Contents
module AwsMfaSecure class Exports < Base def initialize(options={}) @options = options @aws_profile = aws_profile end def run unless iam_mfa? $stderr.puts "WARN: mfa_serial is not configured for this AWS_PROFILE=#{@aws_profile}" return end if fetch_creds? resp = get_session_token save_creds(resp.credentials.to_h) end puts script end def script <<~EOL export AWS_ACCESS_KEY_ID=#{credentials["access_key_id"]} export AWS_SECRET_ACCESS_KEY=#{credentials["secret_access_key"]} export AWS_SESSION_TOKEN=#{credentials["session_token"]} EOL end end end
Version data entries
12 entries across 12 versions & 1 rubygems