Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
refer credentials from assume-role
Browse files Browse the repository at this point in the history
  • Loading branch information
diceku committed Mar 8, 2019
1 parent fa4962e commit 64ca803
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions bin/rebi
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion lib/rebi/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 64ca803

Please sign in to comment.