xp-forge / aws

AWS Core for the XP Framework
0 stars 0 forks source link

Implement credential providers #9

Closed thekid closed 3 months ago

thekid commented 3 months ago

Implements #7 with the following API:

use com\amazon\aws\CredentialProvider;

// Returns credentials from the default credential provider chain, checking, in the following order:
// 
// 1. Environment variables
// 2. Shared credentials and config files
// 3. Amazon ECS container credentials
// 
// If none of the above provide credentials, an exception is raised.
$credentials= CredentialProvider::default()->credentials();

See https://docs.aws.amazon.com/sdkref/latest/guide/standardized-credentials.html and https://docs.aws.amazon.com/sdk-for-kotlin/latest/developer-guide/credential-providers.html

thekid commented 3 months ago

The full list supported by the PHP SDK is:

See https://github.com/aws/aws-sdk-php/blob/master/src/Credentials/CredentialProvider.php#L56


The missing providers AWS STS web identity (including Amazon Elastic Kubernetes Service (Amazon EKS)) as well as Amazon EC2 Instance Metadata Service and support for SSO and configured process providers can easily be implemented in subsequent releases.

thekid commented 3 months ago

Released in https://github.com/xp-forge/aws/releases/tag/v1.8.0

thekid commented 3 months ago

The missing [...] support for SSO [...] can easily be implemented in subsequent releases.

SSO support is in https://github.com/xp-forge/aws/releases/tag/v2.1.0