2014-09-24 165 views
1

试图设置用户只能访问一种类型的实例,只能停止和启动实例。但是当我为它设置一个策略时,我只是得到一个错误说未经授权:AWS IAM EC2访问实例ID

An error occurred fetching instance data: You are not authorized to perform this operation. 

帐户ID是从安全页面检索的。

为了测试的缘故,我已经让所有操作(EC2:*),并尝试了这些政策的

{ 
    "Version": "2012-10-17", 
    "Statement": [ 
    { 
     "Action": "ec2:*", 
     "Effect": "Allow", 
     "Resource": "arn:aws:ec2:us-east-1:XXXXXXXXXX:instance/i-XXXXXXX"  
    } 
    ] 
} 

与标签开发

{ 
    "Version": "2012-10-17", 
    "Statement": [ 
    { 
     "Sid": "Stmt1411556016000", 
     "Effect": "Allow", 
     "Action": [ 
     "ec2:StartInstances", 
     "ec2:StopInstances" 
     ], 
     "Resource" : "*" 
     "Condition": { 
     "ArnEquals": { 
      "ec2:ResourceTag/Environment": "dev" 
     } 
     } 
    } 
    ] 
} 

回答

0

这可能是this question重复,而是回答,您可能还需要授予DescribeInstances权限。

+0

我之前曾问过这个问题,但无论哪种方式它都回答了我的问题。 – Labithiotis 2015-04-28 12:06:52