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

#include <AWSCredentialsProvider.h>

+ Inheritance diagram for Aws::Auth::TaskRoleCredentialsProvider:

Public Member Functions

 TaskRoleCredentialsProvider (const char *resourcePath, long refreshRateMs=REFRESH_THRESHOLD)
 
 TaskRoleCredentialsProvider (const char *endpoint, const char *token, long refreshRateMs=REFRESH_THRESHOLD)
 
 TaskRoleCredentialsProvider (const std::shared_ptr< Aws::Internal::ECSCredentialsClient > &client, long refreshRateMs=REFRESH_THRESHOLD)
 
AWSCredentials GetAWSCredentials () override
 
- Public Member Functions inherited from Aws::Auth::AWSCredentialsProvider
 AWSCredentialsProvider ()
 
virtual ~AWSCredentialsProvider ()=default
 

Protected Member Functions

void Reload () override
 
- 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

ECS credentials provider implementation that loads credentials from the Amazon ECS metadata service or an arbitrary endpoint.

Definition at line 230 of file AWSCredentialsProvider.h.

Constructor & Destructor Documentation

◆ TaskRoleCredentialsProvider() [1/3]

Aws::Auth::TaskRoleCredentialsProvider::TaskRoleCredentialsProvider ( const char *  resourcePath,
long  refreshRateMs = REFRESH_THRESHOLD 
)

Initializes the provider to retrieve credentials from the ECS metadata service every 5 minutes, or before it expires.

Parameters
resourcePathA path appended to the metadata service endpoint.
refreshRateMsThe number of milliseconds after which the credentials will be fetched again.

◆ TaskRoleCredentialsProvider() [2/3]

Aws::Auth::TaskRoleCredentialsProvider::TaskRoleCredentialsProvider ( const char *  endpoint,
const char *  token,
long  refreshRateMs = REFRESH_THRESHOLD 
)

Initializes the provider to retrieve credentials from a provided endpoint every 5 minutes or before it expires.

Parameters
endpointThe full URI to resolve to get credentials.
tokenAn optional authorization token passed to the URI via the 'Authorization' HTTP header.
refreshRateMsThe number of milliseconds after which the credentials will be fetched again.

◆ TaskRoleCredentialsProvider() [3/3]

Aws::Auth::TaskRoleCredentialsProvider::TaskRoleCredentialsProvider ( const std::shared_ptr< Aws::Internal::ECSCredentialsClient > &  client,
long  refreshRateMs = REFRESH_THRESHOLD 
)

Initializes the provider to retrieve credentials using the provided client.

Parameters
clientThe ECSCredentialsClient instance to use when retrieving credentials.
refreshRateMsThe number of milliseconds after which the credentials will be fetched again.

Member Function Documentation

◆ GetAWSCredentials()

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

Retrieves the credentials if found, otherwise returns empty credential set.

Implements Aws::Auth::AWSCredentialsProvider.

◆ Reload()

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

Reimplemented from Aws::Auth::AWSCredentialsProvider.


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