Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'AccessKeyId' error output when running aws s3 commands

I have an instance that has IAM role with several permissions. I get the following error when running s3 commands on that instance:

I run the command

 aws s3 cp s3://test-ue1/chef-12.3.0-1.el6.x86_64.rpm .

and get the following output

'AccessKeyId'

Does anyone know why? or how I can trouble shoot this?

like image 894
J K Avatar asked Apr 27 '16 01:04

J K


1 Answers

When I ran into this situation it was caused by a bad IAM instance profile configuration, specifically the assume role policy. Fixing that fixed the problem.

I don't have the bad policy anymore, but here's one that works:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Principal": {
        "Service": "ec2.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
like image 105
mblakele Avatar answered Oct 13 '22 15:10

mblakele