aws
aws copied to clipboard
CredentialProvider fails with Default .env vars
Hi.
For our local development we define AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. On AWS we use the ContainerCredentials to define permissions. To not forget it in local development we preset the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY as empty variables in our default .env.
After deploying our application to AWS we found out that for accessing SQS via Symfony Messenger the ContainerCredentials are not taken into account.
I think the issue is this type safe null check in the CredentialProvider Class, because $accessKeyId and $secretAccessKeyId are of type "string(0)" when set to empty in the environment.
https://github.com/async-aws/aws/blob/6b7f1de154e9512b955cf9b2b0f4383778612ee1/src/Core/src/Credentials/ConfigurationProvider.php#L38-L40