AWS SDK for PHP: Error retrieving credentials from the instance profile metadata server

后端 未结 9 692
灰色年华
灰色年华 2020-12-04 21:18

I am trying to send SNS messeges to android through web api. Downloaded and installed the SDK from http://aws.amazon.com/developers/getting-started/php/

Got followin

相关标签:
9条回答
  • 2020-12-04 22:04

    You can try these lines:

    $credentials = new Aws\Credentials\Credentials('key' , 'secret-key');

    $s3 = new S3Client(['version' => 'latest','region' => 'ap-south-1','credentials'=>$credentials]);

    0 讨论(0)
  • 2020-12-04 22:06

    Here are the steps:

    1. Type cd ~ By this you will go into the home directory.
    2. mkdir .aws
    3. sudo vi .aws/credentials
    4. Write following lines and save the file.

      [default]
      aws_access_key_id = Your AWS Access Key
      
      aws_secret_access_key = Your AWS Secret Access Key
      
    0 讨论(0)
  • 2020-12-04 22:14

    This might be because the config file hasn't been published.

    Be sure to publish the config file:

    php artisan vendor:publish  --provider="Aws\Laravel\AwsServiceProvider"
    

    To test this is the issue, just clear the config.

    php artisan config:clear
    

    If it works with the cache cleared, then this will be the issue.

    0 讨论(0)
提交回复
热议问题