SDK for PHP 3.x

EcsCredentialProvider
in package

Credential provider that fetches container credentials with GET request.

container environment variables are used in constructing request URI.

Table of Contents

Constants

DEFAULT_ENV_RETRIES  = 3
DEFAULT_ENV_TIMEOUT  = 1.0
EKS_SERVER_HOST_IPV4  = '169.254.170.23'
EKS_SERVER_HOST_IPV6  = 'fd00:ec2::23'
ENV_AUTH_TOKEN  = "AWS_CONTAINER_AUTHORIZATION_TOKEN"
ENV_AUTH_TOKEN_FILE  = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE"
ENV_FULL_URI  = "AWS_CONTAINER_CREDENTIALS_FULL_URI"
ENV_RETRIES  = 'AWS_METADATA_SERVICE_NUM_ATTEMPTS'
ENV_TIMEOUT  = 'AWS_METADATA_SERVICE_TIMEOUT'
ENV_URI  = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"
SERVER_URI  = 'http://169.254.170.2'

Methods

__construct()  : mixed
The constructor accepts following options: - timeout: (optional) Connection timeout, in seconds, default 1.0 - retries: Optional number of retries to be attempted, default 3.
__invoke()  : PromiseInterface
Load container credentials.
getAttempts()  : int
Returns the number of attempts that have been done.
setHeaderForAuthToken()  : mixed

Constants

DEFAULT_ENV_RETRIES

public mixed DEFAULT_ENV_RETRIES = 3

DEFAULT_ENV_TIMEOUT

public mixed DEFAULT_ENV_TIMEOUT = 1.0

EKS_SERVER_HOST_IPV4

public mixed EKS_SERVER_HOST_IPV4 = '169.254.170.23'

EKS_SERVER_HOST_IPV6

public mixed EKS_SERVER_HOST_IPV6 = 'fd00:ec2::23'

ENV_AUTH_TOKEN

public mixed ENV_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"

ENV_AUTH_TOKEN_FILE

public mixed ENV_AUTH_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE"

ENV_FULL_URI

public mixed ENV_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"

ENV_RETRIES

public mixed ENV_RETRIES = 'AWS_METADATA_SERVICE_NUM_ATTEMPTS'

ENV_TIMEOUT

public mixed ENV_TIMEOUT = 'AWS_METADATA_SERVICE_TIMEOUT'

ENV_URI

public mixed ENV_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"

SERVER_URI

public mixed SERVER_URI = 'http://169.254.170.2'

Methods

__construct()

The constructor accepts following options: - timeout: (optional) Connection timeout, in seconds, default 1.0 - retries: Optional number of retries to be attempted, default 3.

public __construct([array<string|int, mixed> $config = [] ]) : mixed
  • client: An EcsClient to make request from
Parameters
$config : array<string|int, mixed> = []

Configuration options

getAttempts()

Returns the number of attempts that have been done.

public getAttempts() : int
Return values
int

setHeaderForAuthToken()

public setHeaderForAuthToken() : mixed
Tags
deprecated
On this page