class Aws::AssumeRoleCredentials
constructed.
If you omit ‘:client` option, a new {STS::Client} object will be
ec2 = Aws::EC2::Client.new(credentials: role_credentials)
)
role_session_name: “session-name”
role_arn: “linked::account::arn”,
client: Aws::STS::Client.new(…),
role_credentials = Aws::AssumeRoleCredentials.new(
a role via {Aws::STS::Client#assume_role}.
An auto-refreshing credential provider that works by assuming
def initialize(options = {})
(**opitons)
-
:client
(STS::Client
) -- -
:external_id
(String
) -- -
:duration_seconds
(Integer
) -- -
:policy
(String
) -- -
:role_session_name
(required, String
) -- -
:role_arn
(required, String
) --
def initialize(options = {}) @options = options.dup @client = @options.delete(:client) || STS::Client.new super end
def refresh
def refresh c = @client.assume_role(@options).credentials @credentials = Credentials.new( c.access_key_id, c.secret_access_key, c.session_token ) @expiration = c.expiration end