I am using OS: Ubuntu 14.04 and installed AWSCLI package using a terminal. while running AWS Iam commands, it's working fine.
eg: I ran this command
aws iam list-users
and got the following results
{
"Users": [
{
"Arn": "arn:aws:iam::3**16****332:user/xyz",
"CreateDate": "2014-09-29T14:21:25Z",
"UserId": "AIDAJY*******MW**W",
"Path": "/",
"UserName": "xyz"
},
{
"Arn": "arn:aws:iam::34****044**2:user/abcxyz",
"CreateDate": "2014-02-07T21:08:53Z",
"UserId": "AIDAJ******JML**V6Y",
"Path": "/",
"UserName": "abcxyz"
},
}
While using AWS SDK with Laravel 5.1, I configure Key, Secret, Region etc (same as configured in AWSCLI package)
while running this code in Laravel 5.1
$Iam = \App::make('aws')->createClient('Iam');
$result = $Iam->listUsers();
echo "<pre>";
print_r($result);
die();
getting following error(see attachment).
what can be the reason why the same configuration works fine in the terminal but not with SDK? I also tried SQS, which is working fine see the following code.
$obj = \App::make('aws')->createClient('Sqs');
$queue = $obj->getQueueUrl(['QueueName'=>'sms-demo']);
$queueUrl= $queue->get('QueueUrl');
$result = $obj->receiveMessage(
array('QueueUrl'=> $queueUrl));
IAM is a global service and not region specific. However when using the api you must use the us-east-1 region for the call.