Sha256: f05d9bb992ea171eefefa8a10f6db55eacdc824b92d8bac0fbedca252b1c6b33
Contents?: true
Size: 802 Bytes
Versions: 1
Compression:
Stored size: 802 Bytes
Contents
module AwsRotate class Base include AwsServices def initialize(options={}) @options = options @config_path = options[:config] || "#{ENV['HOME']}/.aws/config" @credentials_path = options[:credentials] || "#{ENV['HOME']}/.aws/credentials" @profile = ENV['AWS_PROFILE'] || default_profile end private def default_profile if ENV['AWS_PROFILE'].nil? lines = IO.readlines(@credentials_path) default_found = lines.detect { |l| l =~ /\[default\]/ } 'default' else abort("AWS_PROFILE must be set") end end def sh(command) # no puts so we dont puts out the secret key value # puts "=> #{command}" # uncomment to debug success = system(command) raise unless success end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
aws-rotate-0.1.0 | lib/aws_rotate/base.rb |