AWS tips

AWS EC2 credentials

Credentials don´t need to be stored on the instance, you can just add a IAM role to the instance, and when accessing AWS services.

Examples of a SES client instance:

$SesClient = new SesClient([
  'version' => '2010-12-01',
  'region' => 'eu-west-2'
]);

By excluding the default profile, the credentials will be loaded from instance metadata and you will avoid this error:

Cannot read credentials from /.aws/credentials

Based on:
https://stackoverflow.com/questions/52402989/cannot-read-credentials-from-aws-credentials


2021-06-19