1

我正在编写一个 IAM 策略以从 CLI 部署 EC2 实例,我不想授予 EC2 完全访问权限。遵循最小权限原则,配置 EC2 实例所需的权限是什么

4

1 回答 1

2

这取决于您是否希望他们从控制台或 CLI 吃午饭。

对于控制台,根据文档,以下策略适用:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeInstances",
                "ec2:DescribeImages",
                "ec2:DescribeKeyPairs",
                "ec2:DescribeVpcs",
                "ec2:DescribeSubnets",
                "ec2:DescribeSecurityGroups",
                "ec2:CreateSecurityGroup",
                "ec2:AuthorizeSecurityGroupIngress",
                "ec2:CreateKeyPair"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": "ec2:RunInstances",
            "Resource": "*"
        }
    ]
}

对于 CLI,策略显示在此处

于 2020-05-04T22:58:52.730 回答