aws icon indicating copy to clipboard operation
aws copied to clipboard

CredentialProvider fails with Default .env vars

Open nuggie opened this issue 2 years ago • 0 comments

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

nuggie avatar Jan 30 '23 20:01 nuggie