在创建自定义运行情况下的政策错误 [英] Error in creating a custom run instances policy

查看:120
本文介绍了在创建自定义运行情况下的政策错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的IAM的AWS。我创建了一个策略

I am new to IAM in AWS. I have created a policy

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "TheseActionsDontSupportResourceLevelPermissions",
      "Effect": "Allow",
      "Action": "ec2:DescribeImages",
      "Resource": "*"
    },
    {
      "Sid": "TheseActionsSupportResourceLevelPermissions",
      "Effect": "Allow",
      "Action": "ec2:RunInstances",
      "Resource": [
         "arn:aws:ec2:us-east-1:109027:instance/*",
         "arn:aws:ec2:us-east-1:10927:image/*",
         "arn:aws:ec2:us-east-1:109027:security-group/Test_hin",
         "arn:aws:ec2:us-east-1:109027:subnet/subnet-b",
         "arn:aws:ec2:us-east-1:109527:key-pair/*",
         "arn:aws:ec2:us-east-1:10903527:network-interface/vpc-e4",
         "arn:aws:ec2:us-east-1:107:volume/*"
       ]
     }
   ]
}

每当我试图启动使用控制台的一个实例,它给了我,我没有被授权执行此操作的错误。

whenever I am trying to launch an instance using console, It gives me an error that i am not authorized to perform this action.

感谢

推荐答案

试着使用网​​络接口资源(貌似你想开设一个VPC)。此外,允许卷资源。

Try with the key pair and the network interface resources (Looks like you are trying to launch into a VPC). Also, allow the volume resources.

{
    "Version": "2012-10-17",
    "Statement": [
    {
       "Effect": "Allow",
       "Action": "ec2:RunInstances",
       "Resource": [
         "arn:aws:ec2:us-east-1:acct:instance/*",
         "arn:aws:ec2:us-east-1:acct:image/*",
         "arn:aws:ec2:us-east-1:acct:security-group/*",
         "arn:aws:ec2:us-east-1:acct:subnet/*",
         "arn:aws:ec2:us-east-1:acct:key-pair/*",
         "arn:aws:ec2:us-east-1:acct:network-interface/*",
         "arn:aws:ec2:us-east-1:acct:volume/*"
       ]
     }
   ]
}

这篇关于在创建自定义运行情况下的政策错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆