From e35a0e1a8df306b7879b8f44c52aeac8c1a62976 Mon Sep 17 00:00:00 2001 From: Anuj Biyani Date: Thu, 30 May 2013 14:10:42 -0700 Subject: [PATCH] aws access key and secret key default to environment variables --- aws-ha-release/aws-ha-release.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws-ha-release/aws-ha-release.rb b/aws-ha-release/aws-ha-release.rb index 8b1512b..78d2d36 100755 --- a/aws-ha-release/aws-ha-release.rb +++ b/aws-ha-release/aws-ha-release.rb @@ -20,3 +20,8 @@ end Trollop::die :as_group_name, 'You must specify the AutoScaling Group Name: aws-ha-release.rb -a ' unless opts[:as_group_name] Trollop::die :aws_access_key, 'If you specify the AWS Secret Key, you must also specify the Access Key with -o .' if opts[:aws_secret_key] && opts[:aws_access_key].nil? Trollop::die :aws_secret_key, 'If you specify the AWS Access Key, you must also specify the Secret Key with -s .' if opts[:aws_access_key] && opts[:aws_secret_key].nil? + +if opts[:aws_access_key].nil? || opts[:aws_secret_key].nil? + opts[:aws_access_key] = ENV['AWS_ACCESS_KEY'] + opts[:aws_secret_key] = ENV['AWS_SECRET_KEY'] +end