The container credential provider fetches credentials for customer’s containerized application. This credential provider is useful for Amazon Elastic Container Service (Amazon ECS) and Amazon Elastic Kubernetes Service (Amazon EKS) customers. SDKs attempt to load credentials from the specified HTTP endpoint through a GET request.
API
use com\amazon\aws\{Credentials, CredentialProviders};
$credentials= Credentials::provided(
CredentialProviders::environment(),
CredentialProviders::containerService(),
);
Support https://docs.aws.amazon.com/sdkref/latest/guide/feature-container-credentials.html
API
Basic implementation
On top of this, these variables need to be taken into account:
AWS_CONTAINER_AUTHORIZATION_TOKEN
AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE
The result can be cached by checking the Expiration date (e.g.
2024-06-21T14:22:07Z
)See also: