lib/heirloom/cli/shared.rb in heirloom-0.11.0.beta.2 vs lib/heirloom/cli/shared.rb in heirloom-0.11.0
- old
+ new
@@ -7,10 +7,11 @@
logger = args[:logger]
config = Config.new :logger => logger, :environment => opts[:environment]
config.access_key = opts[:aws_access_key] if opts[:aws_access_key]
config.secret_key = opts[:aws_secret_key] if opts[:aws_secret_key]
config.metadata_region = opts[:metadata_region] if opts[:metadata_region]
+ config.use_iam_profile = opts[:use_iam_profile] if opts[:use_iam_profile]
config
end
def ensure_valid_secret(args)
config = args[:config]
@@ -26,11 +27,13 @@
provided = args[:provided]
required = args[:required]
config = args[:config]
logger = config.logger
- required << :aws_access_key unless config.access_key
- required << :aws_secret_key unless config.secret_key
+ unless config.use_iam_profile
+ required << :aws_access_key unless config.access_key
+ required << :aws_secret_key unless config.secret_key
+ end
missing_opts = required.sort.map do |opt|
case provided[opt]
when nil, []
pretty_opt = opt.to_s.gsub('_', '-')