diff --git a/bin/rebi b/bin/rebi index c791fc9..d5567f2 100755 --- a/bin/rebi +++ b/bin/rebi @@ -125,6 +125,7 @@ command :init do |c| raise Rebi::Error.new("Stage cannot be nil") if stage.blank? raise Rebi::Error.new("Env cannot be blank") if env.blank? + Rebi.config.reload! Rebi.init stage, env end end diff --git a/lib/rebi/config.rb b/lib/rebi/config.rb index 25839e7..1e12d66 100644 --- a/lib/rebi/config.rb +++ b/lib/rebi/config.rb @@ -28,6 +28,10 @@ def aws_secret data[:aws_secret] || ENV["AWS_SECRET_ACCESS_KEY"] end + def aws_session_token + ENV["AWS_SESSION_TOKEN"] + end + def region data[:region] end @@ -114,7 +118,7 @@ def set_aws_config }) elsif aws_secret && aws_key conf.merge!( - credentials: Aws::Credentials::new(aws_key, aws_secret) + credentials: Aws::Credentials::new(aws_key, aws_secret, aws_session_token) ) end