A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.aws.amazon.com/sdkforruby/api/Aws/AssumeRoleCredentials.html below:

AssumeRoleCredentials — AWS SDK for Ruby V2

You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::AssumeRoleCredentials
Inherits:
Object show all
Includes:
CredentialProvider
Defined in:
aws-sdk-core/lib/aws-sdk-core/assume_role_credentials.rb
Overview

An auto-refreshing credential provider that works by assuming a role via STS::Client#assume_role.

role_credentials = Aws::AssumeRoleCredentials.new(
  client: Aws::STS::Client.new(...),
  role_arn: "linked::account::arn",
  role_session_name: "session-name"
)

ec2 = Aws::EC2::Client.new(credentials: role_credentials)

If you omit :client option, a new STS::Client object will be constructed.

Instance Attribute Summary collapse Attributes included from CredentialProvider

#credentials

Instance Method Summary collapse Methods included from CredentialProvider

#access_key_id, #secret_access_key, #session_token, #set?

Constructor Details #initialize(options = {}) ⇒ AssumeRoleCredentials

Returns a new instance of AssumeRoleCredentials.

29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'aws-sdk-core/lib/aws-sdk-core/assume_role_credentials.rb', line 29

def initialize(options = {})
  client_opts = {}
  @assume_role_params = {}
  options.each_pair do |key, value|
    if self.class.assume_role_options.include?(key)
      @assume_role_params[key] = value
    else
      client_opts[key] = value
    end
  end
  @client = client_opts[:client] || STS::Client.new(client_opts)
  super
end
Instance Attribute Details #clientSTS::Client
44
45
46
# File 'aws-sdk-core/lib/aws-sdk-core/assume_role_credentials.rb', line 44

def client
  @client
end

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4