AWS SDK for C++  1.8.59
AWS SDK for C++
Public Member Functions | Protected Member Functions | List of all members
Aws::Auth::STSProfileCredentialsProvider Class Reference

#include <STSProfileCredentialsProvider.h>

+ Inheritance diagram for Aws::Auth::STSProfileCredentialsProvider:

Public Member Functions

 STSProfileCredentialsProvider ()
 
 STSProfileCredentialsProvider (const Aws::String &profileName, std::chrono::minutes duration=std::chrono::minutes(60))
 
 STSProfileCredentialsProvider (const Aws::String &profileName, std::chrono::minutes duration, const std::function< Aws::STS::STSClient *(const AWSCredentials &)> &stsClientFactory)
 
AWSCredentials GetAWSCredentials () override
 
- Public Member Functions inherited from Aws::Auth::AWSCredentialsProvider
 AWSCredentialsProvider ()
 
virtual ~AWSCredentialsProvider ()=default
 

Protected Member Functions

void RefreshIfExpired ()
 
void Reload () override
 
AWSCredentials GetCredentialsFromSTS (const AWSCredentials &credentials, const Aws::String &roleARN)
 
- Protected Member Functions inherited from Aws::Auth::AWSCredentialsProvider
virtual bool IsTimeToRefresh (long reloadFrequency)
 

Additional Inherited Members

- Protected Attributes inherited from Aws::Auth::AWSCredentialsProvider
Aws::Utils::Threading::ReaderWriterLock m_reloadLock
 

Detailed Description

Credentials provider for STS Assume Role using the information in the shared config file. The shared configuration file is typically created using the AWS CLI and is located in: ~/.aws/config The location of the file can also be controlled via environment variables. For more information see https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html

Definition at line 30 of file STSProfileCredentialsProvider.h.

Constructor & Destructor Documentation

◆ STSProfileCredentialsProvider() [1/3]

Aws::Auth::STSProfileCredentialsProvider::STSProfileCredentialsProvider ( )

Use the default profile name. The default profile name can be set using environment variables; otherwise it is the literal "default".

◆ STSProfileCredentialsProvider() [2/3]

Aws::Auth::STSProfileCredentialsProvider::STSProfileCredentialsProvider ( const Aws::String profileName,
std::chrono::minutes  duration = std::chrono::minutes(60) 
)

Use the provided profile name from the shared configuration file.

Parameters
profileNameThe name of the profile in the shared configuration file.
durationThe duration, in minutes, of the role session, after which the credentials are expired. The value can range from 15 minutes up to the maximum session duration setting for the role. By default, the duration is set to 1 hour. Note: This credential provider refreshes the credentials 5 minutes before their expiration time. That ensures the credentials do not expire between the time they're checked and the time they're returned to the user. If the duration for the credentials is 5 minutes or less, the provider will refresh the credentials only when they expire.

◆ STSProfileCredentialsProvider() [3/3]

Aws::Auth::STSProfileCredentialsProvider::STSProfileCredentialsProvider ( const Aws::String profileName,
std::chrono::minutes  duration,
const std::function< Aws::STS::STSClient *(const AWSCredentials &)> &  stsClientFactory 
)

Member Function Documentation

◆ GetAWSCredentials()

AWSCredentials Aws::Auth::STSProfileCredentialsProvider::GetAWSCredentials ( )
overridevirtual

Fetches the credentials set from STS following the rules defined in the shared configuration file.

Implements Aws::Auth::AWSCredentialsProvider.

◆ GetCredentialsFromSTS()

AWSCredentials Aws::Auth::STSProfileCredentialsProvider::GetCredentialsFromSTS ( const AWSCredentials credentials,
const Aws::String roleARN 
)
protected

Assumes a role given its ARN. Communication with STS is done through the provided credentials. Returns the assumed role credentials or empty credentials on error.

◆ RefreshIfExpired()

void Aws::Auth::STSProfileCredentialsProvider::RefreshIfExpired ( )
protected

◆ Reload()

void Aws::Auth::STSProfileCredentialsProvider::Reload ( )
overrideprotectedvirtual

Reimplemented from Aws::Auth::AWSCredentialsProvider.


The documentation for this class was generated from the following file: