-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Hi !
There is a feature described in the README :
Automatically uses [IAM Instance Profile Credentials][aws-iam-credentials] on configured Amazon EC2 instances.
But i can see in doc/todo.md file :
4.Using credentials from environment variables, credentials profiles or env provider[...]
so i suppose this feature isn't effective after all.
In the PHPDoc of the AwsClient constructor we can see :
(Aws\Credentials\CredentialsInterface|array|bool|callable) [...] If no credentials are provided, the SDK will attempt to load them from the environment.
So instead of use
$this->sdk = new Sdk(
array(
'region' => $this->getRegion(),
// use specific aws sdk php version or latest version if not defined
'version' => ($this->getVersion() != ' ' ) ? $this->getVersion() : 'latest',
'credentials' => CredentialProvider::env()
)
);
suggested in doc/todo.md, we should use :
$options = array(
'region' => $this->getRegion(),
// use specific aws sdk php version or latest version if not defined
'version' => ($this->getVersion() !== '') ? $this->getVersion() : 'latest',
);
if ($this->getKey() !== '' && $this->getSecret() !== '') {
$options['credentials'] = new Credentials($this->getKey(), $this->getSecret());
}
$this->sdk = new Sdk($options);
Hope this could help.
Metadata
Metadata
Assignees
Labels
No labels