Documentation

InstanceProfileProvider
in package

Credential provider that provides credentials from the EC2 metadata service.

Table of Contents

CRED_PATH  = 'meta-data/iam/security-credentials/'
ENV_DISABLE  = 'AWS_EC2_METADATA_DISABLED'
ENV_RETRIES  = 'AWS_METADATA_SERVICE_NUM_ATTEMPTS'
ENV_TIMEOUT  = 'AWS_METADATA_SERVICE_TIMEOUT'
SERVER_URI  = 'http://169.254.169.254/latest/'
TOKEN_PATH  = 'api/token'
$attempts  : int
$client  : callable
$profile  : string
$retries  : int
$secureMode  : bool
$timeout  : float|mixed
__construct()  : mixed
The constructor accepts the following options:
__invoke()  : PromiseInterface
Loads instance profile credentials.
createErrorMessage()  : mixed
decodeResult()  : mixed
getExceptionStatusCode()  : mixed
handleRetryableException()  : mixed
request()  : PromiseInterface

Constants

Properties

Methods

__construct()

The constructor accepts the following options:

public __construct([array<string|int, mixed> $config = [] ]) : mixed
  • timeout: Connection timeout, in seconds.
  • profile: Optional EC2 profile name, if known.
  • retries: Optional number of retries to be attempted.
Parameters
$config : array<string|int, mixed> = []

Configuration options.

Return values
mixed

createErrorMessage()

private createErrorMessage(mixed $previous) : mixed
Parameters
$previous : mixed
Return values
mixed

decodeResult()

private decodeResult(mixed $response) : mixed
Parameters
$response : mixed
Return values
mixed

getExceptionStatusCode()

private getExceptionStatusCode(Exception $e) : mixed
Parameters
$e : Exception
Return values
mixed

handleRetryableException()

private handleRetryableException(Exception $e, mixed $retryOptions, mixed $message) : mixed
Parameters
$e : Exception
$retryOptions : mixed
$message : mixed
Return values
mixed

request()

private request(string $url[, string $method = 'GET' ][, array<string|int, mixed> $headers = [] ]) : PromiseInterface
Parameters
$url : string
$method : string = 'GET'
$headers : array<string|int, mixed> = []
Return values
PromiseInterface

Returns a promise that is fulfilled with the body of the response as a string.

Search results