amranidev / micro-bus

Event driven microservices with laravel/lumen and AWS
MIT License
73 stars 11 forks source link

fix: Only provide 'credentials' key if actually explicit values set #10

Closed polesen closed 3 years ago

polesen commented 3 years ago

If 'credentials' key is explicitly provided in config 'args' to a SDK client, then the AWS PHP SDK will not follow its (recommended) 'Default Credential Provider Chain', which means it won't find and use assumable roles in a pod in a EKS kubernetes cluster, not will it default to the credentials file.

This fix ensures, that if the user has NOT set both 'key' and 'secret', the SDK will fallback to using the 'Default Credential Provider Chain'.

See: https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials.html