CARVIEW |
Select Language
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 3013
Connection: keep-alive
Date: Wed, 30 Jul 2025 18:16:17 GMT
Content-Encoding: gzip
Server: Server
Cache-Control: no-store, no-cache, must-revalidate
Expires: Thu, 01 Jan 1970 00:00:00 GMT
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=47304000; includeSubDomains
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Content-Type-Options: nosniff
Content-Security-Policy: upgrade-insecure-requests; script-src 'self' 'unsafe-inline' *.awsstatic.com *.cdn.uis.awsstatic.com *.cdn.console.awsstatic.com d2c.aws.amazon.com a0.awsstatic.com *.feedback.console.aws.dev insights.docs.aws.com wss://insights.docs.aws.com/prod; object-src 'none';
Last-Modified: Wed, 21 May 2025 18:05:34 GMT
Accept-Ranges: bytes
ETag: "DWpVjyKB2kfEQqOrb8ohMP30oug=-gzip"
Vary: Accept-Encoding
X-Cache: Miss from cloudfront
Via: 1.1 7d1975e97f05a3fc47c8f5eea10222bc.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: BOM78-P5
X-Amz-Cf-Id: xpntI128MHQqQngyA6vfdcl4I9pLRSiCJ3uBE_ptPKzDEMyIBOH_rw==
Class: Aws::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
- Object
- Aws::AssumeRoleCredentials
- 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
-
#client ⇒ STS::Client
readonly
Attributes included from CredentialProvider
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ AssumeRoleCredentials
constructor
A new instance of AssumeRoleCredentials.
Methods included from CredentialProvider
#access_key_id, #secret_access_key, #session_token, #set?
Constructor Details
#initialize(options = {}) ⇒ AssumeRoleCredentials
Returns a new instance of AssumeRoleCredentials.
Parameters:
-
options
(Hash)
(defaults to: {})
—
a customizable set of options
Options Hash (options):
- :role_arn (required, String)
- :role_session_name (required, String)
- :policy (String)
- :duration_seconds (Integer)
- :external_id (String)
- :client (STS::Client)
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
#client ⇒ STS::Client (readonly)
Returns:
44 45 46 |
# File 'aws-sdk-core/lib/aws-sdk-core/assume_role_credentials.rb', line 44 def client @client end |
Generated on Fri Feb 21 17:25:47 2025 by
yard
0.9.34 (ruby-2.7.8).